/* ===================================================================
   CCF Exalt Baliuag — Election 2026
   Mobile-first app design. Teal theme pulled from the Exalt sign-in UI.
   =================================================================== */

:root{
  --teal:        #16a89f;
  --teal-bright: #22d3c5;
  --teal-deep:   #0e7a73;
  --bg-top:      #1b4a48;
  --bg-mid:      #103434;
  --bg-bot:      #071718;
  --card:        rgba(9, 22, 26, 0.82);
  --card-solid:  #0c1c20;
  --input:       #26333c;
  --input-focus: #2f4049;
  --line:        rgba(255,255,255,0.08);
  --text:        #eef5f4;
  --muted:       #8aa0a2;
  --muted-2:     #6f8688;
  --danger:      #ff6b6b;
  --shadow:      0 24px 60px rgba(0,0,0,.45);
  --radius:      20px;
  --tab-h:       68px;
}

*{ margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

/* Ensure the hidden attribute always wins over display:flex/block class rules */
[hidden]{ display:none !important; }

html,body{ height:100%; }

body{
  font-family:'Poppins',system-ui,-apple-system,sans-serif;
  color:var(--text);
  background:
    radial-gradient(140% 100% at 50% -10%, var(--bg-top) 0%, var(--bg-mid) 42%, var(--bg-bot) 100%),
    var(--bg-bot);
  min-height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

/* ---------- Device frame (desktop shows a phone; mobile fills screen) ---------- */
.device{
  width:100%;
  max-width:430px;
  height:100dvh;
  max-height:920px;
  position:relative;
  display:flex;
}
@media (min-width:600px){
  body{ padding:24px; }
  .device{
    border-radius:44px;
    padding:12px;
    background:linear-gradient(160deg,#1d2b2b,#0a1516);
    box-shadow:var(--shadow), 0 0 0 2px rgba(255,255,255,.04) inset;
    height:min(920px, calc(100dvh - 48px));
  }
  .device::before{ /* notch */
    content:""; position:absolute; top:20px; left:50%; transform:translateX(-50%);
    width:120px; height:26px; background:#0a1516; border-radius:0 0 16px 16px; z-index:40;
  }
}

.app{
  position:relative;
  flex:1;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:
    radial-gradient(120% 80% at 50% -5%, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bot) 100%);
}
@media (min-width:600px){
  .app{ border-radius:34px; }
  /* Clear the simulated notch on desktop (higher specificity to beat base shorthand) */
  .app .appbar{ padding-top:52px; }
}

/* ---------- Animated diagonal dash background ---------- */
.bg-dashes{
  position:absolute; inset:0; z-index:0; opacity:.5; pointer-events:none;
  background-image:
    repeating-linear-gradient(115deg,
      transparent 0 34px,
      rgba(255,255,255,.05) 34px 40px,
      transparent 40px 78px);
  background-size:200px 200px;
  animation:drift 24s linear infinite;
}
@keyframes drift{ to{ background-position:400px 200px; } }

/* ===================================================================
   TOP APP BAR
   =================================================================== */
.appbar{
  position:relative; z-index:5;
  display:flex; align-items:center; justify-content:space-between;
  padding:calc(env(safe-area-inset-top) + 16px) 18px 14px;
  flex:0 0 auto;
}
.appbar-brand{ display:flex; align-items:center; gap:11px; }
.appbar-logo{ width:38px; height:38px; object-fit:contain; }
.appbar-titles{ display:flex; flex-direction:column; line-height:1.1; }
.appbar-title{ font-weight:700; font-size:15px; letter-spacing:.3px; }
.appbar-sub{ font-size:11px; color:var(--muted); letter-spacing:1.2px; text-transform:uppercase; }

.live-chip{
  display:inline-flex; align-items:center; gap:6px;
  font-size:10.5px; font-weight:700; letter-spacing:1.2px;
  padding:6px 11px; border-radius:999px;
  background:rgba(34,211,197,.12); color:var(--teal-bright);
  border:1px solid rgba(34,211,197,.25);
}
.live-dot{
  width:7px; height:7px; border-radius:50%; background:var(--teal-bright);
  box-shadow:0 0 0 0 rgba(34,211,197,.6); animation:pulse 2.8s ease-in-out infinite;
}
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(34,211,197,.55); }
  70%{ box-shadow:0 0 0 8px rgba(34,211,197,0); }
  100%{ box-shadow:0 0 0 0 rgba(34,211,197,0); }
}

