/* ═══════════════════════════════════════════════════════════════════════════
   MM2H 管家 Platform — platform.css
   Color palette: Navy / Gold / White
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --primary:   #0D1B2A;
  --secondary: #C8A03C;
  --accent:    #1B4965;
  --light:     #F8F7F3;
  --white:     #FFFFFF;
  --text:      #1F2933;
  --muted:     #6B7280;
  --border:    #E5E0D5;
  --danger:    #DC3545;
  --success:   #198754;
  --shadow-sm: 0 2px 8px rgba(13,27,42,.08);
  --shadow-md: 0 4px 20px rgba(13,27,42,.12);
  --shadow-lg: 0 8px 40px rgba(13,27,42,.18);
  --radius:    12px;
  --radius-sm: 8px;
  --transition: .25s ease;
  --font-sans: 'Segoe UI', 'PingFang TC', 'PingFang SC', 'Microsoft JhengHei', 'Microsoft YaHei', system-ui, sans-serif;
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--light);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Typography ────────────────────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; color: var(--primary); line-height: 1.3; }
.text-gold  { color: var(--secondary) !important; }
.text-navy  { color: var(--primary) !important; }
.text-accent{ color: var(--accent)   !important; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-gold {
  background: var(--secondary);
  color: var(--primary);
  border: 2px solid var(--secondary);
  font-weight: 600;
  padding: .55rem 1.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-gold:hover {
  background: #b8902f;
  border-color: #b8902f;
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-outline-gold {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--secondary);
  font-weight: 600;
  padding: .55rem 1.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-outline-gold:hover {
  background: var(--secondary);
  color: var(--primary);
}
.btn-navy {
  background: var(--primary);
  color: var(--white);
  border: 2px solid var(--primary);
  font-weight: 600;
  padding: .55rem 1.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-navy:hover {
  background: #1a3050;
  border-color: #1a3050;
  color: var(--white);
  transform: translateY(-1px);
}

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.mm2h-navbar {
  background: var(--primary);
  padding: .85rem 0;
  box-shadow: var(--shadow-md);
}
.mm2h-navbar .nav-link {
  color: rgba(255,255,255,.8) !important;
  font-weight: 500;
  padding: .4rem .85rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.mm2h-navbar .nav-link:hover,
.mm2h-navbar .nav-link.active {
  color: var(--secondary) !important;
  background: rgba(200,160,60,.08);
}

/* Brand */
.brand-icon {
  width: 44px; height: 44px;
  background: var(--secondary);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.3rem;
  flex-shrink: 0;
}
.brand-icon-sm {
  width: 32px; height: 32px;
  font-size: 1rem;
}
.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -.02em;
}
.brand-tagline {
  display: block;
  font-size: .65rem;
  color: rgba(255,255,255,.5);
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 600;
}
.lang-switcher a {
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color var(--transition);
  padding: .15rem .3rem;
  border-radius: 4px;
}
.lang-switcher a:hover,
.lang-switcher a.active {
  color: var(--secondary);
  background: rgba(200,160,60,.1);
}
.lang-switcher span { color: rgba(255,255,255,.25); }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c8a03c' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(200,160,60,.15);
  border: 1px solid rgba(200,160,60,.3);
  color: var(--secondary);
  padding: .35rem 1rem;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--white);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.hero-title span { color: var(--secondary); }
.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,.75);
  max-width: 560px;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.hero-stat-item { text-align: center; }
.hero-stat-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--secondary);
  line-height: 1;
}
.hero-stat-label { font-size: .8rem; color: rgba(255,255,255,.6); margin-top: .25rem; }

/* ── Section ───────────────────────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-alt { background: var(--white); }
.section-dark {
  background: var(--primary);
  color: var(--white);
}
.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 { color: var(--white); }

/* ── Dark section text — only affect DIRECT content, never white cards inside ── */
/* Excludes .mm2h-form-card, .mm2h-card, .auth-card, .pricing-card (white bg) */

.section-dark > .container p,
.section-dark > .container li,
.section-dark > .container small { color: rgba(255,255,255,.78); }

.section-dark > .container .text-muted { color: rgba(255,255,255,.55) !important; }

/* Dark-text-on-dark helper class for direct dark section content */
.on-dark         { color: rgba(255,255,255,.85) !important; }
.on-dark-muted   { color: rgba(255,255,255,.55) !important; }

/* Hero section — left col text only */
.hero-subtitle   { color: rgba(255,255,255,.78) !important; }
.hero-stat-label { color: rgba(255,255,255,.55) !important; }
.hero-section > .container .text-muted { color: rgba(255,255,255,.55) !important; }

