/* Kokaa website — one stylesheet for every page.
   Brand: deep ocean, sunset coral, sand cream, Kokaa butterfly. Fast, calm, readable. */

@font-face {
  font-family: "Nunito"; src: url("/fonts/Nunito-VF.ttf") format("truetype");
  font-weight: 200 900; font-display: swap;
}
@font-face {
  font-family: "Baloo 2"; src: url("/fonts/Baloo2-VF.ttf") format("truetype");
  font-weight: 400 800; font-display: swap;
}
/* Dhivehi: MV Typewriter (licensed — see app licence note) with Bolhu as the web fallback */
@font-face {
  font-family: "Kokaa Thaana"; src: url("/fonts/mvtyper.ttf") format("truetype");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Kokaa Thaana"; src: url("/fonts/mvtypebold.ttf") format("truetype");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Kokaa Thaana Fallback"; src: url("/fonts/BolhuGX-VF.ttf") format("truetype");
  font-weight: 100 900; font-display: swap;
}

:root {
  --ocean-900: #05202C; --ocean-800: #073B4C; --ocean-600: #0A5468;
  --lagoon-600: #0F8F8C; --lagoon-500: #12A5A0; --lagoon-300: #5FD3C4;
  --sand-50: #FFF9EF; --sand-100: #FFF4E3; --sand-300: #FFE1B0;
  --sunset-500: #FF7A59; --sunset-600: #F2573F;
  --sun-400: #FFC24B; --coral-300: #FFA48F; --palm-600: #1F7A5C;
  --ink: #06222F; --ink-60: rgba(6,34,47,.72); --ink-40: rgba(6,34,47,.62);
  /* --ink-70: darker teal so links stay readable on cream (AA 4.5:1) */
  --link: #0A6F6C;
  --danger: #D9483B;
  --r: 22px; --shadow: 0 10px 30px rgba(5,32,44,.12);
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--sand-50); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;          /* the decorative hero art must never widen the page */
  max-width: 100vw;
}
img { max-width: 100%; display: block; }
a { color: var(--link); }
h1, h2, h3 { font-family: "Baloo 2", system-ui, sans-serif; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 800; }
h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 1em; }
strong { color: var(--ink); }

/* ---------------------------------------------------------------- layout safety
   Every box may shrink below its content width. Root-relative widths + minmax(0,…) grids mean a long
   word (or a very narrow screen) can never push the page sideways. */
main, section, div, header, nav, footer, ul, li, p, h1, h2, h3, details, .btn { min-width: 0; }
img, svg, video { max-width: 100%; height: auto; }
.hero, .hero-inner, .strip, .join, .faq, .support, .sitebar, .sitefoot { max-width: 100%; }
.hero-inner, .strip, .join-inner { width: 100%; }
.strip { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.pay-choices { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
/* months: 3 across on phones, more on wider screens — never wider than the container */
.months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 560px) { .months { grid-template-columns: repeat(auto-fit, minmax(min(112px, 100%), 1fr)); } }
.month, .pay, .card, .panel, details { max-width: 100%; }
.hero-facts { max-width: 100%; }
.lede, .hero h1 { max-width: 100%; overflow-wrap: break-word; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font-weight: 800; font-family: "Nunito", sans-serif; text-decoration: none;
  border: 0; cursor: pointer; font-size: 16px; transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(180deg, var(--sunset-500), var(--sunset-600)); color: #fff; box-shadow: 0 8px 22px rgba(242,87,63,.28); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-quiet { background: rgba(6,34,47,.06); color: var(--ink); }
.btn-lg { min-height: 58px; padding: 16px 30px; font-size: 18px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- site bar */
.sitebar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px max(16px, calc((100vw - var(--max)) / 2));
  background: rgba(255,249,239,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(6,34,47,.06);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 24px; color: var(--ink); letter-spacing: .3px; }
.sitebar-nav { display: flex; gap: 10px; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; color: var(--sand-100); background: var(--ocean-900); }
.hero-art {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 78% 18%, rgba(255,194,75,.55), rgba(255,194,75,0) 70%),
    radial-gradient(70% 60% at 82% 30%, rgba(255,122,89,.55), rgba(255,122,89,0) 72%),
    linear-gradient(180deg, #FF9E6E 0%, #F2573F 22%, #0F8F8C 58%, var(--ocean-900) 100%);
}
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 60% at 50% 100%, rgba(5,32,44,.85), rgba(5,32,44,0) 60%),
    repeating-radial-gradient(circle at 15% 120%, transparent 0 46px, rgba(232,251,246,.14) 47px 48px, transparent 49px 92px);
}
.hero-inner {
  position: relative; z-index: 1; max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) 20px clamp(48px, 8vw, 90px);
  display: grid; gap: 18px; justify-items: start;
}
.kicker { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; color: rgba(255,244,227,.82); margin: 0; }
.hero h1 { color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.28); max-width: 16ch; }
.lede { max-width: 46ch; font-size: clamp(17px, 2.2vw, 20px); color: rgba(255,244,227,.92); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .btn-quiet { background: rgba(255,244,227,.14); color: var(--sand-100); border: 1px solid rgba(255,244,227,.35); }
.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 8px 0 0; }
.hero-facts li {
  font-size: 13px; font-weight: 800; padding: 7px 13px; border-radius: 999px;
  background: rgba(5,32,44,.35); border: 1px solid rgba(255,244,227,.22);
}

