/* ============================================================
   Finora marketing site — shared styles
   Palette, type, and shadow language are pulled 1:1 from the
   app's own theme (lib/themes/app_theme.dart) so the site reads
   as the same product, not a separate marketing skin.
   ============================================================ */

@font-face {
  font-family: "Minigap";
  src: url("../fonts/Minigap-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  /* Colors — copied from AppColors in lib/themes/app_theme.dart */
  --primary: #2DB17A;
  --primary-light: #52C99A;
  --primary-dark: #1A7A50;
  --income: #27AE60;
  --expense: #D95B5B;
  --savings: #0288D1;
  --warning: #F57C00;
  --surface: #F2F2F2;
  --card: #FFFFFF;
  --navy: #091C37;
  --text-secondary: #5A6A62;
  --border: #E2E8F0;

  --shadow-primary: 0 20px 40px -12px rgba(45, 177, 122, 0.35);
  --shadow-card: 0 1px 2px rgba(9, 28, 55, 0.04), 0 8px 24px rgba(9, 28, 55, 0.06);

  --display: "Minigap", "Poppins", sans-serif;
  --body: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html, body {
  /* Defensive: a nowrap button or long word should never be able to widen
     the page — grid/flex items are fixed up individually below, this is
     just a backstop. */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--navy);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  margin: 0;
}

p { margin: 0; color: var(--text-secondary); }

a {
  color: var(--primary-dark);
  text-decoration: none;
}

img { max-width: 100%; display: block; }

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

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

/* ---------------------------------------------------------
   Nav — translucent + blurred, echoing the dashboard's own
   glass app bar treatment (lib/screens/dashboard).
   --------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(242, 242, 242, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(9, 28, 55, 0.06);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--navy);
}
.brand img { width: 30px; height: 30px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: 500;
  font-size: 14.5px;
}
.nav-links a { color: var(--navy); opacity: 0.8; }
.nav-links a:hover { opacity: 1; color: var(--primary-dark); }
.nav-links .btn { opacity: 1; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  margin: 4px 0;
  border-radius: 2px;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 12px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { box-shadow: 0 24px 48px -14px rgba(45, 177, 122, 0.45); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-dark); }

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  padding: 88px 0 64px;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
/* Grid items default to min-width:auto, sizing to their widest unbreakable
   child (here, the nowrap CTA buttons) — that can stretch the whole grid
   track wider than the viewport instead of letting text/buttons wrap. */
.hero-copy, .hero-art { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: rgba(45, 177, 122, 0.1);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 177, 122, 0.25);
}

.hero h1 {
  font-size: clamp(38px, 5.4vw, 60px);
  letter-spacing: -0.01em;
}
.hero h1 .accent { color: var(--primary-dark); }

.hero-sub {
  margin-top: 22px;
  font-size: 17.5px;
  max-width: 46ch;
  color: var(--text-secondary);
}

.hero-ctas {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.hero-stat b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  color: var(--navy);
}
.hero-stat span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Signature element: animated ascending bar mark, worn as a badge/sticker
   overlapping the phone's corner — not a shape floating loose in space. */
.hero-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge {
  position: absolute;
  top: -20px;
  right: 6px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--card);
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-card), 0 14px 26px -8px rgba(9, 28, 55, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.bar-mark {
  width: 44px;
  height: 44px;
  opacity: 1;
}
.bar-mark rect {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both;
}
.bar-mark rect:nth-child(1) { animation-delay: 0.05s; }
.bar-mark rect:nth-child(2) { animation-delay: 0.2s; }
.bar-mark rect:nth-child(3) { animation-delay: 0.35s; }
.bar-mark path { opacity: 0; animation: fadeIn 0.5s ease 0.75s both; }
@keyframes rise {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Phone mockup */
.phone {
  position: relative;
  width: 268px;
  border-radius: 36px;
  padding: 10px;
  background: linear-gradient(160deg, #1c2230, #0c0f16);
  box-shadow: var(--shadow-card), 0 40px 70px -20px rgba(9, 28, 55, 0.35);
  animation: floaty 6s ease-in-out infinite;
}
.phone::before {
  content: "";
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.18);
  z-index: 2;
}
.phone img {
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.08);
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .phone { animation: none; }
  .bar-mark rect, .bar-mark path { animation: none; opacity: 1; transform: none; }
}

/* ---------------------------------------------------------
   Bar-step divider — decorative, echoes the brand mark; a
   rhythm device between sections, not a numbering system.
   --------------------------------------------------------- */
.bar-rule {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 26px;
  margin: 0 auto;
  width: fit-content;
  opacity: 0.55;
}
.bar-rule span {
  width: 8px;
  border-radius: 2px;
  background: var(--primary);
}
.bar-rule span:nth-child(1) { height: 30%; background: var(--primary-light); }
.bar-rule span:nth-child(2) { height: 55%; }
.bar-rule span:nth-child(3) { height: 78%; background: var(--primary); }
.bar-rule span:nth-child(4) { height: 100%; background: var(--primary-dark); }
.bar-rule span:nth-child(5) { height: 68%; background: var(--primary); }

.section { padding: 96px 0; }
.section-tight { padding: 56px 0; }

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 64px;
}
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 38px);
  margin-top: 18px;
}
.section-head p {
  margin-top: 16px;
  font-size: 16.5px;
}

