/* ============================================================
   FinFlow website styles
   Dark fintech theme, single accent (#4ADE80), Manrope type.
   Design system: one radius scale (cards 20px, buttons pill),
   one accent color, dark theme locked across the whole page.
   ============================================================ */

:root {
  /* Palette (off-black base, no pure #000 / #fff) */
  --bg: #0a0a0c;
  --bg-2: #101014;
  --bg-3: #17171d;
  --text-1: #f2f3f6;
  --text-2: #a6abb4;
  --text-3: #6d727c;
  --accent: #4ade80;
  --accent-strong: #34d36b;
  --accent-dim: rgba(74, 222, 128, 0.12);
  --accent-line: rgba(74, 222, 128, 0.35);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* One corner-radius system */
  --r-card: 20px;
  --r-btn: 999px;

  /* Layout */
  --container: 1180px;
  --nav-h: 72px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Language pairing: show one language, hide the other. */
.en {
  display: none;
}
body.lang-en .ru {
  display: none;
}
body.lang-en .en {
  display: inline;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 16px;
}

.section-head p {
  color: var(--text-2);
  font-size: 17px;
  max-width: 54ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease,
    background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #06210f;
}

.btn-primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 30px rgba(74, 222, 128, 0.28);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.btn .ph {
  font-size: 20px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
}

.nav-links a {
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text-1);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.lang-toggle button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: 6px 12px;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-toggle button.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-cta {
  padding: 10px 20px;
  font-size: 15px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 96px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -140px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.14), transparent 62%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  padding: 7px 14px;
  border-radius: var(--r-btn);
  margin-bottom: 28px;
}

