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

:root {
  --primary: #991b1b;
  --primary-hover: #7f1d1d;
  --primary-light: #fef2f2;
  --primary-border: #fecaca;
  --background: #fdfbfb;
  --surface: #ffffff;
  --text-primary: #111827;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}
@media (min-width: 768px) { .container { padding: 24px; } }
@media (min-width: 1024px) { .container { padding: 32px; } }

/* Glassmorphism Login Page - Reddish / Patriotic Clean Theme */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px 16px;
  background: radial-gradient(circle at 20% 20%, #7f1d1d 0%, #450a0a 45%, #180303 100%);
  position: relative;
  overflow: hidden;
}

/* Ambient glow orbs behind glass */
.login-body::before {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.35) 0%, rgba(185, 28, 28, 0.08) 60%, transparent 70%);
  top: -60px;
  left: -60px;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb1 12s ease-in-out infinite alternate;
}

.login-body::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.30) 0%, rgba(159, 18, 57, 0.08) 60%, transparent 70%);
  bottom: -60px;
  right: -60px;
  filter: blur(55px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb2 14s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(35px, 30px) scale(1.08); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-35px, -30px) scale(1.06); }
}

.login-container {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 36px 28px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 8px 24px 0 rgba(153, 27, 27, 0.08);
  width: 100%;
  max-width: 410px;
  text-align: center;
}

.login-header {
  margin-bottom: 28px;
}
.login-header h1 {
  color: #991b1b;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.login-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}
.login-header p {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.login-container input[type="text"],
.login-container input[type="password"] {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(8px);
}
.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
  background: #ffffff;
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
}

.login-container #submitBtn {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.3);
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
}
.login-container #submitBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  box-shadow: 0 6px 18px rgba(185, 28, 28, 0.4);
  transform: translateY(-1px);
}

/* Forms */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px; /* 16px prevents iOS Safari from auto-zooming */
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 48px;
  box-sizing: border-box;
  background-color: #ffffff;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
}
textarea {
  height: auto;
  min-height: 80px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.pin-input-group {
  display: flex;
  position: relative;
}
.pin-input-group input {
  padding-right: 48px; /* space for toggle icon */
}
.btn-toggle-pin {
  position: absolute;
  right: 0;
  top: 0;
  height: 48px;
  padding: 0 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  height: 48px;
  text-decoration: none;
}
.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
}
.btn-primary:disabled {
  background-color: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}
.btn-outline {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.error-message {
  color: var(--danger);
  margin-bottom: 16px;
  font-size: 14px;
  text-align: center;
}

/* Voting Header Enhanced */
.header {
  margin-bottom: 24px;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.header-brand-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
}
.voter-header-logo {
  height: 56px;
  width: auto;
  max-width: 66px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
  transition: transform 0.2s ease;
}
.voter-header-logo:hover {
  transform: scale(1.05);
}
.header-brand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.voter-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #15803d;
  background: #dcfce7;
  padding: 3px 10px;
  border-radius: 99px;
  width: fit-content;
  margin-bottom: 2px;
}
.live-dot {
  width: 6px;
  height: 6px;
  background-color: #16a34a;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: liveDotPulse 1.8s infinite;
}
@keyframes liveDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.header-top h1 {
  font-size: 22px;
  font-weight: 800;
  color: #991b1b;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.header-school-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Voter Profile Chip */
.voter-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.voter-avatar-initial {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
}
.voter-profile-details {
  text-align: left;
}
.voter-profile-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.voter-profile-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.voter-class-pill {
  font-size: 11px;
  font-weight: 700;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 1px 7px;
  border-radius: 4px;
}
.voter-status-pill {
  font-size: 10px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  padding: 1px 7px;
  border-radius: 99px;
}
.btn-voter-exit {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  margin-left: 4px;
}
.btn-voter-exit:hover {
  background: #fee2e2;
  border-color: #f87171;
  transform: translateY(-1px);
}

/* Instructions Hero Banner */
.header-instructions {
  background: linear-gradient(135deg, #ffffff 0%, #fef8f8 100%);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(254, 202, 202, 0.6);
  box-shadow: 0 4px 16px rgba(153, 27, 27, 0.03);
}
.instructions-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.instructions-icon {
  font-size: 32px;
  line-height: 1;
  background: #fef2f2;
  border: 1px solid #fecaca;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.instructions-body h2 {
  font-size: 17px;
  font-weight: 800;
  color: #991b1b;
  margin-bottom: 6px;
}
.instructions-body p {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 4px 12px;
  border-radius: 99px;
}

/* Election Status Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.badge-open {
  background-color: #dcfce7;
  color: var(--success);
}
.badge-open::before { background-color: var(--success); }
.badge-closed {
  background-color: #fee2e2;
  color: var(--danger);
}
.badge-closed::before { background-color: var(--danger); }
.badge-draft {
  background-color: #f3f4f6;
  color: var(--text-secondary);
}
.badge-draft::before { background-color: var(--text-secondary); }

/* Candidates Grid */
.candidates-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 640px) { .candidates-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .candidates-grid { grid-template-columns: repeat(3, 1fr); } }

/* Card Layout Switcher (Mobile) */
.layout-switcher-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-layout-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.layout-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.layout-toggle-pills {
  display: inline-flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}
.btn-layout-pill {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-layout-pill.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.swipe-hint {
  display: none;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  text-align: center;
}

@media (max-width: 640px) {
  .candidates-grid.layout-horizontal {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 16px !important;
    padding-bottom: 16px !important;
    padding-top: 4px !important;
    scrollbar-width: thin;
  }
  .candidates-grid.layout-horizontal .candidate-card {
    flex: 0 0 85% !important;
    max-width: 310px !important;
    min-width: 260px !important;
    scroll-snap-align: center !important;
  }
}

/* Candidate Cards & Section */
.layout-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.layout-section-heading {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
}
.layout-candidates-count {
  font-size: 11px;
  font-weight: 700;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 2px 8px;
  border-radius: 99px;
}

.candidate-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.28s ease;
  position: relative;
}
.candidate-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.1), 0 8px 12px -4px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
}

