/* OneFi marketing site — tokens lifted 1:1 from the Flutter app's app_theme.dart,
   so the web presence never drifts from the product's real visual identity. */

:root {
  --red: #E2352E;
  --red-deep: #C82129;
  --red-soft: #FFE3DF;
  --on-red: #FFFFFF;
  --jade: #0E8F63;
  --jade-soft: #DDF5EA;
  --gold: #C9871A;
  --gold-soft: #FFF1D6;
  --ink: #241A18;
  --ink-soft: #5C4A46;
  --cloud: #FFFBFA;
  --paper: #FFF3F0;
  --surface: #FFFFFF;
  --line: #F0DAD5;
  --shadow-soft: 0 10px 32px rgba(36, 26, 24, 0.10);
  --shadow-tight: 0 4px 14px rgba(36, 26, 24, 0.08);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --font-display: "Baloo 2", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --red: #FF5A63;
    --red-deep: #FF7A82;
    --red-soft: #3A1416;
    --on-red: #150F0E;
    --jade: #2BD696;
    --jade-soft: #163B2E;
    --gold: #FFC24B;
    --gold-soft: #3D2B08;
    --ink: #FBEFEC;
    --ink-soft: #B79C97;
    --cloud: #150F0E;
    --paper: #241A18;
    --surface: #2E211E;
    --line: #3B2C28;
    --shadow-soft: 0 10px 32px rgba(0, 0, 0, 0.45);
    --shadow-tight: 0 4px 14px rgba(0, 0, 0, 0.35);
  }
}

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

body {
  margin: 0;
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: inherit; }

/* Bilingual content: <html data-lang="vi|en"> gates any element carrying a matching lang attr.
   ":not(html)" keeps this from also matching the root <html lang="..."> itself. */
:not(html)[lang] { display: none; }
html[data-lang="vi"] :not(html)[lang="vi"] { display: revert; }
html[data-lang="en"] :not(html)[lang="en"] { display: revert; }
li[lang] { display: none; }
html[data-lang="vi"] li[lang="vi"] { display: list-item; }
html[data-lang="en"] li[lang="en"] { display: list-item; }
span[lang] { display: inline; }
html[data-lang="vi"] span[lang="en"],
html[data-lang="en"] span[lang="vi"] { display: none; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--cloud) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--ink); }
.brand svg, .brand img { width: 34px; height: 34px; flex-shrink: 0; }
.brand img, .footer-brand img { border-radius: 8px; object-fit: contain; }
.brand svg .mark, .footer-brand svg .mark { fill: var(--red); }
.brand svg .accent, .footer-brand svg .accent { fill: var(--gold); }

