:root {
  --night: #140d2e;
  --night-2: #211650;
  --night-3: #2d1f66;
  --gold: #ffb347;
  --gold-soft: #ffd58a;
  --saffron: #ff8a1f;
  --cream: #fbf5e6;
  --red: #b3202a;
  --text: #f7f1e3;
  --muted: #c9bfe0;
  --line: rgba(255, 213, 138, 0.18);
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  font-family: "Noto Sans", "Noto Sans Bengali", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(255, 150, 50, 0.16), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, #0b0719 100%) fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
h1, h2 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.1rem; color: var(--gold-soft); }

main { max-width: 560px; margin: 0 auto; padding: 0 16px 24px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(20, 13, 46, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand small { display: block; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.02em; }
.brand strong { display: block; font-size: 1rem; color: var(--gold-soft); }
.topbar select {
  background: var(--night-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 0.9rem;
}

/* Hero */
.hero {
  position: relative; overflow: hidden; text-align: center;
  margin: 16px 0 0; padding: 28px 18px 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(20, 13, 46, 0.2), rgba(20, 13, 46, 0.85)),
    url("/img/hero.jpg") center/cover,
    radial-gradient(circle at 50% 30%, #3a2470, var(--night));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.bokeh {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(8px 8px at 12% 20%, rgba(255, 200, 100, 0.8), transparent),
    radial-gradient(6px 6px at 85% 15%, rgba(255, 180, 80, 0.7), transparent),
    radial-gradient(10px 10px at 75% 45%, rgba(255, 220, 140, 0.5), transparent),
    radial-gradient(5px 5px at 25% 55%, rgba(255, 190, 90, 0.6), transparent),
    radial-gradient(7px 7px at 50% 10%, rgba(255, 230, 160, 0.5), transparent);
  filter: blur(1px);
  animation: drift 9s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translateY(-8px); opacity: 0.7; } }

/* Assamese motifs: gamosa border, jaapi behind the title, xorai carrying the central lamp */
.hero-gamosa { position: absolute; left: 0; right: 0; height: 26px; background: url("/img/gamosa.svg") repeat-x center / auto 26px; }
.hero-gamosa.top { top: 0; }
.hero-gamosa.bottom { bottom: 0; }
.hero { padding-top: 42px; padding-bottom: 40px; }
.hero-jaapi {
  position: absolute; left: 50%; top: 22px; width: min(78%, 360px); transform: translateX(-50%);
  opacity: 0.55; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5)); pointer-events: none;
}
.hero-lamps { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 54px 0 4px; }
.hero-lamps > img { width: 50px; height: 50px; animation: flicker 2.6s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(255, 170, 60, 0.7)); }
.hero-lamps > img:nth-child(2) { animation-delay: 0.4s; }
.hero-lamps > img:nth-child(4) { animation-delay: 0.9s; }
.hero-lamps > img:nth-child(5) { animation-delay: 1.3s; }
.xorai { position: relative; display: flex; flex-direction: column; align-items: center; margin: 0 6px; }
.xorai .big { width: 84px; height: 84px; margin-bottom: -30px; z-index: 1; animation: flicker 3.1s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(255, 170, 60, 0.8)); }
.xorai .stand { width: 92px; height: auto; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.55)); }
.hero-lamps { align-items: flex-end; }
.hero-lamps > img { margin-bottom: 10px; }
@keyframes flicker {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px rgba(255, 170, 60, 0.6)); }
  50% { transform: scale(1.04) translateY(-1px); filter: drop-shadow(0 0 22px rgba(255, 190, 80, 0.9)); }
}

