/* ===================================================
   北羿債務清理會員平台 — 設計系統
   Navy + Gold 配色延續官方品牌
   =================================================== */

/* --- CSS Variables --- */
:root {
  /* Brand Colors */
  --navy: #0d1f3c;
  --navy-mid: #162d55;
  --navy-light: #1e3f70;
  --navy-surface: #0a1628;
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --gold-pale: #f5e9c3;
  --gold-glow: rgba(201, 168, 76, 0.15);

  /* UI Colors */
  --white: #ffffff;
  --off-white: #f7f5f0;
  --gray-50: #fafaf8;
  --gray-100: #f0eee9;
  --gray-200: #e4e1db;
  --gray-300: #d1cdc5;
  --gray-400: #b0a898;
  --gray-500: #8a8278;
  --gray-600: #6b6560;
  --gray-700: #4a4540;
  --gray-800: #2d2a27;
  --gray-900: #1a1816;

  /* Semantic */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-dark: #065f46;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-dark: #92400e;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-dark: #991b1b;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  /* Tier Colors */
  --tier-free: #6b7280;
  --tier-1: #10b981;
  --tier-2: #3b82f6;
  --tier-3: #8b5cf6;
  --tier-4: #f59e0b;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);
  --shadow-glow: 0 0 40px rgba(201,168,76,0.2);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition-normal: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--off-white);
  color: var(--gray-800);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(13, 31, 60, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  z-index: 1000;
  transition: background var(--transition-normal);
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}
.nav-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.03em;
}
.nav-logo .logo-text span {
  color: var(--gold);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.nav-links a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}
.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-nav-login {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.btn-nav-login:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
}
.btn-nav-register {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  background: var(--gold);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.btn-nav-register:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}
.nav-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.nav-user-avatar:hover { transform: scale(1.08); }
.nav-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
}
.nav-tier-badge {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}
.tier-0 { background: rgba(107,114,128,0.2); color: #9ca3af; }
.tier-1 { background: rgba(16,185,129,0.15); color: #34d399; }
.tier-2 { background: rgba(59,130,246,0.15); color: #60a5fa; }
.tier-3 { background: rgba(139,92,246,0.15); color: #a78bfa; }
.tier-4 { background: rgba(245,158,11,0.15); color: #fbbf24; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* --- Hero Section --- */
.hero-section {
  padding: 140px 24px 80px;
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-light) 50%, #1a4a8a 100%);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(201,168,76,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero-title .accent {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 17px;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 4px 20px rgba(201,168,76,0.3);
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,168,76,0.4);
}
.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}
.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}
.btn-lg {
  padding: 16px 36px;
  font-size: 17px;
}
.btn-block { width: 100%; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 1px solid var(--gray-200);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* Dark Card */
.card-dark {
  background: var(--navy);
  border-color: rgba(201,168,76,0.2);
  color: var(--white);
}
.card-dark .card-header {
  border-bottom-color: rgba(255,255,255,0.1);
}

/* --- Tier Cards (Product Display) --- */
.tier-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.tier-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
}
.tier-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.tier-card.featured {
  border-color: var(--gold);
  box-shadow: var(--shadow-glow);
}
.tier-card.featured::before {
  content: '最受歡迎';
  position: absolute;
  top: 16px;
  right: -28px;
  background: var(--gold);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 36px;
  transform: rotate(45deg);
  z-index: 1;
}
.tier-card-header {
  padding: 28px 24px 20px;
  text-align: center;
}
.tier-card-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.tier-card-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--gray-800);
}
.tier-card-stage {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tier-card-price {
  padding: 16px 24px;
  text-align: center;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}
.tier-card-price .price-amount {
  font-size: 36px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
}
.tier-card-price .price-amount .currency {
  font-size: 18px;
  font-weight: 600;
  vertical-align: super;
}
.tier-card-price .price-note {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}
.tier-card-features {
  padding: 20px 24px;
  flex: 1;
}
.tier-card-features ul {
  list-style: none;
}
.tier-card-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--gray-700);
}
.tier-card-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.tier-card-features li.locked {
  opacity: 0.4;
}
.tier-card-features li.locked::before {
  content: '🔒';
}
.tier-card-action {
  padding: 16px 24px 24px;
}
.tier-card-action .btn {
  width: 100%;
}

