/* ============================================================
   VotePro — Professional Voting System
   Design: Deep Navy + Electric Indigo + Clean White
   Mobile-first, WCAG 2.1 AA compliant
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@700;800&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  /* Core palette */
  --navy:       #0A0F1E;
  --navy-2:     #111827;
  --navy-3:     #1F2937;
  --indigo:     #4F46E5;
  --indigo-h:   #4338CA;
  --indigo-lt:  #EEF2FF;
  --indigo-glow:rgba(79,70,229,.18);
  --violet:     #7C3AED;
  --pink:       #EC4899;
  --teal:       #0D9488;
  --amber:      #D97706;
  --amber-lt:   #FEF3C7;

  /* Surfaces */
  --bg:         #F8FAFC;
  --surface:    #FFFFFF;
  --surface-2:  #F1F5F9;
  --border:     #E2E8F0;
  --border-h:   #CBD5E1;

  /* Text */
  --text:       #0F172A;
  --text-2:     #475569;
  --text-3:     #94A3B8;
  --text-inv:   #FFFFFF;

  /* Status */
  --ok:         #059669;
  --ok-bg:      #ECFDF5;
  --err:        #DC2626;
  --err-bg:     #FEF2F2;
  --warn:       #D97706;
  --warn-bg:    #FFFBEB;

  /* Shape */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --shadow-indigo: 0 8px 30px rgba(79,70,229,.25);

  /* Transition */
  --ease:   cubic-bezier(.4,0,.2,1);
  --dur:    .18s;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--indigo);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--indigo-h); }

img { max-width: 100%; display: block; }

/* ── Layout ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.main {
  padding: 28px 16px 80px;
  min-height: calc(100vh - 64px - 64px);
}

/* ── Header / Nav ──────────────────────────────────────── */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 64px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  text-decoration: none;
}
.brand:hover { color: #fff; }

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79,70,229,.5);
}

.brand-icon svg { width: 18px; height: 18px; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: none;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-full);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }

.nav-user {
  display: none;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  padding: 0 8px;
  white-space: nowrap;
}
.nav-user strong { color: rgba(255,255,255,.85); }

@media (min-width: 640px) {
  .nav-link { display: inline-flex; }
  .nav-user { display: inline; }
  .container { padding: 0 24px; }
  .nav { padding: 0 24px; }
  .main { padding: 36px 24px 80px; }
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 9px 18px;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.btn-primary:hover {
  background: var(--indigo-h);
  border-color: var(--indigo-h);
  box-shadow: var(--shadow-indigo);
  transform: translateY(-1px);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,.75);
  border-color: rgba(255,255,255,.15);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.25);
}

.btn-outline {
  background: transparent;
  color: var(--indigo);
  border-color: var(--border-h);
}
.btn-outline:hover {
  background: var(--indigo-lt);
  border-color: var(--indigo);
}

.btn-danger {
  background: transparent;
  color: var(--err);
  border-color: var(--border);
}
.btn-danger:hover {
  background: var(--err-bg);
  border-color: var(--err);
}

.btn-lg {
  font-size: 16px;
  padding: 13px 28px;
}

.btn-sm {
  font-size: 13px;
  padding: 7px 14px;
}

.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: var(--r-md);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-narrow {
  max-width: 440px;
  margin: 28px auto;
}

@media (min-width: 640px) {
  .card { padding: 32px; }
}

/* ── Flash & Alerts ────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #EDE9FE, #E0E7FF);
  color: #3730A3;
  border: 1px solid #C7D2FE;
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid #FECACA;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}

.success {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #A7F3D0;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
}

/* ── Hero Section ──────────────────────────────────────── */
.hero {
  padding: 40px 0 32px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--indigo-lt);
  color: var(--indigo);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--r-full);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 7vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 16px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--indigo), var(--violet), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--text-2);
  font-size: clamp(15px, 2.5vw, 17px);
  max-width: 520px;
  margin-bottom: 28px;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.hero-stat-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--indigo);
  line-height: 1;
}

.hero-stat-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Section Headers ───────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Poll List (index / dashboard) ─────────────────────── */
.poll-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.poll-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
  position: relative;
}

.poll-card:hover {
  border-color: var(--border-h);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.poll-card-rank {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--indigo);
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.poll-card-body { flex: 1; min-width: 0; }

.poll-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: block;
  margin-bottom: 6px;
}
.poll-card-title:hover { color: var(--indigo); }

.poll-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.poll-card-actions { flex-shrink: 0; display: flex; gap: 8px; align-items: center; }