/* ---------------------------------------------------------------- cards strip */
.strip {
  max-width: var(--max); margin: -34px auto 0; padding: 0 20px;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  position: relative; z-index: 2;
}
.card { background: #fff; border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.card h3 { color: var(--ocean-800); }
.card p { margin: 0; color: var(--ink-60); }

/* ---------------------------------------------------------------- join / price */
.join { padding: clamp(48px, 8vw, 84px) 20px; }
.join-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.price { margin: .2em 0 0; }
.amount { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: clamp(44px, 9vw, 72px); color: var(--ocean-800); }
.per { font-size: 20px; font-weight: 800; color: var(--ink-60); }
.fineprint { font-size: 13.5px; color: var(--ink-60); font-weight: 700; }

.months {
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  margin: 26px 0 18px;
}
.month {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 64px; padding: 10px 8px; border-radius: 18px; cursor: pointer;
  background: #fff; border: 2px solid rgba(6,34,47,.10); color: var(--ink);
  font: 800 15px "Nunito", sans-serif; transition: border-color .12s ease, transform .12s ease, background .12s ease;
}
.month em { font-style: normal; font-weight: 700; font-size: 13px; color: var(--ink-60); }
.month:hover { border-color: var(--lagoon-300); }
.month.is-on { background: linear-gradient(180deg, var(--lagoon-500), var(--lagoon-600)); border-color: transparent; color: #fff; }
.month.is-on em { color: rgba(255,255,255,.85); }

.total { display: grid; gap: 6px; justify-items: center; margin-bottom: 10px; }
.total label { font-size: 14px; font-weight: 800; color: var(--ink-60); }
.total input {
  width: 190px; min-height: 52px; padding: 10px 14px; border-radius: 14px; text-align: center;
  border: 2px solid rgba(6,34,47,.12); font: 800 20px "Nunito", sans-serif; color: var(--ink); background: #fff;
}
.total input:focus { outline: 3px solid rgba(18,165,160,.35); border-color: var(--lagoon-500); }
.total-line { font-size: 20px; margin: 6px 0 22px; }
.total-line strong { font-family: "Baloo 2", sans-serif; font-size: 28px; color: var(--ocean-800); }

.pay-choices { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 12px; }
.pay {
  display: grid; gap: 4px; text-align: left; padding: 20px 22px; border-radius: var(--r); text-decoration: none;
  background: #fff; box-shadow: var(--shadow); border: 2px solid transparent; transition: transform .12s ease, border-color .12s ease;
}
.pay:hover { transform: translateY(-2px); border-color: var(--lagoon-300); }
.pay-title { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 22px; color: var(--ocean-800); }
.pay-sub { font-size: 14px; color: var(--ink-60); font-weight: 700; }
.pay-card { background: linear-gradient(180deg, #fff, #FFF4E3); }

/* ---------------------------------------------------------------- faq / support */
.faq, .support { max-width: 760px; margin: 0 auto; padding: 0 20px 56px; }
.faq h2, .support h2 { text-align: center; }
details { background: #fff; border-radius: 16px; padding: 16px 18px; margin-bottom: 10px; box-shadow: 0 6px 18px rgba(5,32,44,.06); }
details summary { font-weight: 800; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--link); }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; color: var(--ink-60); }
.support { text-align: center; }

/* ---------------------------------------------------------------- footer */
.sitefoot {
  background: var(--ocean-900); color: var(--sand-100); padding: 34px 20px 44px; text-align: center; font-size: 14px;
}
.sitefoot nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.sitefoot a { color: rgba(255,244,227,.88); }
.sitefoot .fineprint { color: rgba(255,244,227,.55); max-width: 46ch; margin: 12px auto 0; }

/* ---------------------------------------------------------------- simple pages (start, account, pay) */
.page-simple { background: var(--sand-50); }
.simple-page { min-height: calc(100vh - 60px); display: grid; place-items: start center; padding: 40px 20px 70px; }

/* Intro paragraph inside a white panel — must stay readable (the hero version is cream-on-dark). */
.panel .lede { color: var(--ink-60); font-size: 16.5px; font-weight: 600; line-height: 1.6; max-width: none; }
.panel h1 + .lede { margin-top: -4px; }

/* language switch (English / ދިވެހި) — on every page */
.langswitch {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(6, 34, 47, .07); border: 1px solid rgba(6, 34, 47, .06);
}
.langbtn {
  min-height: 36px; padding: 4px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-60); font: 800 13.5px "Nunito", sans-serif;
}
.langbtn.is-on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(5, 32, 44, .14); }

/* Dhivehi mode: everything switches to the Thaana face, whole page mirrors */
body.lang-dv, body.lang-dv .btn, body.lang-dv input, body.lang-dv button, body.lang-dv select, body.lang-dv textarea {
  font-family: "Kokaa Thaana", "Kokaa Thaana Fallback", sans-serif;
}
body.lang-dv { line-height: 1.75; }
body.lang-dv h1, body.lang-dv h2, body.lang-dv h3 { font-family: "Kokaa Thaana", "Kokaa Thaana Fallback", sans-serif; font-weight: 700; line-height: 1.6; }
body.lang-dv .amount, body.lang-dv .total-line strong { font-family: "Kokaa Thaana", "Kokaa Thaana Fallback", sans-serif; }

/* a button that looks like a link (resend, back) */
.linkbtn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--link); font: 800 14px "Nunito", sans-serif; text-decoration: underline;
}
.linkbtn:disabled { color: var(--ink-40); cursor: default; text-decoration: none; }