/* --- Section Layout --- */
.section {
  padding: 80px 24px;
}
.section-alt { background: var(--gray-50); }
.section-dark {
  background: var(--navy);
  color: var(--white);
}
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 48px;
}
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
  line-height: 1.3;
}
.section-dark .section-title { color: var(--white); }
.section-desc {
  font-size: 16px;
  color: var(--gray-500);
  line-height: 1.8;
}
.section-dark .section-desc { color: rgba(255,255,255,0.6); }
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Pre-screening Form --- */
.screening-form {
  max-width: 640px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.screening-form-header {
  background: var(--navy);
  padding: 24px 32px;
  border-bottom: 3px solid var(--gold);
}
.screening-form-header h3 {
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
}
.screening-form-header p {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-top: 4px;
}
.screening-form-body {
  padding: 32px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid.single {
  grid-template-columns: 1fr;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full-width {
  grid-column: 1 / -1;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}
.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-800);
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(30,63,112,0.08);
}
.form-input::placeholder { color: var(--gray-400); }
.form-hint {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6560' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 20px 0;
  grid-column: 1 / -1;
}
.form-submit-area {
  margin-top: 24px;
}

/* --- Dashboard Layout --- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--nav-height));
  margin-top: var(--nav-height);
}
.dashboard-sidebar {
  background: var(--navy);
  padding: 24px 0;
  border-right: 1px solid rgba(201,168,76,0.2);
}
.sidebar-user {
  padding: 0 20px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}
.sidebar-avatar {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 auto 12px;
}
.sidebar-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}
.sidebar-tier {
  display: inline-block;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}
.sidebar-nav {
  list-style: none;
  padding: 0 8px;
}
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}
.sidebar-nav li a.active {
  border-left: 3px solid var(--gold);
  padding-left: 13px;
}
.sidebar-nav .nav-icon { font-size: 18px; flex-shrink: 0; }
.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.3);
  padding: 16px 16px 8px;
  font-weight: 600;
}

.dashboard-main {
  padding: 32px;
  background: var(--gray-50);
  overflow-y: auto;
}
.dashboard-welcome {
  margin-bottom: 32px;
}
.dashboard-welcome h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.dashboard-welcome p {
  color: var(--gray-500);
  font-size: 15px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.gold { background: var(--gold-glow); }
.stat-icon.blue { background: var(--info-bg); }
.stat-icon.green { background: var(--success-bg); }
.stat-icon.purple { background: rgba(139,92,246,0.1); }
.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}
.stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--gray-200);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.feature-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-card.locked {
  opacity: 0.6;
  cursor: default;
}
.feature-card.locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--gray-200);
}
.feature-card .feature-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}
.feature-card .feature-info { flex: 1; }
.feature-card .feature-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.feature-card .feature-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}
.feature-card .lock-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gray-100);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Feature cards in dark sections */
.section-dark .feature-card {
  background: var(--navy-surface);
  border-color: rgba(201,168,76,0.2);
}
.section-dark .feature-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(201,168,76,0.15);
}
.section-dark .feature-card .feature-icon {
  background: rgba(201,168,76,0.1);
}
.section-dark .feature-card .feature-name {
  color: var(--white);
}
.section-dark .feature-card .feature-desc {
  color: rgba(255,255,255,0.6);
}

/* --- Petition Generator Steps --- */
.petition-container {
  max-width: 900px;
  margin: calc(var(--nav-height) + 32px) auto 48px;
  padding: 0 24px;
}
.petition-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}
.petition-step-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}
.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--gray-300);
  color: var(--gray-400);
  transition: all var(--transition-normal);
  background: var(--white);
}
.step-dot.active {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.2);
}
.step-dot.completed {
  border-color: var(--success);
  background: var(--success);
  color: var(--white);
}
.step-line {
  width: 60px;
  height: 2px;
  background: var(--gray-300);
  transition: background var(--transition-normal);
}
.step-line.completed { background: var(--success); }
.step-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 6px;
  text-align: center;
}
.step-label.active { color: var(--gold); font-weight: 600; }