/* ===================================================================
   THEME TOGGLE — animated sun / moon switch
   =================================================================== */
.theme-toggle{
  width:40px; height:40px; flex:0 0 auto; padding:0;
  border:1px solid var(--line); border-radius:50%;
  background:rgba(255,255,255,.05); cursor:pointer;
  position:relative; display:grid; place-items:center; overflow:visible;
  transition:background .35s, border-color .35s, transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .35s;
}
.theme-toggle:hover{ transform:scale(1.08) rotate(12deg); box-shadow:0 6px 20px rgba(0,0,0,.28); }
.theme-toggle:active{ transform:scale(.9); }
.theme-toggle:focus-visible{ outline:2px solid var(--teal-bright); outline-offset:3px; }

/* soft glow behind the orb */
.tt-halo{
  position:absolute; inset:-4px; border-radius:50%; z-index:0; pointer-events:none;
  opacity:0; transform:scale(.5); transition:opacity .5s, transform .5s, background .4s;
}
.tt-icon{ width:23px; height:23px; display:block; position:relative; z-index:1;
  transition:transform .7s cubic-bezier(.5,1.4,.4,1); }
.tt-body{ transition:fill .5s; }
.tt-rays{ stroke-width:1.9; transform-origin:12px 12px;
  transition:transform .55s cubic-bezier(.5,1.7,.45,1), opacity .4s, stroke .5s; }
.tt-mask-circle{ transition:transform .55s cubic-bezier(.45,0,.2,1); }