/* Footer — all text explicitly set, no reliance on Bootstrap text-muted */
.mm2h-footer { color: rgba(255,255,255,.65); }
.footer-text         { color: rgba(255,255,255,.62) !important; }
.footer-text-bright  { color: rgba(255,255,255,.9)  !important; }
.footer-link         { color: rgba(255,255,255,.55) !important; text-decoration: none; transition: color var(--transition); }
.footer-link:hover   { color: var(--secondary) !important; }
.footer-social       { color: rgba(255,255,255,.5)  !important; transition: color var(--transition); }
.footer-social:hover { color: var(--secondary) !important; }
.mm2h-footer h6      { color: var(--secondary) !important; }
.mm2h-footer strong  { color: rgba(255,255,255,.88) !important; }
.mm2h-footer small   { color: rgba(255,255,255,.55) !important; }
.mm2h-footer a:not(.footer-link):not(.footer-social) { color: rgba(255,255,255,.55); }

/* Sidebar — dark bg text */
.sidebar p,
.sidebar small,
.sidebar span:not(.badge) { color: rgba(255,255,255,.6); }

.section-label {
  color: var(--secondary);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  margin-bottom: 1rem;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.mm2h-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  height: 100%;
}
.mm2h-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}
.mm2h-card .card-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--secondary) 0%, #e8c060 100%);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.mm2h-card .card-title { font-size: 1.05rem; margin-bottom: .5rem; }
.mm2h-card .card-text  { color: var(--muted); font-size: .9rem; }