.petition-form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.petition-form-header {
  background: var(--navy);
  padding: 24px 32px;
  border-bottom: 3px solid var(--gold);
}
.petition-form-header h2 {
  color: var(--white);
  font-size: 20px;
  font-weight: 700;
}
.petition-form-header p {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  margin-top: 4px;
}
.petition-form-body {
  padding: 32px;
}
.petition-form-actions {
  display: flex;
  justify-content: space-between;
  padding: 20px 32px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* --- Result Preview --- */
.result-preview {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-200);
  padding: 28px;
  margin-top: 24px;
}
.result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.result-kpi {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--gray-200);
}
.result-kpi .kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.result-kpi .kpi-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.recommendation-box {
  background: var(--navy);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.recommendation-icon { font-size: 32px; }
.recommendation-text h4 {
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
}
.recommendation-text p {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-top: 4px;
}

/* --- Auth Page --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-light) 60%, #1a4a8a 100%);
  position: relative;
  overflow: hidden;
  padding: 24px;
}
.auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.auth-card-header {
  background: var(--navy);
  padding: 32px;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}
.auth-card-header h1 {
  color: var(--white);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}
.auth-card-header p {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}
.auth-card-body { padding: 32px; }
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}
.auth-tab.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-error {
  background: var(--danger-bg);
  color: var(--danger-dark);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.auth-error.show { display: flex; }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-normal);
  overflow: hidden;
}
.modal-overlay.show .modal-content {
  transform: scale(1) translateY(0);
}
.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gray-500);
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-800); }
.modal-body { padding: 28px; }
.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* --- Upsell Banner --- */
.upsell-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 24px 0;
  border: 1px solid rgba(201,168,76,0.3);
}
.upsell-icon { font-size: 48px; flex-shrink: 0; }
.upsell-text { flex: 1; }
.upsell-text h3 {
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.upsell-text p {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}
.upsell-action { flex-shrink: 0; }

/* --- Footer --- */
.footer {
  background: var(--navy-surface);
  border-top: 1px solid rgba(201,168,76,0.2);
  padding: 48px 24px 32px;
}
.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.footer-brand .logo-text span { color: var(--gold); }
.footer-brand p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}
.footer-links h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.footer-links a {
  display: block;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  padding: 4px 0;
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.footer-disclaimer {
  max-width: var(--max-width);
  margin: 16px auto 0;
  font-size: 13px; /* 從 12px 提升到 13px，加深顏色提升可讀性 */
  color: rgba(255,255,255,0.45); /* 從 0.3 加深到 0.45 */
  text-align: center;
  line-height: 1.8;
}

/* --- Toast Notification --- */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 16px);
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  animation: slideIn 0.3s var(--ease-out);
  border-left: 4px solid var(--info);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-text { font-size: 14px; color: var(--gray-700); flex: 1; }
.toast-close {
  font-size: 16px;
  color: var(--gray-400);
  cursor: pointer;
  flex-shrink: 0;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Loading --- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .nav-container { justify-content: flex-start; gap: 16px; }
  .hamburger-menu { display: block !important; }
  .nav-user-menu { margin-left: auto; }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    display: block !important;
    position: fixed;
    top: var(--nav-height);
    left: -280px;
    bottom: 0;
    width: 260px;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
  }
  .dashboard-sidebar.mobile-open {
    left: 0;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-section { padding: 120px 16px 60px; }
  /* Tier Card 手機版改為 2x2 格線，讓用戶能同時看到兩張卡片對比 */
  .tier-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 12px; }
  .tier-card-header { padding: 18px 16px 12px; }
  .tier-card-icon { font-size: 30px; margin-bottom: 8px; }
  .tier-card-name { font-size: 16px; }
  .tier-card-stage { font-size: 11px; }
  .tier-card-price { padding: 12px 16px; }
  .tier-card-price .price-amount { font-size: 28px; }
  .tier-card-features { padding: 14px 16px; }
  .tier-card-features li { font-size: 13px; padding: 4px 0; }
  .tier-card-action { padding: 12px 16px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .upsell-banner { flex-direction: column; text-align: center; }
  .petition-progress { transform: scale(0.85); }
}
@media (max-width: 480px) {
  /* 下 480px 才改回單欄（小機型手機） */
  .tier-cards { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .result-summary { grid-template-columns: 1fr 1fr; }
}

/* --- Utility --- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* --- Grouped Features --- */
.grouped-features-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.tier-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tier-group-title {
  font-size: 15px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--white);
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 4px;
  box-shadow: var(--shadow-sm);
}
.tier-group-title.tier-0 { background: var(--gray-600); }
.tier-group-title.tier-1 { background: var(--success-dark); }
.tier-group-title.tier-2 { background: var(--info); }
.tier-group-title.tier-3 { background: var(--tier-3); }
.tier-group-title.tier-4 { background: var(--warning-dark); }

/* ===================================================
   北羿會員平台修正 - 新增樣式 (Phase 1 & 2)
   =================================================== */

