/* =========================================================
   GNFS e-Voting System — Master Stylesheet
   ========================================================= */

:root {
  /* Brand */
  --gnfs-red:      #C8102E;
  --gnfs-darkred:  #8B0A1F;
  --gnfs-gold:     #F5B700;
  --gnfs-dark:     #1A1D21;
  --gnfs-blue:     #0B4F8A;

  /* Neutrals */
  --bg-page:       #F5F7FA;
  --bg-card:       #FFFFFF;
  --border-soft:   rgba(0,0,0,.06);
  --border-mid:    #E5E7EB;
  --text-muted:    #6B7280;

  /* Elevation */
  --shadow-sm:     0 1px 2px rgba(16,24,40,.04), 0 4px 12px -4px rgba(16,24,40,.06);
  --shadow-md:     0 1px 2px rgba(16,24,40,.04), 0 8px 24px -8px rgba(16,24,40,.08);
  --shadow-lg:     0 1px 2px rgba(16,24,40,.04), 0 16px 32px -8px rgba(16,24,40,.12);

  /* Radii */
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     18px;
}

/* =========================================================
   Base
   ========================================================= */
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1F2937;
  background: var(--bg-page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  background: #F3F4F6;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--gnfs-darkred);
  font-weight: 600;
}

/* =========================================================
   Layout backgrounds
   ========================================================= */
.app-bg {
  background: var(--bg-page);
  min-height: 100vh;
}

/* Soft radial red tint — used on voter pages */
body.app-bg,
body.voter-bg {
  background:
    radial-gradient(ellipse at top, rgba(200,16,46,.035), transparent 60%),
    var(--bg-page);
}

.admin-bg {
  background: #EEF1F5;
  min-height: 100vh;
}

/* =========================================================
   Auth pages (login / OTP)
   ========================================================= */
.auth-bg {
  background: linear-gradient(135deg, var(--gnfs-darkred) 0%, #5E0814 100%);
  min-height: 100vh;
  color: #fff;
}

.auth-bg .brand-badge {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gnfs-red), var(--gnfs-darkred));
  color: #fff;
  border-radius: 50%;
  font-size: 34px;
  box-shadow: 0 8px 24px rgba(200,16,46,.35);
}

/* =========================================================
   Cards — soft, elevated, professional
   ========================================================= */
.card {
  border-radius: var(--radius-xl) !important;
  border: 1px solid var(--border-soft) !important;
  box-shadow: var(--shadow-md) !important;
  transition: box-shadow .2s ease, transform .2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg) !important;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  font-weight: 500;
  transition: all .18s ease;
}

.btn-primary {
  background: var(--gnfs-red);
  border-color: var(--gnfs-red);
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 10px 22px;
  box-shadow: 0 4px 12px rgba(200,16,46,.22);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--gnfs-darkred) !important;
  border-color: var(--gnfs-darkred) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,16,46,.32);
}

.btn-danger {
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 10px 22px;
  box-shadow: 0 4px 12px rgba(200,16,46,.22);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,16,46,.32);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-danger {
  border-radius: var(--radius-md);
  font-weight: 500;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 14px;
}

/* =========================================================
   Badges
   ========================================================= */
.badge {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 5px 10px;
  letter-spacing: .2px;
}

