/* Donation page + maintenance page styles. Colours are tokens so light and
   dark mode only redefine :root. */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f2f4f8;
  --text: #101828;
  --muted: #5b6474;
  --border: #e4e7ec;
  --accent: #e11d48;
  --accent-strong: #be123c;
  --accent-soft: #ffe4ea;
  --brand: #2557e0;
  --brand-soft: #e8eeff;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --track: #e9ecf2;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --surface: #121a2e;
    --surface-2: #18223a;
    --text: #eef1f7;
    --muted: #9aa4b8;
    --border: #253150;
    --accent: #fb7185;
    --accent-strong: #fda4af;
    --accent-soft: rgba(251, 113, 133, 0.14);
    --brand: #8aa6ff;
    --brand-soft: rgba(138, 166, 255, 0.14);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.14);
    --track: #222c45;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-2: #18223a;
  --text: #eef1f7;
  --muted: #9aa4b8;
  --border: #253150;
  --accent: #fb7185;
  --accent-strong: #fda4af;
  --accent-soft: rgba(251, 113, 133, 0.14);
  --brand: #8aa6ff;
  --brand-soft: rgba(138, 166, 255, 0.14);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.14);
  --track: #222c45;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* Bilingual text: every phrase is written twice and the other one hidden. */
html:not([data-lang="en"]) [data-en],
html[data-lang="en"] [data-tl] {
  display: none !important;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.8rem); }
p { margin: 0 0 1em; }
::selection { background: var(--accent-soft); }

