/* ============================================================
   FairBill — "Designing for Trust" web design system
   Palette mirrors the Android app: deep navy, slate blue,
   emerald (fair prices / success), amber (warnings), paper white.
   ============================================================ */

:root {
  --navy: #1E3A5F;
  --navy-dim: #2A4F7C;
  --navy-deep: #001D3D;
  --blue: #3B82F6;
  --blue-soft: #EFF6FF;
  --emerald: #059669;
  --emerald-soft: #D1FAE5;
  --amber: #F59E0B;
  --amber-soft: #FEF3C7;
  --crimson: #DC2626;
  --crimson-soft: #FEE2E2;
  --paper: #F5F7FA;
  --card: #FFFFFF;
  --panel: #EDF0F5;
  --ink: #0F172A;
  --slate: #475569;
  --muted: #94A3B8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 48px rgba(15, 23, 42, .14);
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 247, 250, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30, 58, 95, .08);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.25rem; color: var(--navy);
  text-decoration: none; letter-spacing: -.02em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  display: grid; place-items: center;
  color: #fff; font-size: 1rem; font-weight: 800;
}
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  object-fit: cover; display: block;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .15);
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  color: var(--slate); text-decoration: none; font-size: .92rem; font-weight: 600;
  transition: color .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-cta {
  background: var(--navy); color: #fff !important; padding: 9px 18px;
  border-radius: 999px; font-weight: 700;
  transition: background .15s;
}
.nav-cta:hover { background: var(--navy-dim); }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; border-radius: 8px;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: var(--navy);
  margin: 4px auto; border-radius: 2px; transition: transform .2s, opacity .2s;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 72px;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(59, 130, 246, .12), transparent),
    radial-gradient(900px 400px at 10% 0%, rgba(5, 150, 105, .08), transparent);
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--emerald-soft); color: #064E3B;
  font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); }
h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.3rem);
  line-height: 1.12; font-weight: 800; letter-spacing: -.03em; color: var(--navy-deep);
}
h1 .accent { color: var(--emerald); }
.hero p.lead {
  margin: 20px 0 32px; font-size: 1.13rem; color: var(--slate); max-width: 34rem;
}
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 12px; font-weight: 700; font-size: 1rem;
  text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
  border: none; cursor: pointer;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--navy-dim); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid rgba(30,58,95,.25); }