/* Dhivehi not yet approved by a native speaker — subtle marker while building */
[data-dv-pending] { border-bottom: 1px dashed rgba(217, 72, 59, .45); }

.panel { width: min(520px, 100%); background: #fff; border-radius: 26px; padding: 28px; box-shadow: var(--shadow); }
.panel h1 { font-size: clamp(28px, 6vw, 38px); color: var(--ocean-800); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 800; color: var(--ink-60); }
.field input, .field select {
  width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 14px; font: 700 18px "Nunito", sans-serif;
  border: 2px solid rgba(6,34,47,.12); background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: 3px solid rgba(18,165,160,.35); border-color: var(--lagoon-500); }
.hint { font-size: 13.5px; color: var(--ink-60); font-weight: 700; }
.note { background: #FFF4E3; border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 700; color: var(--ink); }
.note-danger { background: rgba(217,72,59,.08); color: #8E2C22; }
.code-inputs { display: flex; gap: 10px; justify-content: center; margin: 10px 0 18px; }
.code-inputs input {
  width: 52px; height: 66px; text-align: center; font: 800 28px "Baloo 2", sans-serif;
  border: 2px solid rgba(6,34,47,.14); border-radius: 14px; background: #fff; color: var(--ink);
}
.code-inputs input:focus { outline: 3px solid rgba(18,165,160,.35); border-color: var(--lagoon-500); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(6,34,47,.08); }
.row:last-child { border-bottom: 0; }
.row .label { font-weight: 800; color: var(--ink); }
.row .sub { font-size: 13.5px; color: var(--ink-60); font-weight: 700; }
.seg { display: flex; gap: 6px; background: rgba(6,34,47,.06); padding: 4px; border-radius: 999px; }
.seg button { min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 0; background: transparent; font: 800 14px "Nunito", sans-serif; color: var(--ink-60); cursor: pointer; }
.seg button.is-on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(5,32,44,.12); }
.toggle { width: 54px; height: 32px; border-radius: 999px; border: 0; background: rgba(6,34,47,.18); position: relative; cursor: pointer; }
.toggle.is-on { background: var(--lagoon-600); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(5,32,44,.18); transition: left .15s ease; }
.toggle.is-on::after { left: 25px; }
.btn-danger { background: var(--danger); color: #fff; }
.link-quiet { color: var(--ink-60); font-weight: 800; font-size: 14px; text-decoration: none; }

/* Dhivehi (right-to-left) pages use the Thaana face on everything */
body[lang="dv"] { font-family: "Kokaa Thaana", "Kokaa Thaana Fallback", sans-serif; line-height: 1.75; }
body[lang="dv"] h1, body[lang="dv"] h2, body[lang="dv"] h3, body[lang="dv"] .brand-name, body[lang="dv"] .amount,
body[lang="dv"] .pay-title, body[lang="dv"] .total-line strong { font-family: "Kokaa Thaana", "Kokaa Thaana Fallback", sans-serif; font-weight: 700; }
body[lang="dv"] .btn { font-family: "Kokaa Thaana", "Kokaa Thaana Fallback", sans-serif; font-weight: 700; }

@media (max-width: 520px) {
  .sitebar-nav .btn-quiet { display: none; }
  .hero-inner { padding: 40px 18px 60px; }
  .hero h1 { font-size: 32px; }
  .lede { font-size: 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .hero-facts li { font-size: 12px; padding: 6px 11px; }
  .strip { margin-top: -20px; padding: 0 14px; grid-template-columns: 1fr; }
  .join { padding: 40px 16px; }
  .months { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .month { min-height: 58px; font-size: 13px; padding: 8px 4px; }
  .month em { font-size: 11.5px; }
  .amount { font-size: 48px; }
  .pay-choices { grid-template-columns: 1fr; }
  .faq, .support { padding-left: 16px; padding-right: 16px; }
  .code-inputs input { width: 44px; height: 58px; font-size: 24px; }
  .panel { padding: 22px; }
  .row { flex-wrap: wrap; }
}