/* Scrollbars follow the theme. */
* { scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brandmark .heart { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.toolbar { display: flex; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip-btn:hover { border-color: var(--brand); }
.chip-btn svg { width: 16px; height: 16px; }
.lang-switch { padding: 3px; gap: 2px; }
.lang-switch span { padding: 4px 10px; border-radius: 999px; font-size: 13px; }
html:not([data-lang="en"]) .lang-switch .tl,
html[data-lang="en"] .lang-switch .en { background: var(--brand); color: #fff; }
.icon-sun, .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun, :root[data-theme="light"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .icon-sun { display: block; } }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .icon-moon { display: block; } }

/* Hero */
.hero { padding: 48px 0 28px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: 14px; font-weight: 600;
}
.hero h1 {
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  margin: 18px 0 14px;
  letter-spacing: -0.01em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 1.12rem; color: var(--muted); max-width: 720px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-sm { min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn-danger { background: transparent; color: var(--accent); border-color: var(--border); }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
section { padding: 28px 0; }
.section-sub { color: var(--muted); margin-top: -6px; }

/* Progress */
.progress-card { display: grid; gap: 18px; }
.progress-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.raised { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.of-goal { color: var(--muted); }
.bar { position: relative; height: 16px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.bar .gl { background: var(--brand); }
.bar .don { background: linear-gradient(90deg, var(--accent), #f97316); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 13px; }
.stat.need b { color: var(--accent); }

/* Story */
.story p { font-size: 1.05rem; }
.story strong { color: var(--text); }
.callout {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  border-radius: 12px; padding: 14px 18px; margin: 18px 0; font-weight: 600;
}
.note { border-left-color: var(--brand); background: var(--brand-soft); }

/* Breakdown table */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 800; border-bottom: none; font-size: 1.05rem; }
.table-scroll { overflow-x: auto; }

/* Donate */
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.pay-card { display: flex; flex-direction: column; gap: 14px; }
.pay-head { display: flex; align-items: center; gap: 12px; }
.pay-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 15px;
}
.pay-logo.gcash { background: #0a66f5; }
.pay-logo.ub { background: #f47b20; }
.pay-head h3 { margin: 0; font-size: 1.15rem; }
.pay-head small { color: var(--muted); }
.qr-frame { background: #fff; border-radius: 14px; padding: 12px; border: 1px solid var(--border); }
.qr-frame img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.acct { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.acct b { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.acct small { display: block; color: var(--muted); font-size: 12px; }
.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Share */
.share-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Supporters wall */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.supporter { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.supporter .who { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.supporter .amt { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.supporter .meta { color: var(--muted); font-size: 13px; }
.supporter q { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); quotes: "“" "”"; }
.empty { color: var(--muted); text-align: center; padding: 28px 16px; border: 1px dashed var(--border); border-radius: 14px; }

/* GABAY */
.gabay { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.gabay .badge { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 13px; }
.gabay ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.gabay .qr-card { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); max-width: 320px; margin-left: auto; }
.gabay-title { display: flex; align-items: center; gap: 12px; }
.gabay-title img { width: 44px; height: auto; }
@media (max-width: 720px) {
  .gabay { grid-template-columns: 1fr; }
  .gabay .qr-card { margin: 0 auto; }
}

footer { padding: 36px 0 48px; color: var(--muted); font-size: 14px; text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px;
  font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Maintenance page */
.admin h1 { font-size: 1.6rem; margin: 28px 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 80px; resize: vertical; }
.span-all { grid-column: 1 / -1; }
.flash { padding: 12px 16px; border-radius: 12px; margin: 16px 0; font-weight: 600; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--accent-soft); color: var(--accent-strong); }
.row-actions { display: flex; gap: 6px; }
.row-actions form { margin: 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.donation { background: var(--accent-soft); color: var(--accent-strong); }
.pill.assistance { background: var(--brand-soft); color: var(--brand); }
.muted { color: var(--muted); }
.login { max-width: 420px; margin: 60px auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .toast { transition: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Case details */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; margin: 0 0 20px; }
.facts dt { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.facts dd small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }

/* Documents */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 38vw), 1fr)); gap: 16px; }
.doc {
  display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.15s ease, border-color 0.15s ease;
}
.doc:hover { transform: translateY(-2px); border-color: var(--brand); }
.doc img { width: 100%; aspect-ratio: 480 / 678; object-fit: cover; object-position: top; background: #fff; border-bottom: 1px solid var(--border); }
.doc-cap { padding: 10px 12px; display: grid; gap: 2px; }
.doc-cap b { font-size: 15px; }
.doc-cap small { color: var(--muted); font-size: 13px; }
.viewer {
  padding: 0; border: none; border-radius: 14px; background: #fff;
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
}
.viewer::backdrop { background: rgba(5, 8, 20, 0.75); }
.viewer img { width: 100%; height: auto; }
.viewer form { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 10px; margin-bottom: -58px; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .doc { transition: none; } }

/* Maintenance: documents */
.doc-admin-list { display: grid; gap: 18px; }
.doc-admin { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.doc-admin:last-child { border-bottom: none; padding-bottom: 0; }
.doc-admin img { width: 120px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.redact-canvas { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: crosshair; touch-action: none; }
@media (max-width: 600px) { .doc-admin { grid-template-columns: 1fr; } }
button[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Single-page section menu under the top bar. */
.subnav { border-top: 1px solid var(--border); }
.subnav .wrap {
  display: flex; gap: 4px; height: 46px; align-items: center;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.subnav .wrap::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; padding: 6px 12px; border-radius: 999px;
  color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.subnav a:hover { color: var(--text); background: var(--surface-2); }
.subnav a.active { color: var(--brand); background: var(--brand-soft); }
.subnav a.nav-cta { color: var(--accent-strong); background: var(--accent-soft); }
.subnav a.nav-cta.active { color: #fff; background: var(--accent); }
@media (min-width: 900px) { .subnav .wrap { justify-content: center; } }
/* Land headings below the sticky bar + menu. */
section[id] { scroll-margin-top: 118px; }

/* Opening section over the animated procedure illustration. Text is always light here
   because it sits on a dark overlay in both themes. */
.hero-video {
  position: relative; overflow: hidden; isolation: isolate;
  margin-top: 20px; padding: 0; border-radius: 24px;
  background: #0b1020; color: #f4f6fb;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(8, 12, 28, 0.92) 0%, rgba(8, 12, 28, 0.78) 45%, rgba(8, 12, 28, 0.45) 100%);
}
.hero-body { padding: 44px clamp(20px, 5vw, 48px) 24px; }
.hero-video .eyebrow { background: rgba(251, 113, 133, 0.18); color: #fecdd3; }
.hero-video h1 em { color: #fb7185; }
.hero-video .lead { color: #d0d5e2; }
.hero-video .lead strong { color: #fff; }
.hero-video .btn-ghost { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.hero-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 0 clamp(20px, 5vw, 48px) 16px; font-size: 12px;
}
.hero-foot a { color: rgba(244, 246, 251, 0.6); text-decoration: none; }
.hero-foot a:hover { color: #fff; text-decoration: underline; }
.hero-pause {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08);
  color: #fff; font-size: 11px; cursor: pointer;
}
.hero-video .when-paused, .hero-video.is-paused .when-playing { display: none; }
.hero-video.is-paused .when-paused { display: inline; }


/* Share buttons + desktop share panel */
.share-main { margin-bottom: 16px; }
@media (pointer: fine) { .share-main { display: none; } }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.share-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.share-item:hover { border-color: var(--brand); background: var(--surface-2); }
.share-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.share-icon svg { width: 22px; height: 22px; }
.share-sheet {
  border: 1px solid var(--border); border-radius: 20px; padding: 20px;
  background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px));
}
.share-sheet::backdrop { background: rgba(5, 8, 20, 0.6); }
.share-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.share-sheet-head h2 { margin: 0; font-size: 1.2rem; }
.share-sheet-head form { margin: 0; }

.proc-step { color: rgba(244, 246, 251, 0.72); line-height: 1.4; }
.proc-step b { color: #fff; margin-right: 4px; font-variant-numeric: tabular-nums; }
.proc-step small { color: rgba(244, 246, 251, 0.5); font-size: 11px; }
@media (min-width: 900px) {
  .hero-video .hero-body { max-width: 720px; }
  .hero-video .hero-shade {
    background: linear-gradient(90deg, rgba(8, 12, 28, 0.94) 0%, rgba(8, 12, 28, 0.86) 55%, rgba(8, 12, 28, 0.25) 74%, rgba(8, 12, 28, 0.1) 100%);
  }
}

/* Keep the story at a comfortable reading width on the wider page. */
.story .card > div { max-width: 78ch; }

/* Public donation upload */
.upload-cta { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.upload-cta h3 { margin: 0 0 4px; font-size: 1.15rem; }
.upload-sheet {
  border: 1px solid var(--border); border-radius: 20px; padding: 20px;
  background: var(--surface); color: var(--text); width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
}
.upload-sheet::backdrop { background: rgba(5, 8, 20, 0.6); }
.proof-preview { display: flex; gap: 14px; align-items: flex-start; }
.proof-preview img { width: 96px; max-height: 160px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.scan-status { margin: 0; font-size: 14px; }
.upload-msg { margin: 0; }
.upload-done { text-align: center; padding: 12px 0 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.status-pill.pending { background: #fef3c7; color: #92400e; }
.status-pill.rejected { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.status-pill.published { background: var(--ok-soft); color: var(--ok); }
.pending-card { display: grid; grid-template-columns: 160px 1fr; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.pending-card:last-child { border-bottom: none; padding-bottom: 0; }
.pending-card .proof-thumb img { width: 160px; max-height: 280px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.dupe { color: var(--accent-strong); font-weight: 700; font-size: 13px; }
@media (max-width: 640px) { .pending-card { grid-template-columns: 1fr; } }