/* ── Badges & Chips ────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-full);
  line-height: 1.5;
}

.chip-default  { background: var(--surface-2); color: var(--text-2); }
.chip-indigo   { background: var(--indigo-lt); color: var(--indigo); }
.chip-red      { background: var(--err-bg); color: var(--err); }
.chip-amber    { background: var(--amber-lt); color: var(--amber); }
.chip-green    { background: var(--ok-bg); color: var(--ok); }

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Forms ─────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 18px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}

.form-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.form-control {
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  outline: none;
  width: 100%;
  line-height: 1.5;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-glow);
}
.form-control::placeholder { color: var(--text-3); }
.form-control:disabled {
  background: var(--surface-2);
  color: var(--text-3);
  cursor: not-allowed;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Character counter */
.form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.char-count { font-size: 12px; color: var(--text-3); }
.char-count.warn { color: var(--warn); }

/* ── Auth Pages ────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(79,70,229,.35);
}

.auth-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 24px;
}

.auth-divider {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  margin: 20px 0;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  background: var(--surface);
  padding: 0 12px;
  position: relative;
}

/* ── Vote Page (vp-*) ─────────────────────────────────── */
.vp-wrap {
  max-width: 560px;
  margin: 0 auto 48px;
}

/* Cover */
.vp-cover {
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  overflow: hidden;
  background: var(--navy);
}
.vp-cover img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}
.vp-cover .yt-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}
.vp-cover .yt-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* Poll header */
.vp-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  padding: 22px 20px 18px;
}
.vp-wrap > .vp-header:first-child {
  border-top: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.vp-cover + .vp-header { border-top: none; }

.vp-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.vp-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.vp-author::before { content: '@'; }

.vp-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 10px;
}

.vp-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
}

.vp-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
}
.vp-notice--ok  { background: var(--ok-bg);  color: var(--ok);  border: 1px solid #A7F3D0; }
.vp-notice--err { background: var(--err-bg); color: var(--err); border: 1px solid #FECACA; }

/* Counter bar */
.vp-counter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--navy);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.vp-counter-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.vp-counter-label {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  font-weight: 500;
}

.vp-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4ADE80;
  font-weight: 700;
  margin-left: auto;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.vp-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%,100% { opacity:1; transform:scale(1); box-shadow: 0 0 0 0 rgba(74,222,128,.5); }
  50% { opacity:.5; transform:scale(1.3); box-shadow: 0 0 0 4px rgba(74,222,128,0); }
}

/* Vote form */
.vp-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vp-form-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

/* Vote options */
[role="radiogroup"] {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vp-opt {
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vp-opt-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.vp-opt-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: all var(--dur) var(--ease);
}
.vp-opt:hover .vp-opt-box {
  border-color: var(--indigo);
  background: var(--indigo-lt);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--indigo-glow);
}
.vp-opt--selected .vp-opt-box {
  border-color: var(--indigo);
  background: var(--indigo-lt);
  box-shadow: 0 4px 16px var(--indigo-glow);
}

.vp-opt-num {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
  transition: all var(--dur) var(--ease);
}
.vp-opt--selected .vp-opt-num,
.vp-opt:hover .vp-opt-num {
  background: var(--indigo);
  color: #fff;
}

.vp-opt-text {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.vp-opt-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
  color: transparent;
  font-size: 11px;
}
.vp-opt--selected .vp-opt-check {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}

/* Submit button */
.vp-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: var(--surface-2);
  color: var(--text-3);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: not-allowed;
  transition: all var(--dur) var(--ease);
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.vp-submit--ready {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--indigo-glow);
}
.vp-submit--ready:hover {
  background: var(--indigo-h);
  transform: translateY(-2px);
  box-shadow: var(--shadow-indigo);
}
.vp-submit--ready:active { transform: translateY(0); }
.vp-submit--loading { opacity: .7; pointer-events: none; }

/* Results */
.vp-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vp-results-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.vp-res-row {
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease);
}
.vp-res-row--top {
  border-color: #FCD34D;
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7 80%);
}
.vp-res-row--mine {
  border-color: var(--indigo);
  background: var(--indigo-lt);
}

.vp-res-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.vp-crown { font-size: 18px; }