.nav-links { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); transition: color 0.15s; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--red); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-toggle {
  display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  font-family: var(--font-body); font-weight: 700; font-size: 0.8rem;
}
.lang-toggle button {
  border: none; background: transparent; color: var(--ink-soft); padding: 7px 14px; cursor: pointer;
  font: inherit; letter-spacing: 0.02em;
}
.lang-toggle button[aria-pressed="true"] { background: var(--red); color: var(--on-red); }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); padding: 14px 26px; font-weight: 700; font-size: 0.98rem;
  text-decoration: none; border: none; cursor: pointer; font-family: var(--font-body);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: var(--on-red); box-shadow: var(--shadow-tight); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--red-deep); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--red); color: var(--red); }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2.5px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero .container { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; background: var(--paper); color: var(--red);
  font-weight: 700; font-size: 0.82rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow::before { content: "●"; font-size: 0.6rem; }
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-note { margin-top: 14px; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Hero feature highlights ---------- */
.hero-features {
  display: flex; flex-wrap: wrap; gap: 10px 20px; list-style: none; margin: 22px 0 0; padding: 0;
}
.hero-features li {
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.88rem; color: var(--ink-soft);
}
.hero-feature-icon {
  width: 26px; height: 26px; border-radius: 50%; background: var(--red-soft); color: var(--red);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- Phone mockup (signature element) ---------- */
.phone-mockup { display: flex; justify-content: center; }
.phone-frame {
  width: 260px; background: var(--ink); border-radius: 36px; padding: 14px 10px;
  box-shadow: var(--shadow-soft);
}
.phone-notch {
  width: 70px; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 60%, black);
  margin: 0 auto 10px;
}
.phone-screen {
  background: var(--surface); border-radius: 24px; overflow: hidden; min-height: 500px;
  display: flex; flex-direction: column;
}

/* Red header banner — mirrors the app's dashboard header (rounded bottom, greeting + balance). */
.phone-banner {
  background: var(--red); color: var(--on-red); padding: 14px 16px 24px;
  border-radius: 0 0 18px 18px;
}
.phone-banner-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.phone-greeting { font-size: 0.68rem; font-weight: 600; opacity: 0.85; }
.phone-banner-icon {
  width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
}
.phone-balance-label { display: block; font-size: 0.62rem; font-weight: 600; opacity: 0.8; margin-bottom: 4px; }
.phone-balance-amount { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; }

/* Peeking income/expense chips — overlap the banner's bottom edge like the real dashboard. */
.phone-chips { display: flex; gap: 8px; margin: -14px 16px 14px; position: relative; z-index: 1; }
.phone-chip {
  flex: 1; min-width: 0; background: var(--surface); border-radius: 14px; padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); box-shadow: var(--shadow-tight);
}
.phone-chip-top { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.phone-chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.phone-chip-dot--jade { background: var(--jade); }
.phone-chip-dot--red { background: var(--red); }
.phone-chip-label { font-size: 0.6rem; font-weight: 600; color: var(--ink-soft); }
.phone-chip-amount { display: block; font-size: 0.72rem; font-weight: 800; color: var(--ink); }

/* Ranked category rows — icon, name/amount, thin progress bar (mirrors _CategoryBreakdownRow). */
.phone-categories { padding: 6px 16px 0; display: flex; flex-direction: column; gap: 14px; }
.phone-cat-row { display: flex; align-items: center; gap: 8px; }
.phone-cat-icon {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.phone-cat-icon--red { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.phone-cat-icon--gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.phone-cat-icon--jade { background: color-mix(in srgb, var(--jade) 16%, transparent); color: var(--jade); }
.phone-cat-info { flex: 1; min-width: 0; }
.phone-cat-top {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 0.68rem; font-weight: 600; color: var(--ink); margin-bottom: 4px;
}
.phone-cat-top span:last-child { font-weight: 700; color: var(--ink-soft); }
.phone-cat-bar { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.phone-cat-bar-fill { display: block; height: 100%; border-radius: 999px; }
.phone-cat-bar-fill--red { background: var(--red); }
.phone-cat-bar-fill--gold { background: var(--gold); }
.phone-cat-bar-fill--jade { background: var(--jade); }

/* Floating pill bottom-nav — mirrors HomeShell's nav bar, active tab gets a filled red pill. */
.phone-nav {
  display: flex; justify-content: space-between; gap: 6px; margin: auto 16px 14px; padding: 6px;
  background: var(--paper); border-radius: 14px;
}
.phone-nav-item {
  flex: 1; height: 26px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.phone-nav-item--active { background: var(--red); color: var(--on-red); }

/* ---------- Feature grid ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--paper); }
.section-head { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.section-head p { margin: 0; }

.feature-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 26px 22px; box-shadow: var(--shadow-tight);
}
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--red); background: var(--red-soft);
}
.feature-card h3 { margin-bottom: 6px; }
.feature-card p { margin: 0; font-size: 0.92rem; }

/* ---------- Security list ---------- */
.security-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
.security-item { display: flex; gap: 14px; align-items: flex-start; }
.security-item .tick {
  width: 26px; height: 26px; border-radius: 50%; background: var(--jade-soft); color: var(--jade);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.security-item h3 { margin-bottom: 2px; font-size: 1rem; }
.security-item p { margin: 0; font-size: 0.92rem; }

/* ---------- CTA ---------- */
.cta { text-align: center; }
.cta .container { max-width: 640px; }
.cta h2 { margin-bottom: 12px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; }
.site-footer .container { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; }
.footer-brand svg, .footer-brand img { width: 26px; height: 26px; }
.footer-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--red); }
.footer-meta { font-size: 0.85rem; color: var(--ink-soft); margin-top: 18px; }

/* ---------- Legal pages ---------- */
.legal-hero { padding: 56px 0 24px; }
.legal-updated { font-size: 0.88rem; color: var(--ink-soft); }
.legal-body { padding-bottom: 88px; }
.legal-body .container { max-width: 760px; }
.legal-body h2 { margin-top: 2.2em; font-size: 1.3rem; }
.legal-body h2:first-of-type { margin-top: 0; }
.legal-body ul { padding-left: 1.3em; margin: 0 0 1em; color: var(--ink-soft); }

/* ---------- Login choice page (/landing/login — không link từ trang chính, chỉ truy cập trực tiếp) ---------- */
.login-choice-body { padding-bottom: 96px; }
.login-choice-body .container { max-width: 760px; }
.login-choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 8px; }
.login-choice-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 30px 26px; box-shadow: var(--shadow-tight); text-decoration: none; color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.login-choice-card:hover, .login-choice-card:focus-visible {
  transform: translateY(-2px); box-shadow: var(--shadow-soft); border-color: var(--red);
}
.login-choice-icon {
  width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  color: var(--red); background: var(--red-soft);
}
.login-choice-card h3 { margin: 0; font-size: 1.05rem; }
.login-choice-card p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.login-choice-card .login-choice-arrow { margin-top: auto; color: var(--red); font-weight: 700; font-size: 0.9rem; }

@media (max-width: 720px) {
  .login-choice-grid { grid-template-columns: 1fr; }
}
.legal-body li { margin-bottom: 0.5em; }
.legal-body p { color: var(--ink-soft); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .security-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; color: var(--ink);
  }
  body.nav-open .nav-links {
    display: flex; flex-direction: column; gap: 4px; position: fixed; inset: 72px 16px auto 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
    padding: 12px; box-shadow: var(--shadow-soft);
  }
  body.nav-open .nav-links a { padding: 10px 12px; }
}

@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}