.eyebrow { position: relative; margin: 0 0 4px; display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--cream); font-weight: 700; letter-spacing: 0.28em; font-size: 0.95rem; text-transform: uppercase; }
.eyebrow .dot { color: var(--gold); }
.eyebrow::before, .eyebrow::after { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow::after { background: linear-gradient(90deg, var(--gold), transparent); }
.hero h1 { position: relative; font-size: clamp(2rem, 8vw, 2.8rem); color: var(--gold-soft); text-shadow: 0 0 24px rgba(255, 170, 60, 0.55); }
.tagline { position: relative; margin: 4px 0 10px; font-size: 1.05rem; color: var(--cream); letter-spacing: 0.03em; }
.subtitle { position: relative; margin: 0 auto; max-width: 42ch; font-size: 0.92rem; color: var(--muted); }

.tribute { position: relative; display: inline-flex; align-items: center; gap: 12px; margin: 16px auto 0; padding: 8px 16px 8px 8px; border-radius: 999px; background: rgba(251, 245, 230, 0.08); border: 1px solid var(--line); text-align: left; }
.tribute-photo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); box-shadow: 0 0 14px rgba(255, 170, 60, 0.45); }
.tribute-photo[hidden] + .tribute-text { padding-left: 8px; }
.tribute-text { display: flex; flex-direction: column; line-height: 1.25; }
.tribute-text strong { color: var(--gold-soft); font-size: 0.95rem; }
.tribute-text small { color: var(--muted); font-size: 0.78rem; }
.counter { position: relative; margin-top: 18px; display: inline-flex; flex-direction: column; padding: 10px 22px; border-radius: 16px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.counter-num { font-size: 2rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.counter-label { font-size: 0.8rem; color: var(--gold-soft); }

/* Buttons */
.actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 18px; border-radius: 14px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; color: var(--text); background: transparent;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  color: #2b1300;
  background: linear-gradient(180deg, #ffd27a, var(--saffron));
  box-shadow: 0 8px 26px rgba(255, 138, 31, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-xl { min-height: 60px; font-size: 1.1rem; }
.btn-icon { font-size: 1.3rem; }
.btn-ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.04); }
.btn-link, .link {
  background: none; border: 0; padding: 0; font: inherit; color: var(--gold); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.btn-link { min-height: 44px; }
.pending { margin: 0; text-align: center; font-size: 0.9rem; color: var(--gold-soft); }

/* Gamosa strip */
.gamosa { height: 28px; background: url("/img/gamosa.svg") repeat-x center / auto 28px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }

/* Cards */
.card { margin: 16px 0; padding: 18px; border-radius: var(--radius); background: rgba(33, 22, 80, 0.55); border: 1px solid var(--line); box-shadow: var(--shadow); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.how ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: center; }
.how .n { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: var(--cream); font-weight: 800; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--night-2); }
.gallery .empty { grid-column: 1 / -1; color: var(--muted); font-size: 0.9rem; margin: 0; }

/* Form */
.form { display: grid; gap: 16px; }
.preview { border-radius: 14px; overflow: hidden; background: var(--night-2); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview img:not([src]) { display: none; }
.location { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-loc { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); font-size: 0.9rem; }
.chip-loc.ok { border-color: rgba(120, 220, 140, 0.5); color: #bff3c8; }
.chip-loc.warn { border-color: rgba(255, 170, 60, 0.6); color: var(--gold-soft); }
select#district, .field input {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px;
  background: var(--night); color: var(--text); border: 1px solid var(--line); font: inherit;
}
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 700; margin-bottom: 8px; color: var(--cream); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; inset: 0; }
.chip-check span {
  display: inline-block; padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); font-size: 0.95rem;
}
.chip-check input:checked + span { background: rgba(255, 179, 71, 0.18); border-color: var(--gold); color: var(--gold-soft); }
.chip-check input:checked + span::before { content: "✓ "; }
.chip-check input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.options { display: grid; gap: 8px; }
.option { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.option:has(input:checked) { border-color: var(--gold); background: rgba(255, 179, 71, 0.1); }
.option input { accent-color: var(--saffron); width: 18px; height: 18px; }
.field { display: grid; gap: 6px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); }
.consent input { accent-color: var(--saffron); width: 20px; height: 20px; margin-top: 2px; flex: none; }
.hint { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: rgba(255, 179, 71, 0.12); border: 1px solid rgba(255, 179, 71, 0.5); color: var(--gold-soft); font-size: 0.9rem; }
.hint .link { flex: none; }
.error { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(179, 32, 42, 0.25); border: 1px solid rgba(255, 90, 90, 0.4); color: #ffd0d0; }

/* Done */
.done { text-align: center; padding: 28px 0 8px; }
.done-lamp { width: 120px; height: 120px; animation: flicker 2.6s ease-in-out infinite; }
.done h1 { margin-top: 8px; color: var(--gold-soft); font-size: 1.9rem; }
.done-no { margin: 8px 0 0; font-size: 1.6rem; font-weight: 800; color: #fff; }
.done-district, .done-msg { margin: 4px 0 0; color: var(--muted); }
.share-card img { display: block; width: 100%; border-radius: 12px; margin-bottom: 12px; }
.sewa { border-color: rgba(179, 32, 42, 0.5); background: linear-gradient(180deg, rgba(179, 32, 42, 0.18), rgba(33, 22, 80, 0.5)); }
.sewa p { margin: 8px 0 0; color: var(--muted); }

/* Overlay */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(10, 6, 25, 0.85); backdrop-filter: blur(4px); }
.spin-lamp { width: 110px; height: 110px; animation: flicker 1.2s ease-in-out infinite; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: #2b1d5c; border: 1px solid var(--line); box-shadow: var(--shadow); }

.footer { margin-top: 24px; padding: 0 16px 24px; text-align: center; font-size: 0.8rem; color: var(--muted); }
.footer p { margin: 10px 0 0; }
.footer-en { color: var(--gold-soft); letter-spacing: 0.06em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