.badge.bg-success { background: #198754 !important; }
.badge.bg-warning { background: var(--gnfs-gold) !important; color: #1A1D21 !important; }
.badge.bg-danger  { background: var(--gnfs-red) !important; }

/* Softer pastel variants */
.badge.bg-success-subtle { background: #DCFCE7 !important; color: #166534 !important; }
.badge.bg-info-subtle    { background: #DBEAFE !important; color: #1E40AF !important; }
.badge.bg-warning-subtle { background: #FEF3C7 !important; color: #92400E !important; }
.badge.bg-danger-subtle  { background: #FEE2E2 !important; color: #991B1B !important; }
.badge.bg-secondary-subtle { background: #F3F4F6 !important; color: #374151 !important; }

/* =========================================================
   Alerts — soft, no border, rounded
   ========================================================= */
.alert {
  border-radius: 14px;
  border: 0;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.alert-info      { background: #EFF6FF; color: #1E40AF; }
.alert-warning   { background: #FFFBEB; color: #92400E; }
.alert-success   { background: #F0FDF4; color: #166534; }
.alert-danger    { background: #FEF2F2; color: #991B1B; }
.alert-secondary { background: #F3F4F6; color: #374151; }

/* =========================================================
   Icon tiles
   ========================================================= */
.icon-tile {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

/* =========================================================
   Stat tiles (dashboard)
   ========================================================= */
.stat-tile {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px;
  background: var(--bg-card);
  height: 100%;
}
.stat-tile .label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
}
.stat-tile .value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

/* =========================================================
   Section heading
   ========================================================= */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--gnfs-red), var(--gnfs-darkred));
  border-radius: 4px;
}

/* =========================================================
   Progress bars
   ========================================================= */
.progress {
  background: var(--border-mid);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  background: linear-gradient(90deg, var(--gnfs-red), var(--gnfs-darkred));
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-bar.bg-success {
  background: linear-gradient(90deg, #22C55E, #15803D) !important;
}

/* =========================================================
   Candidate card (voting page)
   ========================================================= */
.candidate-card {
  cursor: pointer;
  transition: all .18s ease;
  background: #fff;
  border-radius: 14px !important;
  border: 2px solid var(--border-mid) !important;
}
.candidate-card:hover {
  border-color: var(--gnfs-red) !important;
  box-shadow: 0 8px 24px -6px rgba(200,16,46,.22);
  transform: translateY(-2px);
}
.candidate-card:has(input:checked) {
  border-color: var(--gnfs-red) !important;
  background: #FFF5F7;
  box-shadow: 0 8px 24px -6px rgba(200,16,46,.28);
  transform: translateY(-2px);
}
.candidate-card input[type=radio] {
  width: 22px;
  height: 22px;
  accent-color: var(--gnfs-red);
}

.candidate-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: #E9ECEF;
  flex-shrink: 0;
}
.candidate-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.candidate-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gnfs-blue);
  font-size: 22px;
}

/* =========================================================
   Success check (vote confirmation)
   ========================================================= */
.success-check {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #22C55E, #15803D);
  color: #fff;
  border-radius: 50%;
  font-size: 26px;
  box-shadow: 0 8px 20px rgba(34,197,94,.35);
  animation: successPop .5s cubic-bezier(.5,1.6,.5,1);
  flex-shrink: 0;
}
@keyframes successPop {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* =========================================================
   Letter spacing (OTP inputs)
   ========================================================= */
.letter-spaced {
  letter-spacing: .6em;
  font-weight: 700;
}

/* =========================================================
   Voter navigation bar
   ========================================================= */
.voter-navbar {
  background: linear-gradient(135deg, var(--gnfs-darkred) 0%, var(--gnfs-red) 100%);
  box-shadow: 0 4px 20px rgba(139,10,31,.22);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.voter-navbar .navbar-brand {
  color: #fff !important;
  font-weight: 700;
}
.voter-navbar .nav-link {
  color: rgba(255,255,255,.82) !important;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all .18s ease;
  font-weight: 500;
}
.voter-navbar .nav-link:hover {
  background: rgba(255,255,255,.12);
  color: #fff !important;
  transform: translateY(-1px);
}
.voter-navbar .nav-link.active {
  background: rgba(255,255,255,.22);
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

.brand-badge-small {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.18);
  border-radius: 12px;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}

@media (max-width: 991px) {
  .voter-navbar .navbar-collapse {
    background: rgba(0,0,0,.18);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
  }
}

/* =========================================================
   Admin sidebar
   ========================================================= */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--gnfs-dark);
  position: sticky;
  top: 0;
  flex-shrink: 0;
}
.admin-sidebar .nav-link {
  color: #CFD4DA !important;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  padding: 8px 12px;
  transition: all .15s ease;
}
.admin-sidebar .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff !important;
}
.admin-sidebar .nav-link.active {
  background: var(--gnfs-red);
  color: #fff !important;
}

/* =========================================================
   Responsive polish
   ========================================================= */
@media (max-width: 576px) {
  .card-body { padding: 20px !important; }
  h1.h4 { font-size: 20px; }
  h2.h5 { font-size: 17px; }
  h3.h6 { font-size: 15px; }
  .icon-tile { width: 48px; height: 48px; font-size: 20px; }
  .success-check { width: 48px; height: 48px; font-size: 22px; }
  .btn-lg { padding: 12px 22px; font-size: 15px; }
  .voter-navbar { padding: 8px 0; }
  .stat-tile .value { font-size: 19px; }
}

/* =========================================================
   Print
   ========================================================= */
@media print {
  .btn,
  .admin-sidebar,
  nav,
  .no-print,
  .voter-navbar {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #DDD !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .progress {
    border: 1px solid #DDD;
  }
  .progress-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  h1, h2, h3 { color: #000 !important; }
}
.brand-badge {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gnfs-logo {
    width: 75px;
    height: 75px;
    object-fit: contain;
}