/* Stat cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--primary); }
.stat-card .stat-label { font-size: .78rem; color: var(--muted); margin-top: .2rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Pricing ───────────────────────────────────────────────────────────────── */
.pricing-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  text-align: center;
  position: relative;
  transition: all var(--transition);
  height: 100%;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.featured {
  border-color: var(--secondary);
  background: linear-gradient(180deg, rgba(200,160,60,.04) 0%, var(--white) 100%);
}
.pricing-featured-badge {
  position: absolute;
  top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--secondary);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem 1rem;
  border-radius: 50px;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pricing-price {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin: 1rem 0;
}
.pricing-price small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.pricing-features { list-style: none; padding: 0; text-align: left; }
.pricing-features li {
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.pricing-features li::before { content: '✓'; color: var(--secondary); font-weight: 700; flex-shrink: 0; }

/* ── Process steps ─────────────────────────────────────────────────────────── */
.step-card {
  text-align: center;
  padding: 1.5rem;
}
.step-number {
  width: 52px; height: 52px;
  background: var(--secondary);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  margin: 0 auto 1rem;
}

/* ── Dashboard layout ──────────────────────────────────────────────────────── */
.dashboard-wrapper { display: flex; min-height: calc(100vh - 70px); }
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--primary);
  padding: 1.5rem 0;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 1rem;
}
.sidebar-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: .75rem 1.25rem .25rem;
}
.sidebar a.nav-link {
  color: rgba(255,255,255,.7) !important;
  padding: .6rem 1.25rem !important;
  font-size: .88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .65rem;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.sidebar a.nav-link:hover,
.sidebar a.nav-link.active {
  color: var(--secondary) !important;
  border-left-color: var(--secondary);
  background: rgba(200,160,60,.07);
}
.sidebar a.nav-link i { font-size: 1rem; width: 18px; text-align: center; }

.main-content {
  flex: 1;
  padding: 2rem;
  min-width: 0;
}
.page-header {
  margin-bottom: 1.75rem;
}
.page-header h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.page-header .breadcrumb { font-size: .82rem; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.mm2h-table { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.mm2h-table table { margin: 0; }
.mm2h-table th {
  background: var(--light);
  color: var(--primary);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .85rem 1rem;
  border-bottom: 2px solid var(--border);
}
.mm2h-table td { padding: .85rem 1rem; vertical-align: middle; font-size: .9rem; border-color: var(--border); }
.mm2h-table tbody tr:hover { background: rgba(200,160,60,.04); }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.mm2h-form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.form-label { font-weight: 600; font-size: .88rem; color: var(--primary); margin-bottom: .35rem; }
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  font-size: .9rem;
  transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(200,160,60,.15);
}

/* ── Progress tracker ──────────────────────────────────────────────────────── */
.progress-timeline { position: relative; padding-left: 2.5rem; }
.progress-timeline::before {
  content: '';
  position: absolute;
  left: .85rem;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}
.timeline-dot {
  position: absolute;
  left: -1.65rem;
  top: .35rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--border);
}
.timeline-dot.done   { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.active { background: var(--secondary); box-shadow: 0 0 0 2px var(--secondary); }
.timeline-content { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.25rem; }
.timeline-content.active { border-color: var(--secondary); background: rgba(200,160,60,.04); }

/* ── Onboarding steps ──────────────────────────────────────────────────────── */
.onboarding-steps {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  overflow-x: auto;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 120px;
}
.onboarding-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 20px;
}
.onboarding-step.done:not(:last-child)::after { background: var(--secondary); }
.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.onboarding-step.done   .step-circle { background: var(--secondary); color: var(--primary); }
.onboarding-step.active .step-circle { background: var(--primary); color: var(--white); box-shadow: 0 0 0 4px rgba(13,27,42,.15); }
.step-label { font-size: .75rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.onboarding-step.active .step-label,
.onboarding-step.done   .step-label { color: var(--primary); }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge { font-size: .72rem; font-weight: 600; padding: .3em .65em; border-radius: 6px; }

/* ── Alert ─────────────────────────────────────────────────────────────────── */
.alert {
  border: none;
  border-left: 4px solid;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.alert-success { border-left-color: var(--success); background: rgba(25,135,84,.08); }
.alert-danger   { border-left-color: var(--danger);  background: rgba(220,53,69,.08); }
.alert-warning  { border-left-color: #ffc107;        background: rgba(255,193,7,.08); }
.alert-info     { border-left-color: var(--accent);  background: rgba(27,73,101,.08); }

/* ── Auth pages ────────────────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-logo .brand-icon { margin: 0 auto .75rem; }
.auth-title { text-align: center; font-size: 1.4rem; margin-bottom: 1.5rem; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.mm2h-footer {
  background: #080F19;
  color: rgba(255,255,255,.8);
  padding: 4rem 0 2rem;
  margin-top: auto;
}
.footer-divider { border-color: rgba(255,255,255,.08); margin: 2rem 0 1.5rem; }
.footer-link {
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-link:hover { color: var(--secondary); }
.footer-social { transition: color var(--transition); }
.footer-social:hover { color: var(--secondary) !important; }
.footer-disclaimer { background: rgba(255,255,255,.04); border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.lang-switcher-footer {
  font-size: .8rem;
  display: flex;
  gap: .4rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.lang-switcher-footer a { color: rgba(255,255,255,.4); text-decoration: none; }
.lang-switcher-footer a:hover { color: var(--secondary); }
.lang-switcher-footer span { color: rgba(255,255,255,.15); }

/* ── Dark page-header banners (admin/member section-dark banners) ──────────── */
.section-dark .page-title-sub,
[class*="section-dark"] p.hero-subtitle,
[class*="section-dark"] p.on-dark { color: rgba(255,255,255,.8) !important; }

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.min-vh-75 { min-height: 75vh; }
.bg-light-custom { background: var(--light); }
.border-gold { border-color: var(--secondary) !important; }
.rounded-mm2h { border-radius: var(--radius); }
.shadow-mm2h { box-shadow: var(--shadow-md); }
.divider-gold {
  height: 4px;
  width: 50px;
  background: var(--secondary);
  border-radius: 2px;
  margin: .75rem auto 1.25rem;
}

/* AI eligibility result */
.eligibility-result {
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
}
.eligibility-result.eligible   { background: rgba(25,135,84,.08); border: 2px solid #198754; }
.eligibility-result.potential  { background: rgba(255,193,7,.08); border: 2px solid #ffc107; }
.eligibility-result.consult    { background: rgba(27,73,101,.08); border: 2px solid var(--accent); }
.eligibility-result.insufficient { background: rgba(108,117,125,.08); border: 2px solid #6c757d; }
.eligibility-result .result-icon { font-size: 3rem; margin-bottom: .75rem; }
.eligibility-result .result-title { font-size: 1.4rem; font-weight: 800; margin-bottom: .5rem; }

/* ── Document status colors ────────────────────────────────────────────────── */
.doc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  transition: all var(--transition);
}
.doc-card:hover { box-shadow: var(--shadow-sm); }
.doc-card .doc-icon { font-size: 1.75rem; flex-shrink: 0; }
.doc-status-verified    { border-left: 4px solid var(--success); }
.doc-status-pending     { border-left: 4px solid #ffc107; }
.doc-status-rejected    { border-left: 4px solid var(--danger); }
.doc-status-resubmit    { border-left: 4px solid var(--accent); }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .main-content { padding: 1.25rem; }
  .hero-section { min-height: 70vh; text-align: center; }
  .hero-subtitle { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
}
@media (max-width: 575.98px) {
  .auth-card { padding: 1.75rem 1.25rem; }
  .pricing-card { padding: 1.5rem; }
  .section { padding: 3rem 0; }
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary); }