/* ============================================================
   AssamPolls — style.css
   Dark theme for all public-facing pages
   Fonts: Syne (headings) + DM Sans (body) via Google Fonts
   ============================================================ */

/* -- GOOGLE FONTS import is in <head> of each page -- */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --orange:        #FF6200;
  --orange-hover:  #FF7A1A;
  --orange-dim:    rgba(255,98,0,0.12);
  --orange-border: rgba(255,98,0,0.30);

  --bg:        #0B0E1A;
  --bg2:       #131726;
  --bg3:       #1C2138;
  --surface:   #222740;
  --surface2:  #2A3050;
  --surface3:  #333858;

  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);

  --text:      #F0F2FF;
  --text2:     #9DA8C9;
  --text3:     #5A6382;

  --green:     #22C55E;
  --green-dim: rgba(34,197,94,0.12);
  --red:       #EF4444;
  --red-dim:   rgba(239,68,68,0.12);
  --amber:     #F59E0B;
  --blue:      #3B82F6;
  --blue-dim:  rgba(59,130,246,0.12);

  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.3);
}

/* ============================================================
   LIGHT THEME OVERRIDES
   Applied when <html data-theme="light">
   ============================================================ */
[data-theme="light"] {
  --bg:        #F4F6FB;
  --bg2:       #EBEEF6;
  --bg3:       #DDE2F0;
  --surface:   #FFFFFF;
  --surface2:  #F0F3FA;
  --surface3:  #E4E8F4;

  --border:    rgba(0,0,0,0.08);
  --border2:   rgba(0,0,0,0.14);

  --text:      #0F1220;
  --text2:     #3A4060;
  --text3:     #8490B0;

  --shadow:    0 4px 24px rgba(0,0,0,0.10);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.07);

  /* Keep accent colours the same — they work on both themes */
  --orange-dim:    rgba(255,98,0,0.10);
  --orange-border: rgba(255,98,0,0.25);
  --green-dim:     rgba(34,197,94,0.10);
  --red-dim:       rgba(239,68,68,0.10);
  --blue-dim:      rgba(59,130,246,0.10);
}

/* Smooth theme transitions on everything except images */
*:not(img):not(canvas):not(video) {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-hover); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: -0.5px;
}
.brand-name .accent { color: var(--orange); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.ap-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13,16,30,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
}

.ap-nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.ap-nav .nav-logo {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.5px;
}
.ap-nav .nav-logo span { color: var(--orange); }

.nav-desktop-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-desktop-links a {
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.nav-desktop-links a:hover,
.nav-desktop-links a.active {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.ap-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- THEME TOGGLE BUTTON ---- */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.theme-toggle:hover {
  background: var(--surface2);
  border-color: var(--orange-border);
  transform: rotate(20deg);
}
/* Icon swap via CSS */
.theme-icon-dark  { display: inline; }
.theme-icon-light { display: none;   }
[data-theme="light"] .theme-icon-dark  { display: none;   }
[data-theme="light"] .theme-icon-light { display: inline; }

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.30);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--red);
  letter-spacing: 0.3px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 400;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 11px 24px;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.btn:hover  { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--orange);
  color: #fff;
}
.btn-primary:hover { background: var(--orange-hover); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-outline:hover { border-color: var(--orange-border); color: var(--orange); }

.btn-ghost {
  background: var(--surface);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 7px 16px; font-size: 12px; }
.btn-block { width: 100%; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

.form-control::placeholder { color: var(--text3); }

.form-control.is-invalid { border-color: var(--red); }
.form-control.is-valid   { border-color: var(--green); }

.form-hint {
  font-size: 12px;
  color: var(--text3);
  margin-top: 5px;
}

/* Input with prefix (mobile number) */
.input-group {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg3);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}
.input-prefix {
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text2);
  font-size: 15px;
  font-weight: 400;
  border-right: 1px solid var(--border2);
  white-space: nowrap;
}
.input-group .form-control {
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.input-group .form-control:focus { box-shadow: none; }

/* Select arrow */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239DA8C9' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* OTP input boxes */
.otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0;
}
.otp-box {
  width: 52px;
  height: 58px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 400;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.otp-box:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}