/* Candidate Photo */
.candidate-photo-wrapper {
  position: relative;
  aspect-ratio: 4/3;
  width: 100%;
  background: #f1f5f9;
  overflow: hidden;
}
.candidate-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease;
}
.candidate-card:hover .candidate-photo {
  transform: scale(1.03);
}
.photo-gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.45) 100%);
  pointer-events: none;
}

/* Paslon Badges on Card */
.candidate-number-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
}
.candidate-number-badge .badge-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: 0.9;
}
.candidate-number-badge .badge-num {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

/* Paslon Color Themes */
.paslon-badge-1 { background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%); }
.paslon-badge-2 { background: linear-gradient(135deg, #047857 0%, #059669 100%); }
.paslon-badge-3 { background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%); }
.paslon-badge-4 { background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%); }

.paslon-btn-1 { background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important; }
.paslon-btn-2 { background: linear-gradient(135deg, #047857 0%, #059669 100%) !important; }
.paslon-btn-3 { background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%) !important; }
.paslon-btn-4 { background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%) !important; }

.candidate-card.paslon-theme-1:hover { border-color: #93c5fd; }
.candidate-card.paslon-theme-2:hover { border-color: #a7f3d0; }
.candidate-card.paslon-theme-3:hover { border-color: #ddd6fe; }
.candidate-card.paslon-theme-4:hover { border-color: #fed7aa; }

/* Candidate Card Body */
.candidate-info {
  padding: 20px 22px 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.candidate-names-box {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  flex-grow: 1;
}
.candidate-pair-item {
  text-align: left;
}
.candidate-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.candidate-role-tag .role-icon {
  font-size: 11px;
}
.candidate-name-text {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}
.candidate-pair-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 10px 0;
}

/* Candidate Actions */
.candidate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-candidate-vision {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  height: 44px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.btn-candidate-vision:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
.btn-candidate-vote {
  color: #ffffff;
  height: 48px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-candidate-vote:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26);
  filter: brightness(1.06);
}
.btn-candidate-vote:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 24, 39, 0.6);
  display: none; /* Changed to none, handled by JS flex */
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
}
.modal {
  background: var(--surface);
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 18px;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: all 0.2s;
}
.modal-close:hover {
  background: var(--background);
  color: var(--text);
}
.btn-wa {
  background: #25D366;
  color: white;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-wa:hover:not(:disabled) {
  background: #1eb857;
  color: white;
}
.btn-dismiss {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.btn-dismiss:hover {
  opacity: 1;
}
.modal form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  padding: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.modal-footer .btn {
  width: auto;
}

/* Vision & Mission Modal Enhancements */
.paslon-modal-badge {
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 8px;
  line-height: 1;
}
.vision-mission-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}
.vm-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.vm-section-header h4 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #1e3a5f;
  margin: 0;
}
.vision-box, .mission-box {
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 12px 14px;
}
.vision-text {
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}
.mission-list {
  padding-left: 20px;
  margin: 0;
}
.mission-list li {
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 6px;
}
.mission-list li:last-child {
  margin-bottom: 0;
}

/* Modern Structured Mission Points */
.mission-points-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mission-point-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  transition: all 0.2s ease;
}
.mission-point-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.mission-point-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.mission-point-text {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.55;
  font-weight: 500;
  word-break: break-word;
  flex: 1;
}

/* Confirm Vote Modal Card */
.confirm-paslon-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 18px;
}
.confirm-paslon-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.confirm-paslon-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #1e3a5f;
}
.confirm-photo-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 auto 14px auto;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.confirm-candidate-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.confirm-candidate-names {
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.confirm-pair-row {
  font-size: 14px;
  color: #1e293b;
}
.confirm-pair-role {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
}
@media (max-width: 640px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 88px; /* space to prevent floating WA button overlap */
  }
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .header-brand-cluster {
    width: 100%;
  }
  .voter-header-logo {
    height: 46px;
  }
  .header-top h1 {
    font-size: 20px;
  }
  .header-top .user-info {
    width: 100%;
  }
  .voter-profile-chip {
    width: 100%;
    justify-content: space-between;
    box-sizing: border-box;
  }
  .header-instructions {
    padding: 14px 16px;
  }
  .instructions-icon {
    width: 40px;
    height: 40px;
    font-size: 22px;
    border-radius: 10px;
  }
  .instructions-body h2 {
    font-size: 15px;
  }
  .instructions-body p {
    font-size: 13px;
  }
  .candidate-info {
    padding: 16px 14px 18px;
  }
  .candidate-names-box {
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  .candidate-name-text {
    font-size: 15px;
  }
  .btn-candidate-vote {
    height: 46px;
    font-size: 13px;
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    max-height: 88vh;
    animation: modalSlideUpMobile 0.25s ease-out;
  }
  @keyframes modalSlideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .modal-header {
    padding: 16px 20px;
  }
  .modal-body {
    padding: 18px 20px;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    padding: 14px 20px;
    flex-direction: column-reverse;
    gap: 10px;
  }
  .modal-footer .btn {
    width: 100%;
    height: 46px;
  }
  .modal-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
  }
}

