/* ============================================================
   SIMULASI E-VOTING PILKADES DARMAGA
   Master Stylesheet - Fullscreen • Landscape • Mobile First
   ============================================================ */

:root {
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-light: #ccfbf1;
  --primary-dark: #042f2e;

  --secondary: #0284c7;
  --secondary-hover: #0369a1;
  --secondary-light: #e0f2fe;

  --accent-gold: #f59e0b;
  --accent-gold-light: #fef3c7;

  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;

  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;

  --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.15);

  --btn-height: 56px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--slate-900);
  color: var(--slate-800);
  font-family: var(--font-main);
  overflow: hidden;
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}

/* Base App Container - Strict 100dvh landscape single-screen */
#app-root {
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 10%, #1e293b 0%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

/* ============================================================
   ORIENTATION OVERLAY (Shown in Portrait Mode)
   ============================================================ */
#orientation-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #090d16;
  color: #ffffff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

@media screen and (orientation: portrait) {
  #orientation-overlay {
    display: flex !important;
  }
}

.orient-icon-box {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.2);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: rotatePhone 2.5s infinite ease-in-out;
}

.orient-icon-box svg {
  width: 48px;
  height: 48px;
  fill: var(--accent-gold);
}

@keyframes rotatePhone {
  0% { transform: rotate(0deg); }
  35% { transform: rotate(-90deg); }
  65% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

.orient-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 12px;
  color: var(--accent-gold);
}

.orient-desc {
  font-size: 15px;
  color: var(--slate-300);
  line-height: 1.5;
  max-width: 320px;
}

/* ============================================================
   TOP BAR & STEP PROGRESS
   ============================================================ */
.app-header {
  height: 52px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.header-brand img {
  width: 34px;
  height: 34px;
}

.header-title-box {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.header-subtitle {
  font-size: 10px;
  color: var(--slate-400);
  letter-spacing: 0.2px;
}

/* Compact Step Progress */
.stage-progress {
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--slate-500);
  font-size: 10.5px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--slate-700);
  transition: all 0.3s ease;
}

.progress-line {
  width: 14px;
  height: 2px;
  background: var(--slate-700);
  border-radius: 2px;
}

.progress-step.completed {
  color: var(--primary-light);
}
.progress-step.completed .progress-dot {
  background: var(--primary);
  box-shadow: 0 0 8px rgba(15, 118, 110, 0.6);
}
.progress-step.completed + .progress-line {
  background: var(--primary);
}

.progress-step.active {
  color: #ffffff;
}
.progress-step.active .progress-dot {
  background: var(--accent-gold);
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}

/* Top Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-top {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-top:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.95);
}

.badge-simulasi-top {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--accent-gold);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
}

/* ============================================================
   MAIN CONTENT VIEWPORT (100dvh Single Screen)
   ============================================================ */
.app-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.screen-view {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: scale(0.98);
}

.screen-view.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Universal Screen Container (Strict No-Scroll 2-Column Landscape Layout) */
.screen-container {
  width: 100%;
  height: 100%;
  display: flex;
  padding: 14px 24px;
  gap: 20px;
  align-items: center;
}

.screen-visual {
  flex: 1.1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.screen-content {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

/* Screen Typography */
.screen-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 118, 110, 0.2);
  border: 1px solid rgba(15, 118, 110, 0.5);
  color: var(--primary-light);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 20px;
  width: fit-content;
  letter-spacing: 0.8px;
}

.screen-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.screen-desc {
  font-size: 14.5px;
  color: var(--slate-300);
  line-height: 1.45;
}

/* Big Action Buttons (Senior / Lansia Friendly) */
.btn-primary-action {
  height: var(--btn-height);
  min-height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  transition: all 0.2s ease;
  touch-action: manipulation;
  width: fit-content;
  min-width: 200px;
}