.vp-my-vote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  background: var(--indigo);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.vp-res-text {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.vp-res-num {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.vp-res-unit { font-size: 12px; color: var(--text-3); font-weight: 400; }

.vp-bar-wrap { display: flex; align-items: center; gap: 10px; }
.vp-bar { flex: 1; height: 7px; background: rgba(0,0,0,.06); border-radius: 99px; overflow: hidden; }
.vp-bar-fill {
  height: 100%;
  background: var(--border-h);
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.vp-res-row--top .vp-bar-fill {
  background: linear-gradient(90deg, var(--amber), #FBBF24);
}
.vp-bar-fill--mine { background: var(--indigo) !important; }
.vp-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  min-width: 42px;
  text-align: right;
}
.vp-res-row--top .vp-pct { color: var(--amber); }
.vp-res-row--mine .vp-pct { color: var(--indigo); }

/* Notes */
.vp-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── Share Section ─────────────────────────────────────── */
.vp-share {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header row */
.vp-share-header {
  display: flex;
  align-items: center;
  gap: 7px;
}
.vp-share-icon {
  color: var(--indigo);
  flex-shrink: 0;
}
.vp-share-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* Social share buttons — pill row */
.vp-share-socials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.vp-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 10px;
  border-radius: var(--r-md);
  font: 600 12.5px 'Inter', sans-serif;
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.vp-social-btn:active { opacity: .82; transform: scale(.97); }
@media (hover: hover) { .vp-social-btn:hover { opacity: .88; transform: translateY(-1px); } }

.vp-social-wa { background: #25D366; }
.vp-social-tg { background: #229ED9; }
.vp-social-x  { background: #0F1419; }

/* URL copy row */
.vp-share-url-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.vp-url-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}
.vp-url-icon {
  position: absolute;
  left: 11px;
  color: var(--text-3);
  flex-shrink: 0;
  pointer-events: none;
}
.vp-share-input {
  width: 100%;
  font: 13px/1 'Inter', sans-serif;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 12px 11px 32px;
  outline: none;
  min-width: 0;
  cursor: text;
  transition: border-color .15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vp-share-input:focus { border-color: var(--indigo); }

.vp-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  background: var(--indigo);
  color: #fff;
  border: none;
  font: 600 13px 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, transform .15s ease;
  flex-shrink: 0;
}
.vp-copy-btn:active { transform: scale(.97); }
@media (hover: hover) { .vp-copy-btn:hover { background: var(--indigo-h); transform: translateY(-1px); } }
.vp-copy-btn--ok { background: var(--ok) !important; }

/* QR section */
.vp-qr {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.vp-qr-inner {
  flex-shrink: 0;
  background: #fff;
  border-radius: var(--r-sm);
  padding: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.vp-qr-inner img { display: block; border-radius: 4px; }
.vp-qr-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vp-qr-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.vp-qr-sub {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}
.vp-qr-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font: 600 12px 'Inter', sans-serif;
  color: var(--text-2);
  text-decoration: none;
  width: fit-content;
  transition: border-color .15s ease, color .15s ease;
}
@media (hover: hover) { .vp-qr-download:hover { border-color: var(--indigo); color: var(--indigo); } }

/* Legacy classes kept for backward compat */
.vp-share-btns { display: none; }
.vp-qr-label { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* Whole-card top rounding when no cover */
.vp-wrap > .vp-header:first-child,
.vp-wrap > .vp-counter:first-child {
  border-top: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

/* ── Create Poll Page ──────────────────────────────────── */
.create-wrap { max-width: 640px; margin: 0 auto; }

.page-header { margin-bottom: 24px; }
.page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.page-subtitle { font-size: 14px; color: var(--text-2); }

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cover type tabs */
.cover-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cover-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font: 600 13px 'Inter', sans-serif;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.cover-tab-btn:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-lt); }
.cover-tab-btn.active { background: var(--indigo-lt); border-color: var(--indigo); color: var(--indigo); }

.cover-field { display: none; }
.cover-field.active { display: block; }

.cover-preview {
  margin-top: 12px;
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: 400px;
  border: 1px solid var(--border);
}
.cover-preview img { width: 100%; display: block; object-fit: cover; }

/* Options builder */
.options-list { display: flex; flex-direction: column; gap: 8px; }

.option-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.option-handle {
  width: 32px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  cursor: grab;
  font-size: 16px;
  flex-shrink: 0;
}

.option-num {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--indigo-lt);
  color: var(--indigo);
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.option-input {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.option-input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-glow);
}

.add-option-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px dashed var(--border-h);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font: 600 13px 'Inter', sans-serif;
  color: var(--text-2);
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: all var(--dur) var(--ease);
  margin-top: 4px;
}
.add-option-btn:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-lt); }
.add-option-btn:disabled { opacity: .4; cursor: not-allowed; }

.remove-opt-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--dur) var(--ease);
  font-size: 16px;
  line-height: 1;
}
.remove-opt-btn:hover { border-color: var(--err); color: var(--err); background: var(--err-bg); }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 8px;
}

/* ── Dashboard ─────────────────────────────────────────── */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--indigo);
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--text-2); max-width: 320px; margin: 0 auto 24px; }

/* ── Trending ───────────────────────────────────────────── */
.trending-hero {
  text-align: center;
  padding: 36px 0 28px;
}
.trending-icon { font-size: 48px; margin-bottom: 12px; }