/* Success Page */
.success-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-md);
  margin: 0 auto;
}
.success-icon {
  width: 80px;
  height: 80px;
  background: #dcfce7;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px;
}
.success-container h1 {
  font-size: 24px;
  margin-bottom: 16px;
}
.success-details {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 32px 0;
  text-align: left;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-label {
  color: var(--text-secondary);
  font-size: 14px;
}
.detail-value {
  font-weight: 500;
  font-size: 14px;
}

/* Floating WhatsApp Button */
.floating-wa-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  background-color: #25D366;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  transition: all 0.2s ease;
}
.floating-wa-btn:hover {
  background-color: #1eb857;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* ========================================================
   COUNTDOWN TIMER STYLES (LOGIN & VOTER DASHBOARD)
   ======================================================== */

/* 1. Timer on Voter Login Page */
.countdown-banner-login {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.96) 0%, rgba(254, 226, 226, 0.9) 100%);
  border: 1.5px solid rgba(252, 165, 165, 0.85);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.08);
  text-align: center;
}
.countdown-banner-login.is-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #f87171;
}
.countdown-login-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}
.countdown-login-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #991b1b;
  text-transform: uppercase;
}
.countdown-banner-login.is-danger .countdown-login-title {
  color: #b91c1c;
}
.countdown-login-digits {
  font-size: 20px;
  font-weight: 900;
  color: #7f1d1d;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.countdown-banner-login.is-danger .countdown-login-digits {
  color: #dc2626;
}
.countdown-login-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
  font-weight: 600;
}

/* 2. Timer on Voter Dashboard / Bilik Suara */
.countdown-banner-voter {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 18px rgba(69, 10, 10, 0.25);
  border: 1px solid rgba(254, 202, 202, 0.2);
  flex-wrap: wrap;
  gap: 12px;
}
.countdown-banner-voter.is-danger {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  border-color: #ef4444;
}
.countdown-voter-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.countdown-icon-pulse {
  font-size: 24px;
  display: inline-block;
  animation: pulseTimerIcon 2s infinite ease-in-out;
}
@keyframes pulseTimerIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
.countdown-voter-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fecaca;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.countdown-banner-voter.is-danger .countdown-voter-title {
  color: #fecaca;
}
.countdown-voter-digits {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.countdown-voter-meta {
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 99px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .countdown-banner-login {
    padding: 10px 12px;
    margin-bottom: 16px;
  }
  .countdown-login-digits {
    font-size: 17px;
  }
  .countdown-banner-voter {
    padding: 10px 14px;
    margin-bottom: 16px;
  }
  .countdown-voter-left {
    gap: 8px;
  }
  .countdown-icon-pulse {
    font-size: 20px;
  }
  .countdown-voter-digits {
    font-size: 17px;
  }
  .countdown-voter-meta {
    font-size: 11px;
    padding: 4px 10px;
  }
  .floating-wa-btn {
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
    font-size: 12px;
  }
  .login-container {
    padding: 24px 18px;
    max-width: 100%;
  }
  .candidate-card {
    border-radius: var(--radius-sm);
  }
  .candidate-info {
    padding: 16px;
  }
  .candidate-name-text {
    font-size: 16px;
    margin-bottom: 8px;
  }
  .success-container {
    padding: 28px 16px;
  }
  .success-details {
    padding: 16px;
    margin: 20px 0;
  }
  .detail-row {
    padding: 10px 0;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .login-header h1 {
    font-size: 22px;
  }
  .login-header h2 {
    font-size: 14px;
  }
  .login-header p {
    font-size: 13px;
  }
  .summary-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .summary-stats .stat-item:last-child {
    grid-column: span 2;
  }
  .stat-item {
    padding: 14px 10px !important;
  }
  .stat-value {
    font-size: 22px !important;
  }
}

@media (max-width: 360px) {
  .login-container {
    padding: 20px 12px;
  }
  .btn {
    font-size: 13px;
    padding: 10px 12px;
  }
  #regResPin {
    font-size: 26px !important;
    letter-spacing: 4px !important;
  }
}