.btn-primary-action:hover, .btn-primary-action:active {
  background: linear-gradient(135deg, #115e59 0%, #0f766e 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.6);
}

.btn-secondary-action {
  height: var(--btn-height);
  min-height: 52px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  transition: all 0.2s ease;
}

.btn-secondary-action:active {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

/* ============================================================
   SCREEN 0: SPLASH / HOME
   ============================================================ */
.splash-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  position: relative;
}

.splash-logo-box {
  width: 100px;
  height: 100px;
  margin-bottom: 12px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
}

.splash-logo-box:active {
  transform: scale(0.95);
}

.splash-logo-box img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}

.splash-title {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.splash-sub {
  font-size: 14px;
  color: var(--secondary-light);
  font-weight: 600;
  margin-bottom: 6px;
}

.splash-tagline {
  font-size: 13px;
  font-style: italic;
  color: var(--accent-gold);
  margin-bottom: 22px;
}

.btn-start-simulation {
  height: 64px;
  min-width: 260px;
  border-radius: 32px;
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 1px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.5), 0 0 20px rgba(2, 132, 199, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 36px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulseGlow 2.5s infinite;
}

.btn-start-simulation:active {
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.7);
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(13, 148, 136, 0.5), 0 0 20px rgba(2, 132, 199, 0.3); }
  50% { box-shadow: 0 10px 30px rgba(13, 148, 136, 0.8), 0 0 35px rgba(2, 132, 199, 0.6); }
}

.splash-watermark {
  margin-top: 18px;
  font-size: 11px;
  color: var(--slate-400);
  letter-spacing: 1px;
  font-weight: 700;
}

/* ============================================================
   SCREEN 1: TPS ILLUSION / VISUALS
   ============================================================ */
.tps-card-art {
  width: 100%;
  max-width: 380px;
  height: 220px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.tps-card-art svg {
  width: 100%;
  height: 100%;
}

/* ============================================================
   SCREEN 2: VERIFIKASI & ANIMASI
   ============================================================ */
.voter-card-sim {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-xl);
  border-left: 6px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 320px;
}

.voter-card-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}

.voter-card-code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 900;
  color: var(--slate-900);
  letter-spacing: 1.5px;
}

.voter-card-status {
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 6px;
}

.voter-card-status.unverified {
  background: var(--warning-light);
  color: var(--warning);
}

.voter-card-status.verified {
  background: var(--success-light);
  color: var(--success);
}

/* Verification Live Checklist Animation */
.verify-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.verify-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--slate-300);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.3;
  transform: translateX(-10px);
  transition: all 0.4s ease;
}

.verify-item.checked {
  opacity: 1;
  transform: translateX(0);
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.4);
  color: #ffffff;
}

.verify-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slate-700);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.verify-item.checked .verify-check-icon {
  background: var(--success);
}

/* ============================================================
   SCREEN 4: BARCODE SIMULASI & SCANNER
   ============================================================ */
.barcode-box-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.barcode-card-touch {
  width: 280px;
  height: 150px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 3px solid #e2e8f0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.barcode-card-touch:active {
  transform: scale(0.96);
  border-color: var(--primary);
}

.barcode-laser-line {
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 4px;
  background: #22d3ee;
  box-shadow: 0 0 15px #06b6d4, 0 0 30px #22d3ee;
  display: none;
  z-index: 10;
}

.barcode-card-touch.scanning .barcode-laser-line {
  display: block;
  animation: scanLaser 1s ease-in-out infinite;
}

@keyframes scanLaser {
  0% { top: 0%; opacity: 0.8; }
  50% { top: 96%; opacity: 1; }
  100% { top: 0%; opacity: 0.8; }
}

.barcode-card-touch.scanning {
  border-color: #06b6d4;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
}

.barcode-graphic {
  width: 100%;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.barcode-bar {
  background: #0f172a;
  height: 100%;
}

.barcode-code-text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 4px;
}

.barcode-touch-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-gold);
  animation: floatBounce 1.5s infinite ease-in-out;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ============================================================
   SCREEN 5: SURAT SUARA DIGITAL (BALLOT)
   ============================================================ */
.ballot-screen-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px 18px;
  position: relative;
}