/* ---- DARK = MOON (crescent, no rays) ---- */
:root[data-theme="dark"] .tt-icon{ transform:rotate(-8deg); }
:root[data-theme="dark"] .tt-body{ fill:#e7ecff; }
:root[data-theme="dark"] .tt-rays{ opacity:0; transform:scale(.2) rotate(-60deg); stroke:#e7ecff; }
:root[data-theme="dark"] .tt-mask-circle{ transform:translate(0,0); }
:root[data-theme="dark"] .tt-halo{ opacity:.55; transform:scale(1);
  background:radial-gradient(circle, rgba(150,170,255,.5), transparent 65%); }

/* ---- LIGHT = SUN (full disc + rays) ---- */
:root[data-theme="light"] .theme-toggle{ background:rgba(0,0,0,.04); }
:root[data-theme="light"] .tt-icon{ transform:rotate(180deg); }
:root[data-theme="light"] .tt-body{ fill:#ffb02e; }
:root[data-theme="light"] .tt-rays{ opacity:1; transform:scale(1) rotate(0); stroke:#ffb02e; }
:root[data-theme="light"] .tt-mask-circle{ transform:translate(11px,-9px); }
:root[data-theme="light"] .tt-halo{ opacity:.7; transform:scale(1);
  background:radial-gradient(circle, rgba(255,176,46,.6), transparent 62%); }

/* ===================================================================
   CONTENT + VIEWS
   =================================================================== */
.content{
  position:relative; z-index:3;
  flex:1 1 auto; overflow-y:auto; overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:6px 18px calc(var(--tab-h) + 24px);
}
.content::-webkit-scrollbar{ width:0; }

.view{ display:none; animation:viewIn .45s cubic-bezier(.22,.61,.36,1); }
.view.is-active{ display:block; }
@keyframes viewIn{
  from{ opacity:0; transform:translateY(16px); }
  to{ opacity:1; transform:translateY(0); }
}

.section-head{ margin:8px 2px 20px; }
.section-head h2{ font-size:24px; font-weight:700; letter-spacing:-.5px; }
.section-head p{ font-size:13.5px; color:var(--muted); margin-top:4px; }

/* ===================================================================
   HERO
   =================================================================== */
.hero{ text-align:center; padding:14px 4px 8px; }
.hero-logo-wrap{ position:relative; width:120px; height:120px; margin:6px auto 10px; }
.hero-logo{
  width:120px; height:120px; object-fit:contain; position:relative; z-index:2;
  animation:floaty 7s ease-in-out infinite;
}
.hero-glow{
  position:absolute; inset:-30%; z-index:1; border-radius:50%;
  background:radial-gradient(circle, rgba(34,211,197,.35), transparent 62%);
  filter:blur(6px); animation:breathe 7s ease-in-out infinite;
}
@keyframes floaty{ 50%{ transform:translateY(-9px); } }
@keyframes breathe{ 50%{ opacity:.55; transform:scale(1.08); } }

.hero-title{
  font-size:33px; font-weight:800; line-height:1.08; letter-spacing:-1px;
  margin-top:6px;
}
.hero-title br+*{ }
.hero-text{
  font-size:14px; color:var(--muted); line-height:1.6; margin:14px auto 22px; max-width:320px;
}
.hero-text strong{ color:var(--teal-bright); font-weight:600; }

.hero-vs{
  display:flex; align-items:center; justify-content:center; gap:14px; margin-bottom:26px;
}
.hero-vs-face{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  animation:popIn .6s backwards; animation-delay:var(--d);
}
.hero-vs-face img{
  width:84px; height:84px; border-radius:50%; object-fit:cover;
  border:2.5px solid var(--teal); box-shadow:0 8px 24px rgba(0,0,0,.4), 0 0 0 4px rgba(22,168,159,.15);
}
.hero-vs-face span{ font-size:13px; font-weight:600; }
.hero-vs-badge{
  font-size:13px; font-weight:800; color:var(--bg-bot);
  background:linear-gradient(135deg,var(--teal-bright),var(--teal));
  width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 6px 18px rgba(34,211,197,.5); flex:0 0 auto;
  animation:popIn .6s .3s backwards;
}
@keyframes popIn{ from{ opacity:0; transform:scale(.6); } }

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn{
  font-family:inherit; font-size:15px; font-weight:600; cursor:pointer;
  border:none; border-radius:15px; padding:16px 20px;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  transition:transform .15s ease, box-shadow .25s ease, opacity .2s, background .2s;
  position:relative; overflow:hidden;
}
.btn:active{ transform:scale(.97); }
.btn-block{ width:100%; }
.btn-primary{
  color:#022; background:linear-gradient(135deg,var(--teal-bright),var(--teal));
  box-shadow:0 12px 30px rgba(22,168,159,.4), 0 0 0 1px rgba(34,211,197,.3) inset;
}
.btn-primary:disabled{ opacity:.45; box-shadow:none; cursor:not-allowed; }
.btn-ghost{
  color:var(--text); background:transparent; margin-top:11px;
  border:1px solid var(--line);
}
.btn-arrow{ transition:transform .25s; }
.btn-primary:not(:disabled):hover .btn-arrow{ transform:translateX(4px); }

/* loading spinner in submit */
.btn-spinner{
  width:19px; height:19px; border-radius:50%; display:none;
  border:2.5px solid rgba(0,0,0,.25); border-top-color:#022; animation:spin .7s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
.btn.is-loading .btn-label{ visibility:hidden; }
.btn.is-loading .btn-spinner{ display:block; position:absolute; }

/* ===================================================================
   FORM / FIELDS
   =================================================================== */
.field{ margin-bottom:20px; }
.field label,.field-label{
  display:block; font-size:11.5px; font-weight:600; letter-spacing:1.3px;
  text-transform:uppercase; color:var(--muted); margin:0 2px 9px;
}
.input-wrap{ position:relative; }
.input-ic{
  position:absolute; left:15px; top:50%; transform:translateY(-50%);
  width:20px; height:20px; fill:var(--muted-2); transition:fill .2s;
}
.input-wrap input{
  width:100%; font-family:inherit; font-size:15.5px; color:var(--text);
  background:var(--input); border:1.5px solid transparent; border-radius:14px;
  padding:15px 15px 15px 46px; transition:border-color .2s, background .2s, box-shadow .2s;
}
.input-wrap input::placeholder{ color:var(--muted-2); }
.input-wrap input:focus{
  outline:none; background:var(--input-focus);
  border-color:var(--teal); box-shadow:0 0 0 4px rgba(22,168,159,.15);
}
.input-wrap input:focus ~ .input-ic,
.input-wrap:focus-within .input-ic{ fill:var(--teal-bright); }

/* ---------- Candidate selection cards ---------- */
.candidates{ display:flex; flex-direction:column; gap:13px; margin-bottom:18px; }
.cand-card{
  display:flex; align-items:center; gap:15px;
  background:var(--card); border:1.5px solid var(--line); border-radius:var(--radius);
  padding:13px 15px 13px 13px; cursor:pointer;
  transition:transform .18s, border-color .2s, background .2s, box-shadow .25s;
  position:relative;
}
.cand-card:active{ transform:scale(.98); }
.cand-photo{ position:relative; flex:0 0 auto; }
.cand-photo img{
  width:66px; height:66px; border-radius:16px; object-fit:cover;
  transition:transform .25s;
}
.cand-check{
  position:absolute; right:-6px; bottom:-6px;
  width:26px; height:26px; border-radius:50%;
  background:var(--teal); border:2.5px solid var(--card-solid);
  display:flex; align-items:center; justify-content:center;
  transform:scale(0); transition:transform .28s cubic-bezier(.34,1.56,.64,1);
}
.cand-check svg{ width:14px; height:14px; fill:#022; }
.cand-info{ display:flex; flex-direction:column; gap:3px; }
.cand-name{ font-size:17px; font-weight:600; }
.cand-tag{ font-size:12px; color:var(--muted); }

.cand-card.is-selected{
  border-color:var(--teal);
  background:linear-gradient(135deg, rgba(22,168,159,.18), rgba(9,22,26,.85));
  box-shadow:0 12px 30px rgba(22,168,159,.22), 0 0 0 1px var(--teal) inset;
}
.cand-card.is-selected .cand-check{ transform:scale(1); }
.cand-card.is-selected .cand-photo img{ transform:scale(1.03); }

/* form message */
.form-msg{
  font-size:13px; padding:12px 14px; border-radius:12px; margin-bottom:16px;
  background:rgba(255,107,107,.12); color:var(--danger);
  border:1px solid rgba(255,107,107,.28);
  animation:viewIn .3s;
}
.form-msg.ok{
  background:rgba(34,211,197,.12); color:var(--teal-bright);
  border-color:rgba(34,211,197,.3);
}

/* ---------- Honesty notice ---------- */
.honesty-note{
  display:flex; gap:12px; align-items:flex-start;
  background:linear-gradient(135deg, rgba(22,168,159,.14), rgba(9,22,26,.6));
  border:1px solid rgba(34,211,197,.28); border-radius:16px;
  padding:14px 16px; margin:0 2px 22px;
  font-size:13px; line-height:1.55; color:var(--text);
}
.honesty-ic{ font-size:20px; line-height:1.2; flex:0 0 auto; }
.honesty-note strong{ color:var(--teal-bright); font-weight:600; }
.honesty-note em{ font-style:normal; font-weight:600; color:#fff; text-decoration:underline; text-decoration-color:rgba(34,211,197,.5); text-underline-offset:2px; }

/* ===================================================================
   RESULTS
   =================================================================== */
.tally{
  text-align:center; background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:20px; margin-bottom:20px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.tally-num{
  font-size:46px; font-weight:800; line-height:1; letter-spacing:-1.5px;
  background:linear-gradient(135deg,var(--teal-bright),var(--teal));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.tally-label{ font-size:12px; color:var(--muted); letter-spacing:1.5px; text-transform:uppercase; margin-top:6px; }

.results-list{ display:flex; flex-direction:column; gap:15px; }
.result-row{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:15px 16px; transition:border-color .3s, box-shadow .3s, transform .3s;
}
.result-row.is-leading{
  border-color:rgba(34,211,197,.4);
  box-shadow:0 12px 30px rgba(22,168,159,.18);
}
.result-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.result-who{ display:flex; align-items:center; gap:12px; }
.result-avatar{ width:48px; height:48px; border-radius:13px; object-fit:cover; border:1.5px solid var(--line); }
.result-name{ font-size:16px; font-weight:600; display:block; }
.result-lead-chip{
  font-size:10.5px; font-weight:700; color:var(--teal-bright); letter-spacing:.3px;
  display:inline-block; margin-top:2px;
}
.result-count{ text-align:right; }
.result-votes{ font-size:22px; font-weight:800; display:block; line-height:1; }
.result-pct{ font-size:12px; color:var(--muted); font-weight:600; }

.result-bar{
  height:12px; border-radius:999px; background:rgba(255,255,255,.06); overflow:hidden;
}
.result-bar-fill{
  height:100%; border-radius:999px; width:0;
  background:linear-gradient(90deg,var(--teal-deep),var(--teal-bright));
  box-shadow:0 0 14px rgba(34,211,197,.5);
  transition:width 1s cubic-bezier(.22,.61,.36,1);
  position:relative; overflow:hidden;
}
.result-bar-fill::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent);
  transform:translateX(-100%); animation:shimmer 2.4s infinite;
}
@keyframes shimmer{ to{ transform:translateX(200%); } }

.results-foot{
  display:flex; align-items:center; justify-content:center; gap:8px;
  font-size:11.5px; color:var(--muted-2); margin-top:20px;
}

/* ===================================================================
   BOTTOM TAB BAR
   =================================================================== */
.tabbar{
  position:absolute; left:0; right:0; bottom:0; z-index:20;
  height:calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);
  display:flex; align-items:stretch;
  background:rgba(6,16,17,.9); backdrop-filter:blur(18px);
  border-top:1px solid var(--line);
}
.tab{
  flex:1; background:none; border:none; cursor:pointer; color:var(--muted-2);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  font-family:inherit; font-size:10.5px; font-weight:600; letter-spacing:.3px;
  transition:color .2s; position:relative;
}
.tab svg{ width:23px; height:23px; fill:currentColor; transition:transform .2s; }
.tab.is-active{ color:var(--teal-bright); }
.tab.is-active svg{ transform:translateY(-2px) scale(1.08); }
.tab.is-active::before{
  content:""; position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:30px; height:3px; border-radius:0 0 4px 4px; background:var(--teal-bright);
}
/* center Vote tab as a raised action */
.tab-vote svg{
  background:linear-gradient(135deg,var(--teal-bright),var(--teal));
  fill:#022; width:46px; height:46px; padding:11px; border-radius:16px;
  margin-top:-24px; box-shadow:0 8px 20px rgba(22,168,159,.5);
  border:3px solid rgba(6,16,17,.9);
}
.tab-vote.is-active::before{ display:none; }
.tab-vote.is-active{ color:var(--teal-bright); }
.tab-vote.is-active svg{ transform:translateY(-2px) scale(1.04); }

/* ===================================================================
   SUCCESS OVERLAY
   =================================================================== */
.overlay{
  position:fixed; inset:0; z-index:100;
  background:rgba(4,12,13,.72); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; padding:26px;
  animation:viewIn .3s;
}
.success-card{
  width:100%; max-width:360px; text-align:center;
  background:linear-gradient(160deg,#0f2528,#0a1618);
  border:1px solid var(--line); border-radius:26px; padding:34px 26px 26px;
  box-shadow:var(--shadow); animation:cardPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cardPop{ from{ opacity:0; transform:scale(.85) translateY(10px); } }
.success-check{ width:82px; height:82px; margin:0 auto 18px; }
.success-check svg{ width:82px; height:82px; }
.success-check circle{
  fill:none; stroke:var(--teal); stroke-width:3;
  stroke-dasharray:151; stroke-dashoffset:151; animation:draw .6s .1s forwards;
}
.success-check path{
  fill:none; stroke:var(--teal-bright); stroke-width:4; stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray:48; stroke-dashoffset:48; animation:draw .4s .55s forwards;
}
@keyframes draw{ to{ stroke-dashoffset:0; } }
.success-card h3{ font-size:23px; font-weight:700; margin-bottom:8px; }
.success-card p{ font-size:14px; color:var(--muted); line-height:1.55; margin-bottom:22px; }

/* ---------- Confirmation card ---------- */
.confirm-card{
  width:100%; max-width:360px; text-align:center;
  background:linear-gradient(160deg,#0f2528,#0a1618);
  border:1px solid var(--line); border-radius:26px; padding:26px 24px 24px;
  box-shadow:var(--shadow); animation:cardPop .45s cubic-bezier(.34,1.56,.64,1);
}
.confirm-kicker{
  display:inline-block; font-size:10.5px; font-weight:700; letter-spacing:1.6px;
  text-transform:uppercase; color:var(--teal-bright);
  background:rgba(34,211,197,.12); border:1px solid rgba(34,211,197,.25);
  padding:5px 13px; border-radius:999px; margin-bottom:18px;
}
.confirm-photo{ width:110px; height:110px; margin:0 auto 18px; position:relative; }
.confirm-photo img{
  width:110px; height:110px; border-radius:50%; object-fit:cover;
  border:3px solid var(--teal);
  box-shadow:0 10px 30px rgba(0,0,0,.45), 0 0 0 5px rgba(22,168,159,.16);
}
.confirm-statement{
  font-size:16px; line-height:1.6; color:var(--text); margin-bottom:18px; padding:0 4px;
}
.confirm-statement .hl-voter{ color:#fff; font-weight:600; }
.confirm-statement .hl-cand{
  color:var(--teal-bright); font-weight:700;
}
.confirm-final{
  display:flex; align-items:center; justify-content:center; gap:7px; flex-wrap:wrap;
  font-size:12.5px; line-height:1.5; color:#ffd9a0;
  background:rgba(255,170,80,.1); border:1px solid rgba(255,170,80,.28);
  border-radius:13px; padding:11px 14px; margin-bottom:20px;
}
.confirm-final b{ color:#ffe6bf; font-weight:700; }
#confirmNo{ margin-top:10px; }

/* confetti canvas */
#confetti{
  position:fixed; inset:0; z-index:99; pointer-events:none; display:none;
}

/* ===================================================================
   COMPACT MODE — real phones (iPhone SE and up).
   Tightens spacing + element sizes so each view fits one screen with
   no scrolling, even when an error / "already voted" message shows.
   Desktop keeps the roomier phone-mockup layout.
   =================================================================== */
@media (max-width:600px){
  :root{ --tab-h:58px; --radius:16px; }

  .content{ padding:2px 15px calc(var(--tab-h) + 8px); }

  .appbar{ padding:calc(env(safe-area-inset-top) + 10px) 15px 8px; }
  .appbar-logo{ width:34px; height:34px; }
  .appbar-title{ font-size:14px; }
  .appbar-sub{ font-size:10px; }

  .section-head{ margin:2px 2px 11px; }
  .section-head h2{ font-size:20px; }
  .section-head p{ font-size:12px; margin-top:2px; }

  /* Honesty notice */
  .honesty-note{
    padding:9px 11px; margin:0 2px 11px; gap:8px;
    font-size:11px; line-height:1.4; border-radius:12px;
  }
  .honesty-ic{ font-size:15px; }

  /* Fields */
  .field{ margin-bottom:11px; }
  .field label,.field-label{ font-size:10.5px; margin:0 2px 6px; }
  .input-wrap input{ padding:11px 14px 11px 42px; font-size:14.5px; border-radius:12px; }
  .input-ic{ width:18px; height:18px; left:14px; }

  /* Candidate cards */
  .candidates{ gap:8px; margin-bottom:11px; }
  .cand-card{ padding:8px 12px 8px 8px; gap:11px; }
  .cand-photo img{ width:50px; height:50px; border-radius:12px; }
  .cand-check{ width:21px; height:21px; right:-5px; bottom:-5px; }
  .cand-check svg{ width:12px; height:12px; }
  .cand-name{ font-size:15px; }
  .cand-tag{ font-size:11px; }

  /* Buttons */
  .btn{ padding:12px 18px; font-size:14.5px; border-radius:13px; }
  .btn-ghost{ margin-top:8px; }
  .form-msg{ padding:9px 12px; margin-bottom:10px; font-size:12px; border-radius:11px; }

  /* Hero */
  .hero{ padding:4px 4px 2px; }
  .hero-logo-wrap,.hero-logo{ width:82px; height:82px; }
  .hero-logo-wrap{ margin:2px auto 6px; }
  .hero-title{ font-size:25px; margin-top:2px; }
  .hero-text{ font-size:12px; margin:8px auto 13px; }
  .hero-vs{ gap:11px; margin-bottom:14px; }
  .hero-vs-face{ gap:5px; }
  .hero-vs-face img{ width:62px; height:62px; }
  .hero-vs-face span{ font-size:12px; }
  .hero-vs-badge{ width:30px; height:30px; font-size:11px; }

  /* Results */
  .tally{ padding:13px; margin-bottom:13px; }
  .tally-num{ font-size:34px; }
  .tally-label{ font-size:10.5px; margin-top:3px; }
  .results-list{ gap:10px; }
  .result-row{ padding:11px 13px; }
  .result-top{ margin-bottom:9px; }
  .result-avatar{ width:40px; height:40px; border-radius:11px; }
  .result-who{ gap:10px; }
  .result-name{ font-size:14.5px; }
  .result-votes{ font-size:19px; }
  .result-bar{ height:10px; }
  .results-foot{ margin-top:12px; font-size:11px; }

  /* Modals (confirm + success) */
  .overlay{ padding:20px; }
  .confirm-card,.success-card{ padding:20px 20px 18px; border-radius:22px; }
  .confirm-kicker{ margin-bottom:12px; font-size:10px; }
  .confirm-photo,.confirm-photo img{width: 300px;height: 300px;}
  .confirm-photo{ margin-bottom:12px; }
  .confirm-statement{ font-size:14.5px; line-height:1.5; margin-bottom:12px; }
  .confirm-final{ padding:9px 12px; margin-bottom:13px; font-size:11.5px; border-radius:11px; }
  .success-check,.success-check svg{ width:62px; height:62px; }
  .success-card h3{ font-size:20px; margin-bottom:6px; }
  .success-card p{ font-size:13px; margin-bottom:16px; }
}

/* Extra squeeze for very short screens (small landscape / older devices). */
@media (max-width:600px) and (max-height:640px){
  .honesty-note{ font-size:10.5px; padding:8px 10px; margin-bottom:9px; }
  .section-head{ margin-bottom:9px; }
  .section-head h2{ font-size:18px; }
  .field{ margin-bottom:9px; }
  .candidates{ gap:7px; }
  .cand-photo img{ width:46px; height:46px; }
}

/* ===================================================================
   LIGHT THEME
   =================================================================== */
:root[data-theme="light"]{
  --teal:        #0f9c92;
  --teal-bright: #12b3a6;
  --teal-deep:   #0b7d75;
  --bg-top:      #c7ece7;
  --bg-mid:      #e6f4f1;
  --bg-bot:      #f5faf8;
  --card:        rgba(255,255,255,0.80);
  --card-solid:  #ffffff;
  --input:       #eaf1ef;
  --input-focus: #ffffff;
  --line:        rgba(8,45,42,0.12);
  --text:        #0f2e2b;
  --muted:       #5c7c78;
  --muted-2:     #8aa6a2;
  --shadow:      0 22px 55px rgba(15,80,74,0.18);
}

/* White brand logo needs to become dark/teal on a light background */
:root[data-theme="light"] .appbar-logo,
:root[data-theme="light"] .hero-logo{
  filter:brightness(0) saturate(100%) invert(38%) sepia(64%) saturate(560%) hue-rotate(129deg) brightness(92%) contrast(92%);
}
/* Background dashes: dark strokes instead of light on a light bg */
:root[data-theme="light"] .bg-dashes{
  background-image:repeating-linear-gradient(115deg,
    transparent 0 34px, rgba(8,45,42,.05) 34px 40px, transparent 40px 78px);
  opacity:.6;
}
:root[data-theme="light"] .tabbar{ background:rgba(255,255,255,.82); }
:root[data-theme="light"] .tab-vote svg{ border-color:rgba(245,250,248,.95); }
:root[data-theme="light"] .result-bar{ background:rgba(8,45,42,.09); }
:root[data-theme="light"] .cand-card.is-selected{
  background:linear-gradient(135deg, rgba(18,179,166,.16), rgba(255,255,255,.92));
}
:root[data-theme="light"] .honesty-note{
  background:linear-gradient(135deg, rgba(18,179,166,.14), rgba(255,255,255,.55));
}
:root[data-theme="light"] .honesty-note em{ color:#0a3f3a; text-decoration-color:rgba(18,179,166,.6); }
:root[data-theme="light"] .confirm-card,
:root[data-theme="light"] .success-card{ background:linear-gradient(160deg,#ffffff,#eaf6f3); }
:root[data-theme="light"] .confirm-statement .hl-voter{ color:var(--text); }
:root[data-theme="light"] .overlay{ background:rgba(20,54,50,.34); }
:root[data-theme="light"] .confirm-final{
  color:#7a4a08; background:rgba(255,170,60,.16); border-color:rgba(200,130,30,.32);
}
:root[data-theme="light"] .confirm-final b{ color:#5f3906; }

/* ===================================================================
   THEME TRANSITIONS
   Smooth per-element fade (all browsers) + artistic circular reveal
   from the toggle button (browsers with the View Transitions API).
   =================================================================== */
body, .app, .appbar, .cand-card, .result-row, .tally, .tabbar,
.input-wrap input, .btn-ghost, .honesty-note, .confirm-card, .success-card,
.section-head h2, .section-head p, .appbar-title, .appbar-sub, .result-bar{
  transition:background-color .5s ease, color .5s ease, border-color .5s ease, box-shadow .5s ease;
}

@supports (view-transition-name: root){
  ::view-transition-old(root){ animation:none; }
  ::view-transition-new(root){
    animation:vtReveal .6s cubic-bezier(.4,0,.2,1);
    mix-blend-mode:normal;
  }
}
@keyframes vtReveal{
  from{ clip-path:circle(0% at var(--vt-x, 100%) var(--vt-y, 0%)); }
  to{   clip-path:circle(150% at var(--vt-x, 100%) var(--vt-y, 0%)); }
}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  *{animation-duration: 1s !important;transition-duration:.05s !important;}
  .bg-dashes{ animation:none; }
  ::view-transition-new(root){ animation:none; }
}