/* ---------------------------------------------------------
   Feature ledger
   --------------------------------------------------------- */
.feature-row {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 64px;
  align-items: center;
  padding: 56px 0;
}
.feature-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.feature-row.reverse .feature-copy { order: 2; }
.feature-row.reverse .feature-shot { order: 1; }
.feature-copy, .feature-shot { min-width: 0; }

.feature-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.feature-icon svg { width: 22px; height: 22px; }

.feature-copy h3 {
  font-size: 25px;
  margin-bottom: 14px;
}
.feature-copy p { font-size: 16px; max-width: 42ch; }
.feature-copy ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14.5px;
  color: var(--text-secondary);
}
.feature-copy li {
  padding-left: 22px;
  position: relative;
  margin-top: 10px;
}
.feature-copy li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--primary);
}

.feature-shot { display: flex; justify-content: center; }
.feature-shot .phone { animation: none; width: 240px; }

/* ---------------------------------------------------------
   Trust strip
   --------------------------------------------------------- */
.trust {
  background: var(--navy);
  color: #fff;
}
.trust .section-head h2 { color: #fff; }
.trust .section-head p { color: rgba(255,255,255,0.65); }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: hidden;
}
.trust-item {
  background: #0d2340;
  padding: 32px 26px;
}
.trust-item .feature-icon { background: rgba(255,255,255,0.08); }
.trust-item h4 {
  color: #fff;
  font-size: 16.5px;
  margin-bottom: 8px;
}
.trust-item p { color: rgba(255,255,255,0.6); font-size: 14px; }

/* ---------------------------------------------------------
   CTA band
   --------------------------------------------------------- */
.cta-band {
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 28px;
  padding: 64px 32px;
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.cta-band h2 { color: #fff; font-size: clamp(26px, 3.4vw, 34px); }
.cta-band p { color: rgba(255,255,255,0.85); margin-top: 14px; }
.cta-band .hero-ctas { justify-content: center; margin-top: 30px; }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.4); }
.cta-band .btn-ghost:hover { border-color: #fff; color: #fff; }
.cta-band .btn-primary { background: #fff; color: var(--primary-dark); box-shadow: none; }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 36px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-tagline {
  margin-top: 10px;
  font-size: 14px;
  max-width: 32ch;
}
.footer-links {
  display: flex;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 500;
}
.footer-links a { color: var(--navy); opacity: 0.75; }
.footer-links a:hover { opacity: 1; color: var(--primary-dark); }
.footer-bottom {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------
   Policy pages (privacy / terms)
   --------------------------------------------------------- */
.policy-hero {
  padding: 64px 0 32px;
}
.policy-hero .eyebrow { margin-bottom: 18px; }
.policy-hero h1 { font-size: clamp(32px, 4.4vw, 46px); }
.policy-hero .effective-date {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-secondary);
}

.policy-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  padding-bottom: 96px;
  align-items: flex-start;
}
.policy-toc {
  position: sticky;
  top: 100px;
  font-size: 14px;
}
.policy-toc div { font-weight: 600; color: var(--navy); margin-bottom: 14px; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-dark); }
.policy-toc a {
  display: block;
  padding: 7px 0;
  color: var(--text-secondary);
  border-left: 2px solid var(--border);
  padding-left: 14px;
}
.policy-toc a:hover { color: var(--primary-dark); border-color: var(--primary); }

.policy-body { max-width: 68ch; }
.policy-body section { margin-bottom: 40px; scroll-margin-top: 100px; }
.policy-body h2 {
  font-size: 20px;
  margin-bottom: 14px;
  padding-top: 6px;
}
.policy-body p, .policy-body li {
  font-size: 15.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.policy-body ul { padding-left: 20px; }
.policy-body strong { color: var(--navy); }
.policy-body a { text-decoration: underline; text-underline-offset: 3px; }

.callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 18px 0;
  box-shadow: var(--shadow-card);
}
.callout p { color: var(--navy); font-size: 14.5px; margin: 0; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; margin-bottom: 12px; }
  .phone { width: 220px; }
  .feature-row, .feature-row.reverse {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .feature-row .feature-copy, .feature-row.reverse .feature-copy { order: 2 !important; }
  .feature-row .feature-shot, .feature-row.reverse .feature-shot { order: 1 !important; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .policy-layout { grid-template-columns: 1fr; }
  .policy-toc { display: none; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 76px; left: 0; right: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.25s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a, .nav-links .btn { padding: 14px 0; }
  .nav-toggle { display: block; }
  .hero-stats { flex-wrap: wrap; row-gap: 18px; }
  .footer-top { flex-direction: column; }

  /* Stack CTA rows full-width instead of relying on nowrap + flex-wrap,
     which just moves the min-content overflow risk from row to button. */
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { white-space: normal; }
}