.ballot-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.ballot-header-info h2 {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.ballot-header-info p {
  font-size: 12px;
  color: var(--slate-300);
}

.ballot-watermark-badge {
  font-size: 12px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* Candidates Grid (Equal Presentation, Horizontal Landscape Fit) */
.ballot-candidates-grid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
/* Candidates Grid (Proportional, Elegant, Landscape Fit) */
.ballot-candidates-grid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.ballot-candidates-grid::-webkit-scrollbar {
  display: none;
}

/* Candidate Card - Highly Proportional, User-Friendly & Senior Accessible */
.candidate-card-touch {
  flex: 1;
  max-width: 290px;
  min-width: 210px;
  height: 94%;
  max-height: 275px;
  background: #ffffff;
  border-radius: 16px;
  border: 3px solid #cbd5e1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.candidate-card-touch:hover, .candidate-card-touch:active {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

.candidate-card-touch.selected {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.35), 0 12px 30px rgba(16, 185, 129, 0.4);
  background: #f0fdf4;
}

/* Official Header Strip on Candidate Card */
.cand-card-header {
  width: 100%;
  height: 38px;
  background: linear-gradient(135deg, #0f766e 0%, #0e7490 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 1.5px;
  flex-shrink: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.candidate-card-touch.selected .cand-card-header {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
}

/* Large, Proportional Candidate Photo Frame */
.cand-photo-box {
  width: 100%;
  flex: 1;
  max-height: 145px;
  min-height: 100px;
  margin: 6px 10px 4px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  border: 1.5px solid #e2e8f0;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cand-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}

.candidate-card-touch:hover .cand-photo-box img {
  transform: scale(1.04);
}

/* Candidate Name */
.cand-name {
  font-size: 13.5px;
  font-weight: 900;
  color: #0f172a;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.25;
  padding: 4px 10px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

/* Tactile Select Button */
.cand-btn-select {
  width: calc(100% - 16px);
  height: 40px;
  margin: 0 8px 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.candidate-card-touch.selected .cand-btn-select {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-color: #15803d;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

/* Floating Selected Badge */
.cand-selected-ribbon {
  position: absolute;
  top: 44px;
  right: 10px;
  background: #16a34a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 6px;
  display: none;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.candidate-card-touch.selected .cand-selected-ribbon {
  display: flex;
  animation: popIn 0.25s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.ballot-bottom-bar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* ============================================================
   CONFIRMATION POP-UP MODAL (User-Friendly Overlay)
   ============================================================ */
.confirm-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-popup-backdrop.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-popup-card {
  width: 95%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 20px;
  border: 4px solid var(--primary);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: scaleUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #0f172a;
  position: relative;
}

@keyframes scaleUp {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-popup-header {
  font-size: 18px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.confirm-popup-sub {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 12px;
}

.confirm-popup-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 16px;
  width: 100%;
  margin-bottom: 14px;
}

.confirm-popup-photo {
  width: 90px;
  height: 105px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.confirm-popup-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.confirm-popup-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1;
}

.confirm-popup-num {
  display: inline-block;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.confirm-popup-name {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.3;
}

.confirm-popup-vision {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.3;
}

.confirm-popup-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-popup-cancel {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-popup-cancel:active {
  background: #e2e8f0;
}

.btn-popup-confirm {
  flex: 1.4;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border: none;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-popup-confirm:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.5);
}

/* ============================================================
   REALISTIC PRINTER & KOTAK SUARA SIMULATION
   ============================================================ */
.ballot-box-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 680px;
  height: 230px;
  position: relative;
}

/* Left: Digital Voting Machine with Thermal Printer */
.machine-printer-unit {
  width: 220px;
  height: 190px;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 3px solid #334155;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.machine-label {
  font-size: 10px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.machine-slot-box {
  width: 170px;
  height: 12px;
  background: #020617;
  border-radius: 6px;
  border: 1px solid #475569;
  position: relative;
}

/* Paper emerging from printer */
.printed-vvpat-paper {
  position: absolute;
  top: 6px;
  left: 15px;
  width: 140px;
  height: 0px;
  background: #fffdf5;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  font-family: var(--font-mono);
  font-size: 8px;
  color: #0f172a;
  padding: 0 8px;
  overflow: hidden;
  z-index: 20;
  transition: all 1.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.printed-vvpat-paper.slide-out {
  height: 120px;
}

/* Animation: Paper glides into ballot box */
.printed-vvpat-paper.drop-into-box {
  animation: glideIntoBox 2s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes glideIntoBox {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
  45% {
    transform: translate(140px, -40px) scale(0.9) rotate(8deg);
    opacity: 1;
  }
  75% {
    transform: translate(250px, 15px) scale(0.8) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(250px, 90px) scale(0.65) rotate(0deg);
    opacity: 0.15;
  }
}

/* Right: Official Pilkades Ballot Box (Kotak Suara) */
.official-ballot-box {
  width: 220px;
  height: 200px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 3px solid #0f766e;
  border-radius: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(15, 118, 110, 0.2);
}

.ballot-box-slot-top {
  width: 140px;
  height: 12px;
  background: #020617;
  border-radius: 6px;
  border: 2px solid #f59e0b;
  margin-bottom: 12px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
  position: relative;
}

.ballot-box-emblem {
  width: 60px;
  height: 60px;
  margin-top: 10px;
  opacity: 0.9;
}

.ballot-box-text {
  font-size: 11px;
  font-weight: 900;
  color: #fef08a;
  letter-spacing: 1px;
  text-align: center;
  margin-top: 6px;
}

.ballot-box-padlock {
  position: absolute;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 12px;
}

.printer-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.printer-led.active {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

/* ============================================================
   SCREEN 7: COMPLETE & CHECKLIST
   ============================================================ */
.complete-summary-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  width: 100%;
  max-width: 360px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.summary-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #e2e8f0;
  font-weight: 600;
}

.summary-check-item span {
  color: var(--success);
  font-weight: 900;
}

/* ============================================================
   ADMIN MODAL & DASHBOARD
   ============================================================ */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-modal-backdrop.active {
  display: flex;
}

.admin-card-dialog {
  width: 100%;
  max-width: 420px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xl);
  color: #ffffff;
}

.admin-dashboard-container {
  width: 95%;
  height: 92%;
  max-width: 1100px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #ffffff;
}

.admin-top-nav {
  height: 52px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.admin-tabs-list {
  display: flex;
  gap: 6px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: var(--slate-400);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab-btn.active, .admin-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-main-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  user-select: text;
  -webkit-user-select: text;
}

/* Admin Form Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-300);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  user-select: text;
  -webkit-user-select: text;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
}

/* Admin Stat Cards */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-stat-val {
  font-size: 24px;
  font-weight: 900;
  color: #22d3ee;
}

.admin-stat-lbl {
  font-size: 11.5px;
  color: var(--slate-400);
  font-weight: 600;
}

/* Candidate Preview in Admin */
.candidate-crud-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ============================================================
   RESPONSIVE DESIGN (Smartphone Landscape & Tablet Focus)
   ============================================================ */
@media screen and (max-height: 480px) {
  .app-header {
    height: 44px;
  }
  .screen-container {
    padding: 8px 16px;
    gap: 14px;
  }
  .screen-title {
    font-size: 20px;
  }
  .screen-desc {
    font-size: 13px;
  }
  .btn-primary-action, .btn-secondary-action {
    height: 48px;
    min-height: 44px;
    font-size: 14px;
  }
  .tps-card-art {
    height: 180px;
  }
  .splash-logo-box {
    width: 75px;
    height: 75px;
  }
  .splash-title {
    font-size: 22px;
  }
  .btn-start-simulation {
    height: 52px;
    font-size: 16px;
  }
  .candidate-card-touch {
    max-height: 195px;
  }
  .cand-photo-box {
    width: 70px;
    height: 70px;
  }
}

/* ============================================================
   PRINT STYLESHEET (Clean receipt print for window.print())
   ============================================================ */
@media print {
  body * {
    visibility: hidden;
  }
  #print-receipt-section, #print-receipt-section * {
    visibility: visible;
  }
  #print-receipt-section {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    margin: 0 auto;
    padding: 10px;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: monospace;
    font-size: 12pt;
  }
}
