/* ============ Design tokens ============ */
:root {
  --navy: #0b1f3a;
  --navy-2: #12305c;
  --blue: #1d4ed8;
  --gold: #f5b301;
  --ink: #1b2437;
  --muted: #6b7488;
  --surface: #f4f7fb;
  --radius: 1rem;
  --shadow: 0 10px 30px rgba(11, 31, 58, .08);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--ink); background: var(--surface); }
h1, h2, h3, .brand-font { font-family: 'Playfair Display', Georgia, serif; }
.text-gold { color: var(--gold) !important; }
.text-navy { color: var(--navy) !important; }

/* ============ Buttons & forms ============ */
.btn { border-radius: .75rem; font-weight: 600; transition: transform .2s, box-shadow .2s, background-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  --bs-btn-bg: var(--blue); --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: #1e40af; --bs-btn-hover-border-color: #1e40af;
  --bs-btn-active-bg: #1e3a8a; --bs-btn-active-border-color: #1e3a8a;
  box-shadow: 0 6px 16px rgba(29, 78, 216, .25);
}
.btn-gold {
  --bs-btn-color: #1b2437; --bs-btn-bg: var(--gold); --bs-btn-border-color: var(--gold);
  --bs-btn-hover-color: #1b2437; --bs-btn-hover-bg: #ffc61f; --bs-btn-hover-border-color: #ffc61f;
  --bs-btn-active-color: #1b2437; --bs-btn-active-bg: #e0a300; --bs-btn-active-border-color: #e0a300;
  box-shadow: 0 6px 16px rgba(245, 179, 1, .3);
}
.form-control, .form-select { border-radius: .75rem; padding: .7rem .95rem; border-color: #d9e0ec; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .25rem rgba(29, 78, 216, .15); }
.form-label { font-weight: 600; font-size: .9rem; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: .25rem .4rem; }

/* ============ Navbar ============ */
.site-nav {
  background: rgba(11, 31, 58, .94); backdrop-filter: blur(10px);
  padding: .9rem 0; transition: padding .3s, box-shadow .3s; z-index: 1030;
}
.site-nav.scrolled { padding: .45rem 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); }
.site-nav .navbar-brand { color: #fff; font-weight: 700; display: flex; align-items: center; gap: .6rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: .7rem; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), #ffd85c); color: var(--navy); font-size: 1.2rem;
}
.site-nav .nav-link { color: rgba(255, 255, 255, .8); font-weight: 500; position: relative; }
.site-nav .nav-link::after {
  content: ""; position: absolute; left: .5rem; right: .5rem; bottom: 2px; height: 2px;
  background: var(--gold); transform: scaleX(0); transition: transform .25s;
}
.site-nav .nav-link:hover { color: #fff; }
.site-nav .nav-link:hover::after { transform: scaleX(1); }

/* ============ Shapes & keyframes ============ */
.shape { position: absolute; border-radius: 50%; opacity: .14; background: var(--gold); animation: floatY 9s ease-in-out infinite; pointer-events: none; }
.shape.s1 { width: 280px; height: 280px; top: -80px; right: -60px; }
.shape.s2 { width: 160px; height: 160px; bottom: 40px; left: -40px; background: #fff; animation-delay: -3s; }
.shape.s3 { width: 90px; height: 90px; top: 42%; left: 46%; animation-delay: -6s; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.float-y { animation: floatY 7s ease-in-out infinite; }

/* ============ Landing ============ */
.hero {
  position: relative; overflow: hidden; color: #fff; padding: 6rem 0 5.5rem;
  background: linear-gradient(120deg, var(--navy), var(--navy-2), var(--blue));
  background-size: 200% 200%; animation: gradientShift 14s ease infinite;
}
.badge-pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .95rem;
  border-radius: 99px; background: rgba(255, 255, 255, .12); font-size: .85rem;
}
.glass-card {
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(14px); border-radius: 1.25rem; padding: 1.6rem;
}
.glass-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.glass-row:last-child { border-bottom: 0; }
.glass-row i { color: var(--gold); font-size: 1.3rem; }

.section { padding: 5rem 0; }
.section-title { font-weight: 700; color: var(--navy); }
.section-sub { color: var(--muted); max-width: 640px; margin-inline: auto; }

.stat-box { text-align: center; padding: 1rem; }
.stat-number { font-family: 'Playfair Display', serif; font-size: 2.8rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { color: var(--muted); font-weight: 500; margin-top: .4rem; }

.feature-card {
  background: #fff; border: 0; border-radius: var(--radius); padding: 1.75rem; height: 100%;
  box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: 0 18px 40px rgba(11, 31, 58, .14); }
.icon-bubble {
  width: 56px; height: 56px; border-radius: 1rem; display: grid; place-items: center; font-size: 1.5rem;
  color: #fff; background: linear-gradient(135deg, var(--blue), #60a5fa); margin-bottom: 1rem; transition: transform .3s;
}
.feature-card:hover .icon-bubble { transform: rotate(-8deg) scale(1.1); }

.step-number {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 52px;
  background: var(--gold); color: var(--navy); font-weight: 700; font-size: 1.2rem; box-shadow: 0 6px 16px rgba(245, 179, 1, .35);
}

.cta-band {
  position: relative; overflow: hidden; color: #fff; border-radius: 1.5rem; padding: 3.5rem 2rem;
  background: linear-gradient(120deg, var(--navy), var(--blue)); text-align: center;
}

.site-footer { background: var(--navy); color: rgba(255, 255, 255, .7); padding: 3rem 0 1.5rem; }
.site-footer a { color: rgba(255, 255, 255, .7); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }

/* ============ Auth pages ============ */
.auth-wrapper { min-height: calc(100vh - 70px); display: grid; }
.auth-aside {
  position: relative; overflow: hidden; color: #fff; padding: 4rem; display: none;
  background: linear-gradient(130deg, var(--navy), var(--navy-2), var(--blue)); background-size: 200% 200%;
  animation: gradientShift 14s ease infinite;
}
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 450px; border: 0; border-radius: 1.25rem; box-shadow: var(--shadow); animation: slideUp .6s ease both; }
@media (min-width: 992px) {
  .auth-wrapper { grid-template-columns: 1.1fr 1fr; }
  .auth-aside { display: flex; flex-direction: column; justify-content: center; }
}

/* ============ App shell (dashboard) ============ */
.app-shell { display: flex; min-height: calc(100vh - 70px); }
.app-sidebar { --bs-offcanvas-width: 280px; background: #fff; border-right: 1px solid #e5e9f2; }
.app-main { flex: 1; min-width: 0; padding: 1.5rem; }
@media (min-width: 992px) { .app-sidebar { width: 260px; flex: 0 0 260px; } .app-main { padding: 2rem; } }
.side-label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1.2rem .75rem .4rem; }
.side-link {
  display: flex; align-items: center; gap: .7rem; padding: .65rem .85rem; border-radius: .75rem;
  color: var(--ink); text-decoration: none; font-weight: 500; transition: background .2s, transform .2s;
}
.side-link:hover { background: var(--surface); transform: translateX(3px); }
.side-link.active { background: rgba(29, 78, 216, .1); color: var(--blue); }
.side-link .badge { margin-left: auto; font-size: .62rem; }
.quick-card { background: #fff; border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); height: 100%; transition: transform .25s, box-shadow .25s; color: inherit; text-decoration: none; display: block; }
.quick-card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(11, 31, 58, .13); color: inherit; }
.welcome-banner { border-radius: 1.25rem; padding: 1.75rem; color: #fff; background: linear-gradient(120deg, var(--navy), var(--blue)); }

/* ============ Toasts & back-to-top ============ */
.toast-stack { position: fixed; top: 84px; right: 1rem; z-index: 1100; display: flex; flex-direction: column; gap: .6rem; max-width: calc(100vw - 2rem); }
.back-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--gold); color: var(--navy); font-size: 1.2rem; box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: .3s; z-index: 1000;
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }

/* ============ Accessibility ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* ============ Members ============ */
.avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  display: inline-grid; place-items: center; font-weight: 700; font-size: 1.5rem; color: #fff;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
}
.avatar-sm { width: 40px; height: 40px; font-size: 1rem; }
.avatar-lg { width: 110px; height: 110px; font-size: 2.2rem; }
.member-card { background: #fff; border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); height: 100%; text-align: center; transition: transform .25s, box-shadow .25s; }
.member-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(11, 31, 58, .13); }
.section-card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.detail-list dt { color: var(--muted); font-weight: 500; font-size: .85rem; }
.detail-list dd { margin-bottom: .9rem; }