/* ── Rank indicator ────────────────────────────────────── */
.rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.rank-1 { background: #FEF3C7; color: #92400E; }
.rank-2 { background: #F1F5F9; color: #475569; }
.rank-3 { background: #FFF7ED; color: #9A3412; }
.rank-n { background: var(--surface-2); color: var(--text-3); }

/* ── Poll cover on vote page ───────────────────────────── */
.poll-cover { }
.poll-cover-image img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.poll-cover-youtube .yt-wrapper {
  position: relative; padding-bottom: 56.25%; height: 0; background: #000;
}
.poll-cover-youtube .yt-wrapper iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
}
.footer-tagline {
  font-size: 12px;
  color: rgba(255,255,255,.3);
}
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(79,70,229,.2);
  color: #A5B4FC;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-full);
  letter-spacing: .04em;
}

/* ── Skeleton loader (optional) ─────────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (min-width: 640px) {
  .vp-share-btns { grid-template-columns: repeat(4, 1fr); }
  .vp-qr { flex-direction: row; justify-content: center; }
  .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 420px) {
  .vp-header, .vp-form, .vp-results, .vp-share, .vp-note { padding: 16px; }
  .vp-counter { padding: 12px 16px; }
  .card { padding: 20px; }
  .auth-card { padding: 24px 20px; }
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fade-in-up .35s var(--ease) both; }

/* ── Utilities ──────────────────────────────────────────── */
.text-muted { color: var(--text-3); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 12px; }
.font-bold  { font-weight: 700; }
.mt-auto    { margin-top: auto; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* File input */
input[type="file"].form-control {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}

/* Datetime local */
input[type="datetime-local"].form-control {
  appearance: none;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Google OAuth Button
   ============================================================ */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  margin-bottom: 16px;
}
.btn-google:hover {
  border-color: #4285F4;
  box-shadow: 0 0 0 3px rgba(66,133,244,.12);
}
.btn-google-vote {
  margin-top: 12px;
}

/* Login prompt di halaman vote */
.vp-login-prompt {
  text-align: center;
  padding: 28px 20px;
  background: var(--surface-2, #F8F8FB);
  border-radius: 16px;
  border: 1.5px dashed #D1D5DB;
  margin: 8px 0;
}
.vp-login-icon { font-size: 32px; margin-bottom: 10px; }
.vp-login-text { font-size: 16px; font-weight: 600; color: var(--text-1, #111); margin-bottom: 4px; }
.vp-login-sub  { font-size: 13px; color: var(--text-3, #9CA3AF); margin-bottom: 16px; }

/* Creator avatar di halaman vote */
.vp-creator-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 4px;
  vertical-align: middle;
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-3, #9CA3AF);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #E5E7EB);
}

/* ============================================================
   Edit Page
   ============================================================ */
.create-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 0 64px;
}
.page-header { margin-bottom: 28px; }
.page-title  { font-size: 24px; font-weight: 800; color: var(--text-1,#111); margin-bottom: 6px; }
.page-sub    { font-size: 14px; color: var(--text-2, #6B7280); }

.form-section {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3, #9CA3AF);
  margin-bottom: 16px;
}
.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.opt-drag    { color: #D1D5DB; cursor: grab; font-size: 16px; flex-shrink:0; }
.opt-remove  { background: none; border: 1px solid #E5E7EB; border-radius: 6px; width:30px; height:30px; cursor:pointer; color:#9CA3AF; font-size:13px; flex-shrink:0; transition: border-color .15s, color .15s; }
.opt-remove:hover { border-color: #EF4444; color: #EF4444; }
.opt-vote-badge { background: #D1FAE5; color: #065F46; border-radius: 6px; padding: 3px 8px; font-size: 12px; font-weight: 600; flex-shrink:0; white-space:nowrap; }

.cover-tabs  { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.cover-tab   { display:flex; align-items:center; gap:6px; padding:8px 14px; border:1.5px solid var(--border,#E5E7EB); border-radius:8px; cursor:pointer; font-size:14px; font-weight:500; transition: border-color .15s; }
.cover-tab input { display:none; }
.cover-tab.active { border-color: var(--accent,#0A0F1E); background: var(--accent,#0A0F1E); color:#fff; }

/* Danger Zone */
.danger-zone {
  margin-top: 40px;
  border: 1.5px solid #FCA5A5;
  border-radius: 16px;
  padding: 24px;
  background: #FFF5F5;
}
.danger-zone-title { font-size: 15px; font-weight: 700; color: #B91C1C; margin-bottom: 8px; }
.btn-danger {
  background: #EF4444;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: #DC2626; }

/* My badge pada hasil vote */
.vp-my-badge {
  display: inline-block;
  background: #D1FAE5;
  color: #065F46;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  margin-left: 6px;
  vertical-align: middle;
}