.otp-box.filled  { border-color: var(--orange); }
.otp-box.success { border-color: var(--green); background: var(--green-dim); }
.otp-box.error   { border-color: var(--red);   background: var(--red-dim); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-sm { padding: 16px 20px; }
.card-lg { padding: 32px; }

.card-header {
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   ALERTS & MESSAGES
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert-error   { background: var(--red-dim);   border: 1px solid rgba(239,68,68,0.25);  color: #FCA5A5; }
.alert-success { background: var(--green-dim); border: 1px solid rgba(34,197,94,0.25);  color: #86EFAC; }
.alert-info    { background: var(--blue-dim);  border: 1px solid rgba(59,130,246,0.25); color: #93C5FD; }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); color: #FCD34D; }
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-msg  { flex: 1; }

/* ============================================================
   PROGRESS / STEP INDICATORS
   ============================================================ */
.step-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.step-item + .step-item::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--border2);
  z-index: 0;
  transition: background 0.4s;
}
.step-item.completed + .step-item::before { background: var(--orange); }

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border2);
  color: var(--text3);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}
.step-item.active .step-num {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 0 0 4px var(--orange-dim);
}
.step-item.completed .step-num {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.step-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text3);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  transition: color 0.3s;
}
.step-item.active .step-label    { color: var(--orange); }
.step-item.completed .step-label { color: var(--green); }

/* ============================================================
   PARTY SELECTOR BUTTONS
   ============================================================ */
.party-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.party-btn {
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.party-btn:hover {
  border-color: var(--orange-border);
  background: var(--orange-dim);
}

.party-btn.active {
  border-color: var(--orange);
  background: var(--orange-dim);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

.party-btn .party-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--text2);
  transition: color 0.2s;
}
.party-btn .party-alliance {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.party-btn.active .party-name { color: var(--orange); }

.party-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

/* ============================================================
   ISSUE SELECTOR
   ============================================================ */
.issue-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.issue-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.issue-btn:hover { border-color: var(--orange-border); color: var(--text); }
.issue-btn.active {
  border-color: var(--orange);
  background: var(--orange-dim);
  color: var(--orange);
}
.issue-btn .issue-icon { font-size: 15px; flex-shrink: 0; }

/* ============================================================
   COUNTDOWN TIMER
   ============================================================ */
.countdown {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.countdown-unit {
  text-align: center;
  min-width: 56px;
}
.countdown-num {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 400;
  color: var(--orange);
  line-height: 1;
  display: block;
}
.countdown-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
  display: block;
}

/* ============================================================
   SUCCESS / SHARE CARD
   ============================================================ */
.success-card {
  background: var(--bg2);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  text-align: center;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: var(--green-dim);
  border: 2px solid rgba(34,197,94,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}

.vote-receipt {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-align: left;
  margin: 20px 0;
}

.vote-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}
.vote-receipt-row + .vote-receipt-row {
  border-top: 1px solid var(--border);
}
.vote-receipt-row .label { color: var(--text3); }
.vote-receipt-row .value { color: var(--text); font-weight: 400; }

.share-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ============================================================
   DISCLAIMER STRIP
   ============================================================ */
.disclaimer-strip {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.20);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 12px;
  color: #FCD34D;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.ap-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 60px;
}

.ap-footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ap-footer .footer-brand {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
}
.ap-footer .footer-brand span { color: var(--orange); }

.ap-footer .footer-links {
  display: flex;
  gap: 16px;
  list-style: none;
  flex-wrap: wrap;
}
.ap-footer .footer-links a {
  font-size: 13px;
  color: var(--text3);
}
.ap-footer .footer-links a:hover { color: var(--orange); }