/* 1. 主站返回 Banner */
.site-bridge-bar {
  background: var(--white);
  color: var(--navy);
  padding: 8px 24px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--gold);
}
.site-bridge-bar strong {
  color: var(--navy);
}
.site-bridge-bar a {
  color: var(--navy);
  font-weight: 700;
  transition: color var(--transition-fast);
}
.site-bridge-bar a:hover {
  color: var(--gold);
}

/* 2. LINE / 電話入口樣式 */
.btn-line-cta {
  background: #06C755;
  color: var(--white) !important;
  border: none;
  font-weight: 700;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-line-cta:hover {
  background: #05b04b;
  transform: translateY(-1px);
}

.floating-line-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #06C755;
  color: var(--white) !important;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(6, 199, 85, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  z-index: 1999;
  text-decoration: none;
  transition: all var(--transition-normal);
  animation: float-pulse 2s infinite ease-in-out;
}
.floating-line-btn svg {
  fill: currentColor;
}
.floating-line-btn:hover {
  background: #05b04b;
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 199, 85, 0.5);
}
@keyframes float-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 3. 跑馬燈 CSS 動畫 */
.marquee-bar {
  background: var(--navy-mid);
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  color: var(--white);
  overflow: hidden;
  padding: 6px 0;
  font-size: 13px;
  width: 100%;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 25s linear infinite;
}
.marquee-content {
  flex-shrink: 0;
  padding-right: 4rem;
  white-space: nowrap;
}
@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* 4. 社會證明 / 見證卡片 */
.testimonials-section {
  padding: 60px 0;
  background: var(--gray-50);
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-pale);
}
.testimonial-meta {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 6px;
}
.testimonial-result {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}
.testimonial-text {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
}
.testimonials-note {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 24px;
}

/* 5. Tooltip 樣式 */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--navy-mid);
  color: var(--gold) !important;
  border-radius: 50%;
  font-size: 11px;
  margin-left: 4px;
  cursor: help;
  position: relative;
}
.tooltip-trigger::after {
  content: attr(title);
  position: absolute;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--navy);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: normal;
  width: 220px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 100;
  pointer-events: none;
  font-weight: 400;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tooltip-trigger:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

/* 6. 服務流程 (Funnel) 樣式 */
.funnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.funnel-step {
  text-align: center;
  position: relative;
}
.funnel-step-num {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  font-weight: 800;
}
.funnel-step-num.step-1 {
  background: var(--gold-glow);
  border: 2px solid var(--gold);
  color: var(--gold);
}
.funnel-step-num.step-2 {
  background: rgba(16,185,129,0.1);
  border: 2px solid var(--tier-1);
  color: var(--tier-1);
}
.funnel-step-num.step-3 {
  background: rgba(59,130,246,0.1);
  border: 2px solid var(--tier-2);
  color: var(--tier-2);
}
.funnel-step-num.step-4 {
  background: rgba(139,92,246,0.1);
  border: 2px solid var(--tier-3);
  color: var(--tier-3);
}
.funnel-step-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.funnel-step-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.6;
}

/* 7. Tier Card 預覽摺疊 */
.tier-preview {
  margin-top: 14px;
  border-top: 1px dashed var(--gray-200);
  padding-top: 10px;
}
.preview-toggle {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  width: 100%;
  text-align: left;
  transition: color var(--transition-fast);
}
.preview-toggle:hover {
  color: var(--gold-light);
}
.preview-content {
  margin-top: 8px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--gray-600);
}
.preview-content ul {
  list-style: disc;
  margin-left: 18px;
  padding: 0;
}
.preview-content li {
  margin-bottom: 4px;
}
.preview-content p {
  margin-top: 8px;
  font-weight: bold;
  color: var(--navy-mid);
}

/* 8. 首頁信任宣傳條 (Trust Bar) 新增與浮動拉抬 */
.trust-bar {
  position: relative;
  z-index: 100;
  margin-top: -48px; /* 往上移一點，放在有藍色區塊的下緣 */
  margin-bottom: 24px;
  padding: 0 24px;
}
.trust-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(13, 31, 60, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.25);
  padding: 16px 24px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.trust-bar-inner span {
  font-size: 14px; /* 從 13px 提升到 14px，改善略花眼族群可讀性 */
  color: var(--navy-mid);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 9. 跑馬燈與 Navbar 相鄰微調 */
.site-bridge-bar {
  margin-top: var(--nav-height);
}
.navbar ~ .marquee-bar {
  margin-top: var(--nav-height);
}
.site-bridge-bar + .marquee-bar {
  margin-top: 0;
}