/* ============ Payments ============ */
.price-tag { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; color: var(--navy); }
.receipt { border: 2px dashed #cfd8e8 !important; }
.receipt-total { background: var(--surface); border-radius: .75rem; padding: 1rem 1.25rem; }
@media print {
  .site-nav, .toast-stack, .back-top, .no-print, .site-footer { display: none !important; }
  body { background: #fff !important; }
  .receipt { border: 1px solid #999 !important; box-shadow: none !important; }
}

/* ============ Biometrics ============ */
.face-stage { position: relative; width: 100%; max-width: 420px; aspect-ratio: 4 / 3; border-radius: 1.25rem; overflow: hidden; background: var(--navy); box-shadow: var(--shadow); }
.face-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-oval { position: absolute; inset: 10% 27%; border: 3px solid rgba(245, 179, 1, .95); border-radius: 50%; box-shadow: 0 0 0 999px rgba(11, 31, 58, .5); animation: pulseRing 2s ease-in-out infinite; }
.scan-line { position: absolute; left: 27%; right: 27%; height: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: scanMove 2.4s ease-in-out infinite; }
@keyframes pulseRing { 0%, 100% { border-color: rgba(245, 179, 1, .95); } 50% { border-color: rgba(255, 255, 255, .7); } }
@keyframes scanMove { 0%, 100% { top: 14%; } 50% { top: 84%; } }
.bio-option { text-align: center; padding: 2rem 1.5rem; }
.bio-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 2.2rem; color: #fff; background: linear-gradient(135deg, var(--blue), #60a5fa); animation: floatY 5s ease-in-out infinite; }
.device-row { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border: 1px solid #e5e9f2; border-radius: .9rem; margin-bottom: .6rem; background: #fff; }

/* ============ Elections ============ */
.countdown { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; letter-spacing: .02em; }
.vote-option { display: flex; align-items: center; gap: .8rem; width: 100%; height: 100%; padding: .9rem 1rem; background: #fff; border: 2px solid #e1e7f2; border-radius: 1rem; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; }
.vote-option:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.vote-option .tick { margin-left: auto; font-size: 1.4rem; color: var(--blue); opacity: 0; transform: scale(.4); transition: .2s; }
.btn-check:checked + .vote-option { border-color: var(--blue); background: rgba(29, 78, 216, .06); box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .12); }
.btn-check:checked + .vote-option .tick { opacity: 1; transform: none; }
.btn-check:focus-visible + .vote-option { outline: 3px solid var(--gold); }
.receipt-code { font-family: ui-monospace, 'Courier New', monospace; font-size: clamp(1.1rem, 4vw, 1.7rem); font-weight: 700; letter-spacing: .12em; padding: 1rem 1.25rem; border: 2px dashed var(--gold); border-radius: 1rem; background: #fffbea; word-break: break-all; }
.result-bar { height: 14px; background: #e9eef7; border-radius: 99px; overflow: hidden; }
.result-fill { width: var(--w); height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), #60a5fa); animation: growBar 1.2s ease-out both; }
.result-fill.winner { background: linear-gradient(90deg, #d99a00, var(--gold)); }
.result-fill.muted { background: #b8c2d6; }
@keyframes growBar { from { width: 0; } }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #dc3545; animation: pulseDot 1.4s infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, .6); } 100% { box-shadow: 0 0 0 12px rgba(220, 53, 69, 0); } }

/* ============ Dashboards ============ */
.stat-card { display: flex; align-items: center; gap: 1rem; background: #fff; border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); height: 100%; color: inherit; text-decoration: none; transition: transform .25s, box-shadow .25s; }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(11, 31, 58, .13); color: inherit; }
.stat-card .icon-bubble { margin: 0; flex: 0 0 56px; }
.stat-value { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: var(--navy); }
.stat-title { color: var(--muted); font-size: .85rem; }
.chart-box { position: relative; height: 270px; }
.activity-item { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid #edf0f6; font-size: .88rem; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: .4rem; flex: 0 0 10px; }
.todo-item { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: .9rem; background: #fff7e0; text-decoration: none; color: var(--ink); margin-bottom: .6rem; transition: transform .2s; }
.todo-item:hover { transform: translateX(4px); color: var(--ink); }
.health-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.health-dot.ok { background: #198754; } .health-dot.warn { background: #f5b301; } .health-dot.bad { background: #dc3545; }