.ap-footer .footer-disclaimer {
  width: 100%;
  font-size: 11px;
  color: var(--text3);
  line-height: 1.6;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   ANIMATIONS — page entrance
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   USER OVERRIDE: FRONTEND NORMALIZED WEIGHTS
   ============================================================ */
body * {
    font-weight: 400 !important;
}

body b, body strong {
    font-weight: 600 !important;
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.fade-in-up:nth-child(1) { animation-delay: 0.0s; }
.fade-in-up:nth-child(2) { animation-delay: 0.08s; }
.fade-in-up:nth-child(3) { animation-delay: 0.16s; }
.fade-in-up:nth-child(4) { animation-delay: 0.24s; }

/* ============================================================
   VOTE PAGE SPECIFIC LAYOUT
   ============================================================ */
.vote-page-wrap {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 0 60px;
}

.vote-page-inner {
  width: 100%;
  max-width: 520px;
  padding: 0 20px;
}

/* Step panels */
.step-panel {
  display: none;
  animation: fadeInUp 0.35s ease forwards;
}
.step-panel.active { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── HAMBURGER BUTTON ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-hamburger .bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s;
}
.nav-hamburger.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open .bar:nth-child(2) { opacity: 0; }
.nav-hamburger.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE DRAWER ── */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
}
.mobile-drawer.open { display: block; }

.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  padding: 12px 16px 20px;
  animation: drawerSlideIn 0.22s ease forwards;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

@keyframes drawerSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mobile-drawer-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 400;
  color: var(--text2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.mobile-drawer-panel a:hover,
.mobile-drawer-panel a.active {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.mobile-drawer-panel a .mob-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.mob-divider { height: 1px; background: var(--border); margin: 8px 0; }
.mob-section-label { font-size: 10px; font-weight: 400; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; padding: 8px 14px 4px; }

@media (max-width: 640px) {
  .nav-hamburger { display: flex; }
  .otp-boxes { gap: 6px; justify-content: space-between; }
  .otp-box { flex: 1; height: 52px; font-size: 22px; width: 100%; border-radius: var(--radius-sm); }
  .party-grid { grid-template-columns: 1fr; gap: 8px; }
  .issue-grid { grid-template-columns: 1fr; }
  .countdown-num { font-size: 22px; }
  .card-lg { padding: 20px 16px; }
  .step-label { font-size: 9px; letter-spacing: 0; }
  .vote-hero h1 { font-size: 24px; }
  .step-wrap { padding: 18px 14px 24px; border-radius: var(--radius-lg); }
  .party-btn { padding: 12px; gap: 4px; }
  .party-btn .party-name { font-size: 14px; font-weight: 700; }
}

@media (max-width: 400px) {
  .otp-box { height: 46px; font-size: 18px; }
}

/* ============================================================
   LIGHT THEME COMPONENT FIXES
   Extra overrides where CSS vars alone aren't enough
   ============================================================ */

/* Navbar — shadow in light mode */
[data-theme="light"] .ap-nav {
  background: rgba(255,255,255,0.96);
  box-shadow: 0 1px 8px rgba(0,0,0,0.10);
}

/* Buttons — outline variant readability */
[data-theme="light"] .btn-outline {
  color: var(--text);
  border-color: var(--border2);
}
[data-theme="light"] .btn-outline:hover {
  background: var(--surface2);
}
[data-theme="light"] .btn-ghost {
  color: var(--text2);
}

/* Ticker label */
[data-theme="light"] .ticker-label {
  background: rgba(255,98,0,0.12);
  color: var(--orange);
}

/* Heatmap cells — use border so they show on white bg */
[data-theme="light"] .heatmap-cell {
  border: 1px solid var(--border);
}

/* Party stat cards — give them depth in light mode */
[data-theme="light"] .party-stat-card,
[data-theme="light"] .aside-panel,
[data-theme="light"] .prediction-panel,
[data-theme="light"] .chart-panel,
[data-theme="light"] .issues-panel,
[data-theme="light"] .majority-indicator {
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

/* Nav dropdown */
[data-theme="light"] .nav-dropdown {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Badges */
[data-theme="light"] .badge-blue   { background: rgba(59,130,246,0.12); color:#1D4ED8; }
[data-theme="light"] .badge-green  { background: rgba(34,197,94,0.12);  color:#15803D; }
[data-theme="light"] .badge-orange { background: rgba(255,98,0,0.12);   color:#C2410C; }
[data-theme="light"] .badge-amber  { background: rgba(245,158,11,0.12); color:#92400E; }
[data-theme="light"] .badge-red    { background: rgba(239,68,68,0.12);  color:#B91C1C; }

/* Code / monospace elements */
[data-theme="light"] code,
[data-theme="light"] .font-mono {
  background: var(--surface2);
  color: #C2410C;
}

/* Live dot keep red on both themes */
.live-dot { background: var(--red); }

/* Vote wizard steps */
[data-theme="light"] .step-circle.done  { background: var(--green); }
[data-theme="light"] .step-circle.active{ background: var(--orange); }

/* OTP input boxes */
[data-theme="light"] .otp-box {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border2);
}
[data-theme="light"] .otp-box:focus {
  border-color: var(--orange);
  background: var(--surface);
}

/* Disclaimer bar */
[data-theme="light"] .disclaimer-bar {
  background: rgba(245,158,11,0.07);
  border-color: rgba(245,158,11,0.2);
  color: #92400E;
}
[data-theme="light"] .disclaimer-bar a { color: var(--orange); }

/* Footer */
[data-theme="light"] .ap-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

/* Admin panel stays dark regardless of theme toggle */
/* (admin has its own admin.css, not affected by data-theme) */

/* ============================================================ */
/* GLOBAL MOBILE RESPONSIVENESS — ALL PUBLIC PAGES      */
/* Coherent, Mobile-First refinements for all public-facing UI */
/* ============================================================ */

/* ── UNIVERSAL BASE — Prevent all overflow ──────────────────── */
html, body {
  overflow-x: hidden !important;
  width: 100vw;
  position: relative;
}
img, video, canvas, iframe { max-width: 100%; height: auto; }
table { width: 100%; display: block; overflow-x: auto; }

/* ── LAYOUT — Containers ──────────────────────────────────── */
.container, .container-sm { 
  padding: 0 16px !important; 
  box-sizing: border-box;
}

@media (max-width: 768px) {
  /* ── NAVIGATION ────────────────────────────────────────── */
  .ap-nav .nav-links { display: none !important; }
  .nav-hamburger { display: flex !important; }
  .nav-right .btn-primary { display: none !important; } /* Hidden in favor of drawer */
  .nav-logo { font-size: 20px; }

  /* ── HERO SECTIONS — Standardize ────────────────────────── */
  [class*="-hero"] { 
    padding: 32px 16px !important; 
    text-align: center; 
  }
  [class*="-hero"] h1 { font-size: clamp(24px, 7vw, 36px) !important; line-height: 1.1; }
  [class*="-hero"] p { font-size: 14px !important; margin-bottom: 20px; }
  
  /* ── PREDICT.PHP ────────────────────────────────────────── */
  .hero-stats { gap: 8px !important; justify-content: center !important; }
  .hero-stat { flex: 1 1 140px; padding: 10px !important; margin: 0 !important; }
  .hero-stat .val { font-size: 20px !important; }
  .hero-stat .lbl { font-size: 10px !important; }
  
  .pred-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .party-grid, .pred-party-grid { 
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important; 
    gap: 8px !important; 
  }
  .seat-display { font-size: 32px !important; }
  .locket-seats { font-size: 44px !important; }
  .my-pred-locket { padding: 16px !important; }
  
  /* ── DUEL.PHP ───────────────────────────────────────────── */
  .duel-grid { 
    grid-template-columns: 1fr !important; 
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  .duel-vs-col { 
    flex-direction: row !important; 
    padding: 16px 0 !important; 
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    z-index: 5;
  }
  .vs-line { width: 40px !important; height: 1px !important; }
  .duel-side { padding: 0 !important; order: 2; }
  .duel-side:first-child { order: 1; }
  .duel-side:last-child { order: 3; }
  .duel-picker-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .vs-badge { text-align: center; padding: 0; }
  
  /* ── SWING.PHP ──────────────────────────────────────────── */
  .swing-summary { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .sw-card { padding: 12px !important; }
  .sw-value { font-size: 20px !important; }
  .swing-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .swing-filter-row { overflow-x: auto; white-space: nowrap; padding-bottom: 8px; flex-wrap: nowrap !important; }
  .seg-tabs { flex-shrink: 0; }
  
  /* ── MAP.PHP ────────────────────────────────────────────── */
  #const-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)) !important; gap: 3px !important; }
  .const-cell .cell-name { font-size: 6px !important; }
  .const-cell .cell-party { font-size: 6px !important; padding: 1px 2px !important; }
  .dp-name { font-size: 18px !important; }
  .dp-pct { font-size: 22px !important; }
  .dp-actions { flex-direction: column; gap: 8px; }

  /* ── BATTLE.PHP ─────────────────────────────────────────── */
  .vs-clash-box { flex-direction: column !important; gap: 40px !important; align-items: center; }
  .vs-fighter { width: 100% !important; max-width: 360px !important; }
  .vs-mid { margin: -20px 0; transform: none !important; }
  .vs-avatar { width: 100px !important; height: 100px !important; font-size: 32px !important; }

  /* ── INFLUENCERS.PHP ────────────────────────────────────── */
  .rank-row { padding: 12px 10px !important; }
  .rank-num { width: 30px !important; font-size: 16px !important; }
  .rank-avatar { width: 32px !important; height: 32px !important; font-size: 14px !important; }
  .rank-score { font-size: 18px !important; }
  
  /* ── VOTING WIZARD (VOTE.PHP) ──────────────────────────── */
  .step-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .wizard-card { border-radius: 0 !important; border-left: none; border-right: none; }
  .wizard-footer { flex-direction: column-reverse; gap: 10px; }
  .wizard-footer .btn { width: 100%; }

  /* ── SHARE.PHP ─────────────────────────────────────────── */
  .card-preview-wrap { padding: 10px !important; }
  .share-actions { flex-direction: column; gap: 10px; }
  .share-btn-row { flex-direction: column !important; }
  
  /* ── SIDEBARS / ASIDE PANELS ───────────────────────────── */
  .dash-aside, .aside-panel { width: 100% !important; }
}

@media (max-width: 480px) {
  /* Extreme Mobile Tweaks */
  .hero-stat { flex: 1 1 45% !important; } /* 2 per row */
  .nav-logo span { display: none; }
  .party-grid, .pred-party-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .seat-display { font-size: 24px !important; }
  .btn { width: 100% !important; justify-content: center; }
  .share-fab { 
    bottom: 20px !important; 
    right: 12px !important; 
    left: 12px !important; 
    border-radius: 12px !important;
    justify-content: center;
  }
}

/* ── UTILITY ─────────────────────────────────────────────── */
.hide-mob { display: none !important; }
@media (min-width: 769px) {
  .show-mob { display: none !important; }
  .hide-mob { display: inherit !important; }
}

/* ── UNIVERSAL BASE — Prevent all overflow ──────────────────── */
html, body {
  overflow-x: hidden !important;
  width: 100vw;
  position: relative;
}
img, video, canvas, iframe { max-width: 100%; height: auto; }
table { width: 100%; display: block; overflow-x: auto; }

/* ── LAYOUT — Containers ──────────────────────────────────── */
.container, .container-sm { 
  padding: 0 16px !important; 
  box-sizing: border-box;
}

@media (max-width: 768px) {
  /* ── NAVIGATION ────────────────────────────────────────── */
  .ap-nav .nav-links { display: none !important; }
  .nav-hamburger { display: flex !important; }
  .nav-logo { font-size: 20px; }

  /* ── HERO SECTIONS — Standardize ────────────────────────── */
  [class*="-hero"] { padding: 32px 16px !important; text-align: center; }
  [class*="-hero"] h1 { font-size: clamp(24px, 7vw, 36px) !important; line-height: 1.1; }
  [class*="-hero"] p { font-size: 14px !important; margin-bottom: 20px; }
  
  /* ── PREDICT.PHP ────────────────────────────────────────── */
  .hero-stats { gap: 8px !important; justify-content: center !important; }
  .hero-stat { flex: 1 1 140px; padding: 10px !important; margin: 0 !important; }
  .hero-stat .val { font-size: 20px !important; }
  .hero-stat .lbl { font-size: 10px !important; }
  .pred-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .party-grid, .pred-party-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .seat-display { font-size: 32px !important; }
  .locket-seats { font-size: 44px !important; }
  .my-pred-locket { padding: 16px !important; }
  
  /* ── DUEL.PHP & BATTLE.PHP ───────────────────────────────── */
  .duel-grid { grid-template-columns: 1fr !important; display: flex !important; flex-direction: column !important; gap: 0 !important; }
  .duel-vs-col { flex-direction: row !important; padding: 16px 0 !important; align-items: center !important; justify-content: center !important; gap: 12px !important; z-index: 5; }
  .vs-line { width: 40px !important; height: 1px !important; }
  .duel-side { padding: 0 !important; order: 2; }
  .duel-side:first-child { order: 1; }
  .duel-side:last-child { order: 3; }
  .duel-picker-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .vs-clash-box { flex-direction: column !important; gap: 40px !important; align-items: center; }
  .vs-fighter { width: 100% !important; max-width: 360px !important; }
  .vs-mid { margin: -20px 0; transform: none !important; }
  .vs-avatar { width: 100px !important; height: 100px !important; font-size: 32px !important; }
  
  /* ── SHARE & MAP & INFLUENCERS ──────────────────────────── */
  .share-actions { flex-direction: column; gap: 10px; }
  .share-btn-row { flex-direction: column !important; }
  .dp-name { font-size: 18px !important; }
  .dp-pct { font-size: 22px !important; }
  .dp-actions { flex-direction: column; gap: 8px; }
  .rank-row { padding: 12px 10px !important; }
  .rank-num { width: 30px !important; font-size: 16px !important; }
  .rank-score { font-size: 18px !important; }
  
  /* ── PARTY PROFILE ──────────────────────────── */
  .party-header { flex-direction: column; text-align: center; }
  .party-header .logo-lg { margin: 0 auto; }
  .stat-card { padding: 16px !important; }
  .metric-large { font-size: 28px !important; }
  .party-metrics { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  
  /* ── SIDEBARS / ASIDE PANELS ───────────────────────────── */
  .dash-aside, .aside-panel { width: 100% !important; }
}

@media (max-width: 480px) {
  /* Extreme Mobile Tweaks */
  .hero-stat { flex: 1 1 45% !important; }
  .nav-logo span { display: none; }
  .seat-display { font-size: 24px !important; }
  .btn { width: 100% !important; justify-content: center; }
}

/* ========== MOBILE BOTTOM TAB BAR ========== */
.mobile-tab-bar { display: none; }

@media (max-width: 768px) {
    .mobile-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(13, 16, 30, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        z-index: 9999;
        justify-content: space-around;
        padding: 10px 0 calc(env(safe-area-inset-bottom) + 8px);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    }
    
    [data-theme="light"] .mobile-tab-bar {
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    }

    .mobile-tab-bar .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 1;
        color: var(--text3);
        text-decoration: none;
        transition: color 0.2s, transform 0.15s;
    }
    
    .mobile-tab-bar .tab-item:active {
        transform: scale(0.92);
    }

    .mobile-tab-bar .tab-icon {
        font-size: 20px;
        line-height: 1;
        filter: grayscale(1);
        opacity: 0.6;
        transition: all 0.2s;
    }

    .mobile-tab-bar .tab-label {
        font-size: 10.5px;
        font-weight: 600 !important;
        letter-spacing: 0.2px;
    }

    .mobile-tab-bar .tab-item.active {
        color: var(--orange);
    }
    
    .mobile-tab-bar .tab-item.active .tab-icon {
        filter: grayscale(0);
        opacity: 1;
        transform: translateY(-2px);
    }

    .ap-footer {
        padding-bottom: 90px !important;
    }
}

/* ========== FLOATING ACTION BUTTON ========== */
.fab-vote { display: none; }

@media (max-width: 768px) {
    .fab-vote {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: 90px;
        right: 16px;
        background: var(--orange);
        color: #fff !important;
        padding: 12px 20px 12px 14px;
        border-radius: 30px;
        box-shadow: 0 6px 20px rgba(255, 98, 0, 0.4);
        z-index: 9998;
        text-decoration: none;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .fab-vote:active {
        transform: scale(0.94);
        box-shadow: 0 2px 10px rgba(255, 98, 0, 0.3);
    }
    
    .fab-vote .fab-icon {
        font-size: 20px;
        line-height: 1;
        filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
    }
    
    .fab-vote .fab-text {
        font-family: var(--font-head);
        font-weight: 800 !important;
        font-size: 14px;
        letter-spacing: 0.3px;
        color: #fff !important;
    }
}
