/* ============================================================
   Spenzaa — AI-Powered Expense Tracker
   Single shared stylesheet · mobile-first · zero dependencies
   ============================================================ */

:root {
  --bg: #07070f;
  --bg-2: #0c0c1c;
  --surface: #12122a;
  --surface-2: #181836;
  --border: rgba(139, 92, 246, .18);
  --violet: #8b5cf6;
  --purple: #7c3aed;
  --blue: #3b82f6;
  --cyan: #38bdf8;
  --grad: linear-gradient(135deg, #a855f7 0%, #7c6cf8 45%, #3b82f6 100%);
  --grad-soft: linear-gradient(135deg, rgba(168,85,247,.14), rgba(59,130,246,.14));
  --text: #eceaf8;
  --muted: #a3a1c2;
  --success: #34d399;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 20px 60px -20px rgba(124, 58, 237, .35);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1140px, 92%); margin-inline: auto; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--violet); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 7, 15, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(139, 92, 246, .12);
}

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 0; gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 36px; height: 36px; flex: none; }

.nav-toggle { display: none; }
.nav-toggle-label {
  display: none; cursor: pointer; width: 42px; height: 42px;
  border-radius: 10px; border: 1px solid var(--border);
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.nav-toggle-label span {
  display: block; width: 20px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .25s, opacity .25s;
}

.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.7rem; border-radius: 999px; font-weight: 700; font-size: .97rem;
  border: none; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s;
  text-decoration: none !important;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 24px 70px -18px rgba(124,58,237,.55); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--violet); background: rgba(139,92,246,.08); }
.btn-lg { padding: 1rem 2.2rem; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 5.5rem 0 4.5rem; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto;
  height: 130%; pointer-events: none; z-index: -1;
  background:
    radial-gradient(600px 380px at 30% 20%, rgba(139,92,246,.22), transparent 65%),
    radial-gradient(600px 380px at 72% 30%, rgba(59,130,246,.18), transparent 65%);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--violet); background: rgba(139,92,246,.1);
  border: 1px solid var(--border); padding: .4rem 1rem; border-radius: 999px;
  margin-bottom: 1.4rem;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.12; letter-spacing: -.03em; font-weight: 800;
  margin-bottom: 1.2rem;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 46rem; margin: 0 auto 2.2rem; }

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 1rem; font-size: .85rem; color: var(--muted); }

/* ---------- Stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-top: 3.5rem;
}
.stat { background: var(--bg-2); padding: 1.6rem 1rem; text-align: center; }
.stat strong { display: block; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat span { font-size: .85rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-2); }

.section-head { text-align: center; max-width: 44rem; margin: 0 auto 3rem; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -.02em; line-height: 1.2; margin-bottom: .9rem; font-weight: 800; }
h3 { font-size: 1.18rem; margin-bottom: .5rem; font-weight: 700; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.8rem;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(139,92,246,.45); }
.card p { color: var(--muted); font-size: .95rem; }

.card-icon {
  width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft); border: 1px solid var(--border); margin-bottom: 1.1rem; font-size: 1.4rem;
}

/* ---------- Steps ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 0; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; background: var(--grad);
  color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 1rem;
}

/* ---------- Phone mockup ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.split .content h2 { text-align: left; }
.split .content p { color: var(--muted); margin-bottom: 1rem; }

.checklist { list-style: none; margin: 1.4rem 0; }
.checklist li { padding-left: 2rem; position: relative; margin-bottom: .8rem; color: var(--text); }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%; background: var(--grad-soft);
  border: 1px solid var(--border); color: var(--success);
  font-size: .8rem; display: flex; align-items: center; justify-content: center; font-weight: 800;
}

.phone {
  width: min(300px, 80%); margin-inline: auto; border-radius: 38px;
  border: 1px solid rgba(139,92,246,.35);
  background: linear-gradient(165deg, var(--surface-2), var(--bg-2));
  box-shadow: var(--shadow); padding: 1.2rem; aspect-ratio: 9 / 18.5;
  display: flex; flex-direction: column; gap: .9rem; position: relative; overflow: hidden;
}
.phone::before { content: ""; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; background: var(--bg); border-radius: 999px; }
.p-row { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.p-balance { font-size: 1.6rem; font-weight: 800; }
.p-chip { background: var(--grad); border-radius: 12px; padding: .9rem 1rem; color: #fff; font-weight: 700; font-size: .85rem; box-shadow: 0 10px 30px -10px rgba(124,58,237,.6); }
.p-bars { display: flex; align-items: flex-end; gap: 7px; height: 88px; padding: .6rem .2rem 0; }
.p-bars i { flex: 1; border-radius: 6px 6px 2px 2px; background: var(--grad-soft); border: 1px solid var(--border); }
.p-bars i.hot { background: var(--grad); border: none; }
.p-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: .65rem .8rem; font-size: .8rem; }
.p-item b { font-size: .82rem; }
.p-item span { color: var(--muted); font-size: .72rem; display: block; }
.p-amt { font-weight: 700; }
.p-amt.neg { color: #f87171; } .p-amt.pos { color: var(--success); }

/* ---------- Testimonials ---------- */
.quote-card { display: flex; flex-direction: column; gap: 1rem; }
.quote-card blockquote { color: var(--text); font-size: .98rem; }
.quote-who { display: flex; align-items: center; gap: .8rem; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex: none; }
.quote-who b { display: block; font-size: .92rem; }
.quote-who span { color: var(--muted); font-size: .8rem; }
.stars { color: #fbbf24; letter-spacing: 2px; font-size: .9rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 46rem; margin-inline: auto; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: .9rem; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 1.1rem 1.4rem; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--violet); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.4rem 1.2rem; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
  text-align: center; background: var(--grad-soft); border: 1px solid var(--border);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(500px 300px at 50% 0%, rgba(139,92,246,.25), transparent 70%);
}
.cta-band h2 { margin-bottom: .8rem; }
.cta-band p { color: var(--muted); margin-bottom: 1.8rem; }