.btn-ghost:hover { border-color: var(--navy); }
.hero-note { margin-top: 16px; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* Phone mockup */
.phone {
  width: 290px; margin: 0 auto;
  background: var(--navy-deep); border-radius: 36px; padding: 12px;
  box-shadow: var(--shadow-lg);
}
.phone-screen {
  background: var(--paper); border-radius: 26px; overflow: hidden;
  font-size: .72rem;
}
.phone-top {
  background: var(--navy); color: #fff; padding: 14px 16px 18px;
}
.phone-top .t1 { font-weight: 800; font-size: .85rem; }
.phone-top .t2 { opacity: .75; font-size: .68rem; }
.phone-card {
  background: #fff; margin: 10px 12px; border-radius: 12px; padding: 12px;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
}
.phone-card .label { font-size: .58rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.phone-row { display: flex; justify-content: space-between; margin-top: 6px; align-items: baseline; }
.phone-row .big { font-size: 1.05rem; font-weight: 800; }
.red { color: var(--crimson); }
.green { color: var(--emerald); }
.phone-bar { height: 8px; border-radius: 4px; background: var(--panel); margin-top: 6px; overflow: hidden; }
.phone-bar i { display: block; height: 100%; border-radius: 4px; }
.chip {
  display: inline-block; font-size: .56rem; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; margin-right: 4px; margin-top: 8px;
}
.chip.high { background: var(--crimson-soft); color: #7F1D1D; }
.chip.med { background: var(--amber-soft); color: #78350F; }
.chip.ok { background: var(--emerald-soft); color: #064E3B; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
section.alt { background: #fff; }
.section-head { text-align: center; max-width: 44rem; margin: 0 auto 48px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; color: var(--navy-deep); }
.section-head p { margin-top: 14px; color: var(--slate); font-size: 1.05rem; }
h3 { font-weight: 700; color: var(--navy-deep); }

/* Cards grid */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); border: 1px solid rgba(30,58,95,.05);
}
.card .icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 16px; background: var(--blue-soft); color: var(--blue);
}
.card .icon.green { background: var(--emerald-soft); color: var(--emerald); }
.card .icon.amber { background: var(--amber-soft); color: var(--amber); }
.card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.card p { color: var(--slate); font-size: .94rem; }

/* Steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  background: var(--card); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 800; margin-bottom: 14px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step p { color: var(--slate); font-size: .93rem; }

/* Comparison table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table.compare { width: 100%; border-collapse: collapse; background: #fff; min-width: 560px; }
table.compare th, table.compare td { padding: 14px 18px; text-align: left; font-size: .93rem; }
table.compare thead th {
  background: var(--navy); color: #fff; font-weight: 700; font-size: .85rem;
  letter-spacing: .03em;
}
table.compare tbody tr:nth-child(even) { background: var(--paper); }
table.compare td.money { font-weight: 700; }

/* FAQ */
.faq-item {
  background: #fff; border-radius: var(--radius-sm); margin-bottom: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 20px 24px; font-weight: 700; color: var(--navy-deep);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.4rem; color: var(--blue); font-weight: 400;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 24px 20px; color: var(--slate); font-size: .95rem; }

/* Callouts */
.callout {
  border-radius: var(--radius); padding: 24px 28px; display: flex; gap: 16px;
  align-items: flex-start; margin: 24px 0;
}
.callout.privacy { background: var(--emerald-soft); color: #064E3B; }
.callout.warn { background: var(--amber-soft); color: #78350F; }
.callout strong { display: block; margin-bottom: 4px; }
.callout p { font-size: .93rem; }

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--navy-deep) 0%, var(--navy) 60%, var(--navy-dim) 100%);
  border-radius: 24px; padding: 56px 48px; text-align: center; color: #fff;
}
.cta-band h2 { color: #fff; }
.cta-band p { margin: 14px auto 28px; opacity: .85; max-width: 36rem; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--blue-soft); transform: translateY(-1px); }

/* Legal pages */
.legal { max-width: 780px; margin: 0 auto; padding: 56px 24px 80px; }
.legal h1 { font-size: 2rem; margin-bottom: 6px; }
.legal .updated { color: var(--muted); font-size: .9rem; margin-bottom: 36px; }
.legal h2 { font-size: 1.25rem; margin: 36px 0 12px; }
.legal p, .legal li { color: var(--slate); font-size: .97rem; margin-bottom: 12px; }
.legal ul { padding-left: 22px; margin-bottom: 12px; }
.legal a { color: var(--blue); }

/* Page hero (inner pages) */
.page-hero { padding: 64px 0 40px; text-align: center; }
.page-hero p { margin-top: 12px; color: var(--slate); max-width: 40rem; margin-left: auto; margin-right: auto; }

/* Support */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.support-card a.mail { color: var(--blue); font-weight: 700; text-decoration: none; word-break: break-all; }

/* ---------- Footer ---------- */
footer {
  background: var(--navy-deep); color: rgba(255,255,255,.75); padding: 56px 0 32px;
  margin-top: 72px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
.footer-grid h4 { color: #fff; font-size: .9rem; margin-bottom: 14px; letter-spacing: .04em; }
.footer-grid a { display: block; color: rgba(255,255,255,.65); text-decoration: none; font-size: .9rem; margin-bottom: 10px; }
.footer-grid a:hover { color: #fff; }
.footer-brand { font-weight: 800; font-size: 1.2rem; color: #fff; margin-bottom: 10px; }
.footer-tag { font-size: .88rem; max-width: 22rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 44px; padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .82rem; color: rgba(255,255,255,.5);
}
.disclaimer {
  font-size: .8rem; color: rgba(255,255,255,.45); margin-top: 20px; max-width: 60rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .phone { margin-top: 8px; }
  .grid-3, .steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: flex-start;
    padding: 20px 24px; gap: 18px; box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .grid-3, .grid-2, .steps, .support-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 24px; }
  section { padding: 52px 0; }
}