.hero-copy h1 {
  font-size: clamp(38px, 5.2vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 22px;
  max-width: 13ch;
}

.hero-copy .sub {
  font-size: 18px;
  color: var(--text-2);
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- Live balance card (real component) ---------- */
.balance-card {
  position: relative;
  background: linear-gradient(160deg, #16161d, #0e0e12);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.balance-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-card);
  background: radial-gradient(circle at 85% 0%, rgba(74, 222, 128, 0.16), transparent 55%);
  pointer-events: none;
}

.balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.balance-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 600;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.live-dot i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50% { opacity: 0.75; box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.balance-amount {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.balance-amount .unit {
  font-size: 24px;
  color: var(--text-2);
  margin-right: 6px;
  font-weight: 700;
}

.balance-delta {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 22px;
}

.sparkline {
  width: 100%;
  height: 64px;
  margin-bottom: 24px;
}

.sparkline path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline .area {
  fill: url(#sparkFill);
  stroke: none;
}

.balance-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.balance-row {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.balance-row .k {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 4px;
}

.balance-row .v {
  font-size: 17px;
  font-weight: 800;
}

.balance-row .v.up { color: var(--accent); }
.balance-row .v.down { color: #fb7185; }

/* Budget bar inside card */
.budget-row {
  margin-top: 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.budget-row .top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
}

.budget-row .top b { font-weight: 800; }

.budget-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.budget-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Bento features ---------- */
.features {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.tile {
  grid-column: span 2;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-3);
  padding: 28px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
}

.tile.wide {
  grid-column: span 4;
}

.tile .icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 18px;
}

.tile h3 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.tile p {
  font-size: 15px;
  color: var(--text-2);
  max-width: 40ch;
}

.tile.tint {
  background: linear-gradient(160deg, rgba(74, 222, 128, 0.14), var(--bg-3) 60%);
  border-color: var(--accent-line);
}

.tile.tint .icon {
  background: var(--accent);
  color: #06210f;
}

.tile.mono {
  background: var(--bg-3);
}

.tile.mono .icon {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-1);
}

/* Mini stat row inside the wide tile */
.mini-stats {
  display: flex;
  gap: 28px;
  margin-top: 18px;
}

.mini-stats .ms {
  flex: 1;
}

.mini-stats .ms b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mini-stats .ms span {
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- Privacy / offline statement ---------- */
.offline {
  position: relative;
  overflow: hidden;
}

.offline::before {
  content: "";
  position: absolute;
  left: -120px;
  bottom: -120px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.1), transparent 62%);
  pointer-events: none;
}

.offline-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.offline-grid h2 {
  font-size: clamp(28px, 3.8vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.14;
  margin-bottom: 18px;
}

.offline-grid .lead {
  font-size: 17px;
  color: var(--text-2);
  margin-bottom: 26px;
  max-width: 48ch;
}

.check-list {
  list-style: none;
  display: grid;
  gap: 14px;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
}

.check-list .ph {
  color: var(--accent);
  font-size: 20px;
  flex-shrink: 0;
}

.offline-shield {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-box {
  width: 320px;
  height: 320px;
  border-radius: 32px;
  border: 1px solid var(--accent-line);
  background:
    radial-gradient(circle at 30% 20%, rgba(74, 222, 128, 0.2), transparent 60%),
    var(--bg-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.shield-box .ph {
  font-size: 72px;
  color: var(--accent);
}

.shield-box b {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.shield-box span {
  font-size: 14px;
  color: var(--text-2);
  max-width: 22ch;
}

/* ---------- Pricing ---------- */
.pricing {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  max-width: 860px;
}

.plan {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-3);
  padding: 34px;
  display: flex;
  flex-direction: column;
}

.plan.featured {
  border-color: var(--accent-line);
  background: linear-gradient(170deg, rgba(74, 222, 128, 0.1), var(--bg-3) 55%);
}

.plan .name {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.plan .desc {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 22px;
  min-height: 42px;
}

.plan .price {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.plan .price span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0;
}

.plan ul {
  list-style: none;
  margin: 22px 0 28px;
  display: grid;
  gap: 12px;
  flex: 1;
}

.plan li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-2);
}

.plan li .ph {
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
}

.plan li.off {
  color: var(--text-3);
}

.plan li.off .ph {
  color: var(--text-3);
}

.plan .btn {
  width: 100%;
}

/* ---------- Final CTA ---------- */
.final-cta {
  text-align: center;
  padding: 120px 0;
}

.final-cta h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.final-cta p {
  color: var(--text-2);
  font-size: 17px;
  max-width: 46ch;
  margin: 0 auto 34px;
}

.final-cta .btn {
  font-size: 17px;
  padding: 16px 32px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer .brand {
  font-size: 16px;
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--text-2);
}

.footer-links a:hover {
  color: var(--text-1);
}

.footer-copy {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- Privacy page ---------- */
.privacy-hero {
  padding: 80px 0 40px;
}

.privacy-hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 14px;
}

.privacy-hero .updated {
  font-size: 14px;
  color: var(--text-3);
}

.privacy-body {
  padding: 32px 0 96px;
  max-width: 760px;
}

.privacy-body section {
  margin-bottom: 48px;
}

.privacy-body h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.privacy-body p {
  font-size: 16px;
  color: var(--text-2);
  margin-bottom: 14px;
}

.privacy-body ul {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.privacy-body li {
  position: relative;
  padding-left: 26px;
  font-size: 16px;
  color: var(--text-2);
}

.privacy-body li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.privacy-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-line);
}

/* ---------- Error pages (404 / 502) ---------- */
.error-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
}

.error-page::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.12), transparent 62%);
  pointer-events: none;
}

.error-icon {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 38px;
  margin-bottom: 26px;
}

.error-code {
  font-size: clamp(96px, 18vw, 168px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-1);
  position: relative;
}

.error-code .ph {
  font-size: 0.62em;
  color: var(--accent);
  margin: 0 4px;
}

.error-page h1 {
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 22px 0 12px;
}

.error-page p {
  color: var(--text-2);
  font-size: 16px;
  max-width: 46ch;
  margin-bottom: 34px;
}

.error-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Compact language toggle pinned to the corner of error pages */
.error-lang {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
}

/* Float animation for the error icon */
.error-icon {
  animation: floaty 5s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-copy h1 {
    max-width: 16ch;
  }

  .offline-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .offline-shield {
    order: -1;
  }

  .bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .tile,
  .tile.wide {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 64px 0;
  }

  .nav-links {
    display: none;
  }

  .nav-cta {
    display: none;
  }

  .bento {
    grid-template-columns: 1fr;
  }

  .plans {
    grid-template-columns: 1fr;
  }

  .mini-stats {
    flex-direction: column;
    gap: 14px;
  }

  .balance-card {
    padding: 22px;
  }

  .balance-amount {
    font-size: 34px;
  }

  .shield-box {
    width: 260px;
    height: 260px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .live-dot i,
  .error-icon {
    animation: none;
  }

  .budget-fill {
    transition: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
