@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --navy-glow: rgba(15, 23, 42, 0.08);
  --teal: #0284c7;
  --teal-dark: #0369a1;
  --teal-glow: rgba(2, 132, 199, 0.12);
  --amber: #d97706;
  --amber-light: #fef3c7;
  --white: #ffffff;
  --gray: #f8fafc;
  --gray-medium: #f1f5f9;
  --text: #1e293b;
  --text-dark: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #10b981;
  --green-light: #d1fae5;
  --red: #ef4444;
  --red-light: #fee2e2;
  
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
}

* { 
  box-sizing: border-box; 
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--gray);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { 
  color: var(--teal); 
  text-decoration: none; 
  font-weight: 500;
  transition: var(--transition);
}
a:hover { 
  color: var(--teal-dark); 
  text-decoration: none; 
}

.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 24px; 
}

/* ---------------- Navigation ---------------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-logo { 
  font-family: var(--font-display);
  font-weight: 800; 
  font-size: 22px; 
  color: var(--navy); 
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-logo span { 
  color: var(--teal); 
}
.nav-center { 
  display: flex; 
  gap: 8px; 
}
.nav-right { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}

.mode-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.mode-btn:hover {
  background: var(--gray-medium);
  color: var(--navy);
}
.mode-btn.active { 
  background: var(--navy); 
  color: var(--white); 
  border-color: var(--navy); 
  box-shadow: var(--shadow-sm);
}

/* balance dropdown */
.balance-wrap { position: relative; }
.balance-btn {
  background: var(--gray-medium);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.balance-btn:hover {
  background: #e2e8f0;
}
.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 48px;
  width: 260px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 60;
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.dropdown.open { display: block; }
.dropdown .email { font-size: 12px; font-weight: 600; color: var(--navy); word-break: break-all; }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.dropdown a { 
  display: block; 
  padding: 8px 10px; 
  color: var(--text); 
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}
.dropdown a:hover { 
  background: var(--gray); 
  color: var(--teal);
}
.dropdown .small { font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  gap: 8px;
}
.btn:hover { 
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--teal-glow);
  filter: brightness(1.05); 
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled { 
  opacity: 0.6; 
  cursor: not-allowed; 
  transform: none;
  box-shadow: none;
}
.btn-full { width: 100%; }
.btn-navy { 
  background: linear-gradient(135deg, var(--navy) 0%, #1e293b 100%); 
}
.btn-navy:hover {
  box-shadow: 0 4px 12px var(--navy-glow);
}
.btn-outline { 
  background: var(--white); 
  color: var(--teal); 
  border: 1.5px solid var(--teal); 
}
.btn-outline:hover {
  background: rgba(2, 132, 199, 0.04);
}
.btn-ghost { 
  background: transparent; 
  color: var(--navy); 
  border: none; 
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--gray-medium);
}

.btn-text-mobile { display: none; }
.btn-text-desktop { display: inline; }

/* ---------------- Cards / layout ---------------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  transition: var(--transition);
}
.card-narrow { max-width: 440px; margin: 48px auto; }
.card-mid { max-width: 760px; margin: 40px auto; }
.section { padding: 80px 0; }
.section-gray { background: var(--gray-medium); }
.center { text-align: center; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--navy); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--text-dark);
  background-color: var(--white);
  transition: var(--transition);
}
.field input:focus, .field textarea:focus { 
  outline: none; 
  border-color: var(--teal); 
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.field .err { color: var(--red); font-size: 12px; margin-top: 6px; font-weight: 500; }
textarea { min-height: 240px; resize: vertical; line-height: 1.6; }

/* ---------------- Flash / alerts ---------------- */
.alert { 
  padding: 14px 20px; 
  border-radius: var(--radius); 
  margin-bottom: 20px; 
  font-size: 14px; 
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success { background: #d1fae5; color: #047857; border: 1px solid #6ee7b7; }
.alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.alert-amber {
  background: #fef3c7; 
  color: #b45309;
  border: 1px solid #fde047; 
  border-radius: var(--radius);
  padding: 16px 20px; 
  margin: 20px 0;
  font-weight: 500;
}
.alert-amber ul { margin: 8px 0 0 20px; padding: 0; }

.privacy-badge {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  margin: 24px auto;
  max-width: 760px;
}

/* ---------------- Hero (landing) ---------------- */
.hero { 
  min-height: 60vh; 
  display: flex; 
  flex-direction: column;
  align-items: center; 
  justify-content: center; 
  text-align: center; 
  padding: 30px 24px; 
}
.hero .eyebrow { 
  color: var(--teal); 
  text-transform: uppercase;
  font-size: 13px; 
  letter-spacing: 2px; 
  font-weight: 700; 
  margin-bottom: 4px;
}
.hero h1 { 
  font-family: var(--font-display);
  color: var(--navy); 
  font-size: 42px; 
  line-height: 1.15;
  font-weight: 800; 
  margin: 6px 0; 
  max-width: 800px; 
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--navy) 40%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.sub { 
  color: var(--muted); 
  font-size: 17px; 
  max-width: 560px; 
  margin-top: 4px;
  margin-bottom: 16px;
}
@media (max-width: 640px) { 
  .hero h1 { font-size: 32px; } 
  .hero p.sub { font-size: 15px; }

  .nav {
    padding: 10px 12px;
    gap: 8px;
  }
  .nav-logo {
    font-size: 18px;
  }
  .nav-center {
    gap: 4px;
  }
  .nav-center .mode-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .nav-right {
    gap: 6px;
  }
  .nav-right .btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  .nav-right .btn-ghost {
    padding: 8px 8px;
  }
  .balance-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .btn-text-desktop { display: none; }
  .btn-text-mobile { display: inline; }
  
  .tab-panel.active {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------------- Score bars ---------------- */
.score-header {
  background: linear-gradient(135deg, var(--navy) 0%, #1e293b 100%); 
  color: var(--white);
  padding: 32px; 
  border-radius: var(--radius-lg);
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  flex-wrap: wrap; 
  gap: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.score-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--teal-glow) 0%, transparent 60%);
  pointer-events: none;
}
.score-header .big { 
  font-family: var(--font-display);
  font-size: 48px; 
  font-weight: 800; 
  letter-spacing: -0.02em;
}
.grade-badge {
  background: var(--teal); 
  color: var(--white);
  border-radius: 50%; 
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px; 
  font-weight: 800;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.4);
}
.mode-badge { 
  background: rgba(255, 255, 255, 0.12); 
  padding: 6px 14px;
  border-radius: 20px; 
  font-size: 12px; 
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.bar-row { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  margin: 16px 0; 
}
.bar-label { 
  width: 140px; 
  font-size: 14px; 
  font-weight: 600; 
  color: var(--navy);
}
.bar-track { 
  flex: 1; 
  height: 12px; 
  background: var(--gray-medium);
  border-radius: 20px; 
  overflow: hidden; 
}
.bar-fill { 
  height: 100%; 
  width: 0; 
  border-radius: 20px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); 
}
.bar-fill.green { background: linear-gradient(90deg, #10b981, #059669); }
.bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bar-fill.red { background: linear-gradient(90deg, #ef4444, #dc2626); }
.bar-pct { 
  width: 48px; 
  text-align: right; 
  font-size: 14px; 
  font-weight: 700; 
  color: var(--navy);
}

/* ---------------- Tabs ---------------- */
.tabs { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 6px; 
  border-bottom: 2px solid var(--border); 
  margin: 32px 0 20px 0; 
}
.tab { 
  padding: 12px 20px; 
  cursor: pointer; 
  border: none; 
  background: none;
  font-size: 15px; 
  font-weight: 600; 
  color: var(--muted); 
  border-bottom: 2px solid transparent; 
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab:hover {
  color: var(--navy);
}
.tab.active { 
  color: var(--teal); 
  border-bottom: 2px solid var(--teal); 
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tabFade 0.2s ease-in-out; }
@keyframes tabFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Tables ---------------- */
table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 14px; 
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
th, td { 
  text-align: left; 
  padding: 14px 18px; 
  border-bottom: 1px solid var(--border); 
  vertical-align: middle; 
}
th { 
  background: var(--gray); 
  font-size: 11px; 
  text-transform: uppercase; 
  letter-spacing: 0.8px; 
  color: var(--muted); 
  font-weight: 700;
}
tr.clickable { 
  cursor: pointer; 
  transition: var(--transition);
}
tr.clickable:hover {
  background-color: var(--gray);
}

.dot { 
  display: inline-block; 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  margin-right: 8px; 
}
.dot.green { background: var(--green); box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.dot.amber { background: var(--amber); box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.dot.gray { background: #94a3b8; }
.row-inferred { background: rgba(245, 158, 11, 0.03); }
.src-text { 
  font-size: 13px; 
  color: var(--muted); 
  padding: 14px 20px; 
  background: #f1f5f9; 
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

.badge { 
  display: inline-block; 
  padding: 4px 10px; 
  border-radius: 12px; 
  font-size: 11px; 
  font-weight: 700; 
}
.badge-red { background: var(--red-light); color: var(--red); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-gray { background: var(--gray-medium); color: var(--muted); }

/* ---------------- Loading ---------------- */
.spinner { 
  width: 32px; 
  height: 32px; 
  border: 3.5px solid var(--border);
  border-top-color: var(--teal); 
  border-radius: 50%; 
  animation: spin 0.8s linear infinite;
  display: inline-block; 
  vertical-align: middle; 
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { 
  margin-top: 16px; 
  color: var(--navy); 
  font-weight: 600;
  font-size: 15px; 
}

/* ---------------- Upload / dropzone ---------------- */
.dropzone { 
  border: 2px dashed #cbd5e1; 
  border-radius: var(--radius-lg);
  padding: 50px 40px; 
  text-align: center; 
  color: var(--muted); 
  cursor: pointer; 
  background: var(--gray);
  transition: var(--transition);
}
.dropzone:hover {
  border-color: var(--teal);
  background: rgba(2, 132, 199, 0.02);
}
.dropzone.drag { 
  border-color: var(--teal); 
  background: #f0f9ff; 
  transform: scale(0.99);
}
.dropzone .file-name { 
  color: var(--teal-dark); 
  font-weight: 700; 
  margin-top: 12px; 
  font-size: 15px;
}

/* ---------------- Pricing cards ---------------- */
.pricing-row { 
  display: flex; 
  gap: 20px; 
  flex-wrap: wrap; 
  justify-content: center; 
}
.price-card { 
  border: 1px solid var(--border); 
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 32px 24px; 
  text-align: center; 
  flex: 1; 
  min-width: 200px; 
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.price-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.price-card.popular { 
  border-color: var(--teal); 
  box-shadow: var(--shadow-lg); 
  position: relative; 
}
.price-card .amt { 
  font-family: var(--font-display);
  font-size: 38px; 
  font-weight: 800; 
  color: var(--navy); 
  margin-bottom: 8px;
}
.popular-tag { 
  position: absolute; 
  top: -12px; 
  left: 50%; 
  transform: translateX(-50%);
  background: var(--teal); 
  color: #fff; 
  font-size: 11px; 
  font-weight: 700;
  padding: 4px 12px; 
  border-radius: 20px; 
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ---------------- Footer ---------------- */
.footer { 
  border-top: 1px solid var(--border); 
  padding: 40px 24px; 
  color: var(--muted);
  font-size: 13px; 
  text-align: center; 
  margin-top: 60px; 
  line-height: 1.8;
}
.footer a { 
  margin: 0 8px; 
  font-weight: 500;
}

.disclaimer { 
  background: #f1f5f9; 
  border-radius: var(--radius); 
  padding: 20px;
  font-size: 12px; 
  color: var(--muted); 
  margin-top: 32px; 
  line-height: 1.7;
  border-left: 4px solid var(--muted);
}
.amt-green { color: var(--green); font-weight: 600; }
.amt-red { color: var(--red); font-weight: 600; }

/* ---------------- Custom list layout ---------------- */
#questionsList {
  padding-left: 0;
  list-style: none;
}
#questionsList li {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}
#questionsList li .badge {
  flex-shrink: 0;
}

