*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #5333A6;
  --color-primary-dark: #452A93;
  --color-primary-light: #7A52C5;
  --color-accent: #B47EDB;
  --color-bg: #FFFFFF;
  --color-bg-soft: #F7F3FC;
  --color-surface-purple: #F0E8FA;
  --color-border: #E6DEF2;
  --color-text-main: #1F1744;
  --color-text-secondary: #5F567A;
  --color-text-muted: #8B82A8;
  --gradient-primary: linear-gradient(135deg, #5333A6 0%, #7A52C5 55%, #B47EDB 100%);
  --gradient-soft: linear-gradient(135deg, #F7F3FC 0%, #EFE5FA 45%, #FFFFFF 100%);
  --shadow-purple: 0 16px 40px rgba(83, 51, 166, 0.14);
  --shadow-purple-soft: 0 8px 24px rgba(69, 42, 147, 0.10);
  --radius-card: 24px;
  --radius-button: 16px;
}

html, body {
  font-family: 'Inter', 'Noto Sans TC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  color: var(--color-text-main);
  background:
    radial-gradient(circle at 18% 10%, rgba(216, 182, 242, 0.38) 0%, transparent 34%),
    radial-gradient(circle at 82% 8%, rgba(180, 126, 219, 0.26) 0%, transparent 30%),
    linear-gradient(180deg, #FFFFFF 0%, #F7F3FC 100%);
  min-height: 100vh;
}

/* ── Phone wrapper ── */
.app-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.phone {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.94);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-purple);
  backdrop-filter: blur(18px);
}

@media (max-width: 520px) {
  .app-shell { background: #fff; }
  .phone { box-shadow: none; }
}

@media (max-width: 320px) {
  .page-title { font-size: 20px; }
  .modal-box { margin: 12px; padding: 20px 16px; }
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 12px 16px;
  min-height: 52px;
  /* needed for absolute-positioned title */
  isolation: isolate;
}

.navbar-back {
  background: none;
  border: none;
  font-size: 20px;
  color: #5F567A;
  cursor: pointer;
  padding: 4px 8px 4px 0;
  line-height: 1;
  flex-shrink: 0;
}

.navbar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #1F1744;
  white-space: nowrap;
  pointer-events: none;
}

.navbar-badge {
  font-size: 13px;
  color: #5F567A;
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
}

.navbar-right {
  min-width: 92px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.navbar-step {
  font-size: 12px;
  color: #5F567A;
  white-space: nowrap;
}

.navbar-lang,
.floating-lang {
  display: flex;
  justify-content: flex-end;
}

.lang-select-wrap--nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #F0E8FA;
  border-radius: 999px;
  padding: 4px 18px 4px 7px;
  border: 1px solid #E6DEF2;
  user-select: none;
}

.lang-select-wrap--nav .lang-globe {
  font-size: 12px;
  line-height: 1;
}

.lang-select-wrap--nav select {
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  color: #5F567A;
  font-size: 11px;
  font-weight: 700;
  max-width: 62px;
}

.lang-select-wrap--nav::after {
  content: '▾';
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: #5F567A;
  pointer-events: none;
}

.floating-lang {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 20;
}

/* ── Scrollable content ── */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  padding-bottom: 40px;
}

.page-content--gray {
  background: #F7F3FC;
}

/* ── Cards ── */
.card {
  background:
    radial-gradient(circle at top right, rgba(180,126,219,0.16), transparent 35%),
    rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  padding: 16px;
  box-shadow: var(--shadow-purple-soft);
  backdrop-filter: blur(16px);
}

.card + .card { margin-top: 12px; }

/* ── Typography ── */
.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--color-primary-light);
  background: var(--color-surface-purple);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: #1F1744;
  margin-bottom: 8px;
  text-align: center;
}

.page-title .green { color: #5333A6; }

.page-desc {
  font-size: 14px;
  color: #5F567A;
  line-height: 1.6;
}

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-button);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 12px 28px rgba(83, 51, 166, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-primary);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(83, 51, 166, 0.28);
}

.btn-primary-gray {
  background: #E6DEF2;
  color: #5F567A;
}

.btn-outline {
  background: var(--color-surface-purple);
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}

.btn-outline:hover { border-color: #8B82A8; }

.btn-orange {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(83, 51, 166, 0.18);
}

.btn-orange:hover { background: var(--gradient-primary); }

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
  display: inline-block;
  width: auto;
}

/* ── Tags ── */
.tag {
  display: inline-block;
  background: #F0E8FA;
  color: #5F567A;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  margin: 2px 4px 2px 0;
}

.tag-green {
  background: #F0E8FA;
  color: #6843BB;
}

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; color: #5F567A; margin-bottom: 6px; display: block; }

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E6DEF2;
  border-radius: 10px;
  font-size: 15px;
  color: #1F1744;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus { border-color: #5333A6; }

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8B82A8;
  pointer-events: none;
  font-size: 14px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 14px;
  color: #5F567A;
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Flex utilities ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: #F0E8FA;
  margin: 12px 0;
}

/* ── Company avatar ── */
.company-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #8B82A8;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Green quote block ── */
.quote-block {
  border-left: 4px solid #5333A6;
  padding: 10px 14px;
  background: #F7F3FC;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: #5F567A;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ── Bullet list ── */
.bullet-list { list-style: none; padding: 0; }
.bullet-list li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: #5F567A;
  line-height: 1.6;
  margin-bottom: 6px;
}
.bullet-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #5333A6;
}
.plain-list { list-style: none; padding: 0; }
.plain-list li {
  font-size: 13px;
  color: #5F567A;
  line-height: 1.6;
  margin-bottom: 4px;
  padding-left: 0;
}

/* ── Section heading inside cards ── */
.sub-heading {
  font-size: 13px;
  font-weight: 700;
  color: #5F567A;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-heading::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--gradient-primary);
  border-radius: 2px;
}