/* ---------- Forms (contact) ---------- */
.form-grid { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .4rem; }
input, textarea, select {
  width: 100%; padding: .85rem 1rem; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: .95rem;
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--violet); }
textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: .82rem; color: var(--muted); }

.contact-cards .card { text-align: center; }
.contact-cards .card a { font-weight: 600; }

/* ---------- Legal pages ---------- */
.legal { max-width: 50rem; margin-inline: auto; }
.legal h2 { font-size: 1.35rem; margin: 2.4rem 0 .8rem; }
.legal p, .legal li { color: var(--muted); margin-bottom: .8rem; }
.legal ul, .legal ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.legal-meta { color: var(--muted); font-size: .9rem; border-left: 3px solid var(--violet); padding-left: 1rem; margin: 1.5rem 0 2rem; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .85rem; color: var(--muted); padding: 1.2rem 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid rgba(139,92,246,.12); padding: 3.5rem 0 2rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-grid p { color: var(--muted); font-size: .9rem; margin-top: .8rem; max-width: 28rem; }
.footer-grid h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: .55rem; }
.footer-grid ul a { color: var(--muted); font-size: .92rem; }
.footer-grid ul a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: .85rem;
}
.socials { display: flex; gap: .9rem; }
.socials a {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; font-weight: 700;
}
.socials a:hover { color: var(--text); border-color: var(--violet); text-decoration: none; }

/* ---------- Values / about ---------- */
.timeline { border-left: 2px solid var(--border); margin: 2rem 0 0 .5rem; padding-left: 2rem; display: grid; gap: 2rem; }
.timeline-item { position: relative; }
.timeline-item::before {
  content: ""; position: absolute; left: -2.6rem; top: .35rem;
  width: 14px; height: 14px; border-radius: 50%; background: var(--grad);
}
.timeline-item b { display: block; color: var(--violet); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .2rem; }
.timeline-item p { color: var(--muted); font-size: .95rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive — tablet ≤ 980px
   ============================================================ */
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 3.5rem 0; }
}

/* ============================================================
   Responsive — mobile ≤ 680px
   ============================================================ */
@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 3.5rem 0 3rem; }

  .nav-toggle-label { display: flex; }
  .nav-links {
    position: fixed; inset: 61px 0 auto 0; z-index: 99;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10, 10, 22, .98);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links li { border-top: 1px solid rgba(255,255,255,.05); }
  .nav-links a { display: block; padding: 1rem 1.6rem; font-size: 1.05rem; }
  .nav-links .nav-cta { margin: 1rem 1.6rem 1.4rem; }
  .nav-toggle:checked ~ .nav-links { max-height: 480px; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .footer-bottom { flex-direction: column; text-align: center; }
}
