:root {
  --polkesmar-dark: #0F2D2B;
  --polkesmar-primary: #00897B;
  --polkesmar-deep: #00695C;
  --polkesmar-soft: #E0F2F1;
  --polkesmar-bg: #F4F6F9;
  --polkesmar-ink: #0F172A;
  --polkesmar-muted: #64748B;
  --polkesmar-border: #E2E8F0;
}

body {
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--polkesmar-bg);
  color: var(--polkesmar-ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Plus Jakarta Sans', 'Public Sans', sans-serif;
}

.font-mono-code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Navbar & Header */
.pemira-navbar {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--polkesmar-border);
}

.brand-emblem {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--polkesmar-dark) 0%, var(--polkesmar-deep) 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(0, 105, 92, 0.22);
}

.btn-teal {
  background-color: var(--polkesmar-primary);
  border-color: var(--polkesmar-primary);
  color: #ffffff;
  font-weight: 600;
}

.btn-teal:hover, .btn-teal:focus {
  background-color: var(--polkesmar-deep);
  border-color: var(--polkesmar-deep);
  color: #ffffff;
}

.btn-outline-teal {
  border-color: var(--polkesmar-primary);
  color: var(--polkesmar-deep);
  font-weight: 600;
}

.btn-outline-teal:hover {
  background-color: var(--polkesmar-soft);
  border-color: var(--polkesmar-deep);
  color: var(--polkesmar-dark);
}

/* Hero Carousel */
.hero-carousel-wrap {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 40px -15px rgba(15, 45, 43, 0.22);
  border: 1px solid rgba(15, 45, 43, 0.08);
  background-color: var(--polkesmar-dark);
}

.hero-slide-item {
  position: relative;
  height: 360px;
}

@media (min-width: 768px) {
  .hero-slide-item {
    height: 430px;
  }
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 45, 43, 0.88) 0%, rgba(15, 45, 43, 0.62) 55%, rgba(15, 45, 43, 0.22) 100%);
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

@media (min-width: 768px) {
  .hero-slide-overlay {
    padding: 3rem;
  }
}

/* Broadcast Quick Count Board */
.quickcount-board {
  background: linear-gradient(135deg, #0B2523 0%, #0F3B37 45%, #0B5850 100%);
  border-radius: 22px;
  color: #ffffff;
  box-shadow: 0 22px 50px -18px rgba(11, 37, 35, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.quickcount-header-bar {
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.qc-brand-box {
  background: #ffffff;
  color: #0F2D2B;
  border-radius: 10px;
  padding: 0.45rem 0.9rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.qc-ring-stage {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0 auto;
}

.qc-ring-svg {
  width: 210px;
  height: 210px;
  transform: rotate(-90deg);
}

.qc-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 15;
}

.qc-ring-progress {
  fill: none;
  stroke-width: 15;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

.qc-photo-frame {
  position: absolute;
  top: 23px;
  left: 23px;
  width: 164px;
  height: 164px;
  border-radius: 50%;
  overflow: hidden;
  background: #133B37;
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.28);
}

.qc-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.qc-nameplate {
  position: relative;
  margin-top: -28px;
  background: #ffffff;
  color: #0F172A;
  border-radius: 12px;
  padding: 0.45rem 0.75rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 96%;
  text-align: left;
  z-index: 3;
}

.qc-number-badge {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.qc-percent-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Candidate Profile Card */
.candidate-card {
  background: #ffffff;
  border: 1px solid var(--polkesmar-border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.candidate-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -12px rgba(15, 45, 43, 0.14);
}

.candidate-photo-box {
  position: relative;
  height: 250px;
  background: #E2E8F0;
  overflow: hidden;
}

.candidate-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.candidate-no-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 45, 43, 0.9);
  color: #ffffff;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* Ballot Choice Card */
.ballot-option-card {
  border: 2px solid var(--polkesmar-border);
  border-radius: 16px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.18s ease;
  background: #ffffff;
}

.ballot-option-card:hover {
  border-color: var(--polkesmar-primary);
  background: #F7FCFB;
}

.ballot-option-card.selected {
  border-color: var(--polkesmar-deep);
  background: var(--polkesmar-soft);
  box-shadow: 0 8px 20px -8px rgba(0, 105, 92, 0.28);
}

/* Floating Elevated Admin Login Card */
.admin-auth-backdrop {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 137, 123, 0.16), transparent 44%),
    radial-gradient(circle at 82% 80%, rgba(15, 45, 43, 0.18), transparent 46%),
    linear-gradient(180deg, #EEF3F6 0%, #F7FAFC 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-auth-card {
  width: 100%;
  max-width: 430px;
  background: #ffffff;
  border-radius: 22px;
  border: 1px solid rgba(15, 45, 43, 0.08);
  box-shadow:
    0 24px 55px -16px rgba(15, 45, 43, 0.2),
    0 8px 20px -10px rgba(0, 137, 123, 0.14);
  padding: 2.25rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.admin-auth-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 28px 65px -16px rgba(15, 45, 43, 0.24),
    0 10px 24px -10px rgba(0, 137, 123, 0.16);
}

/* Admin Layout */
.admin-header-bar {
  background: linear-gradient(135deg, #0F2D2B 0%, #0C433D 100%);
  color: #ffffff;
}

.admin-nav-pills .nav-link {
  color: #475569;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-size: 0.88rem;
}

.admin-nav-pills .nav-link:hover {
  background-color: #E2E8F0;
  color: #0F172A;
}

.admin-nav-pills .nav-link.active {
  background-color: var(--polkesmar-deep);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 105, 92, 0.25);
}

.kpi-tile {
  background: #ffffff;
  border: 1px solid var(--polkesmar-border);
  border-radius: 16px;
  padding: 1.15rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

/* Formal Report Paper Preview */
.report-paper-preview {
  background: #ffffff;
  color: #000000;
  font-family: 'Times New Roman', Georgia, serif;
  border: 1px solid #CBD5E1;
  box-shadow: 0 14px 36px -14px rgba(15, 23, 42, 0.22);
  padding: 2rem 2.25rem;
  border-radius: 4px;
}

.report-kop-rule {
  border-top: 2.5px solid #000000;
  border-bottom: 1px solid #000000;
  height: 5px;
  margin: 0.75rem 0 1.25rem 0;
}

.report-table-black th,
.report-table-black td {
  border: 1px solid #000000 !important;
  color: #000000 !important;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
}

.report-table-black thead th {
  background-color: #F1F5F9;
  font-weight: 700;
}

/* Footer */
.pemira-footer {
  border-top: 1px solid var(--polkesmar-border);
  background: #ffffff;
  color: var(--polkesmar-muted);
}

.admin-secret-link {
  color: #94A3B8;
  opacity: 0.45;
  transition: opacity 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.admin-secret-link:hover {
  opacity: 1;
  color: var(--polkesmar-deep);
}
