/* ═══════════════════════════════════════════════════════════
   Student Voting Portal
═══════════════════════════════════════════════════════════ */

.student-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(79, 70, 229, 0.14), transparent 45%),
    radial-gradient(ellipse at 85% 100%, rgba(14, 165, 233, 0.12), transparent 45%),
    var(--bg);
}

.student-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.student-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.student-topbar .brand img,
.student-topbar .brand .brand-fallback {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
}

.student-topbar .brand .brand-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.student-topbar .brand-text {
  min-width: 0;
}

.student-topbar .brand-text strong {
  display: block;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-topbar .brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.student-topbar .top-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .countdown-pill {
  color: #f87171;
}

.countdown-pill.ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

[data-theme="dark"] .countdown-pill.ok {
  color: #34d399;
}

.student-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

/* Progress */
.vote-progress-wrap {
  margin-bottom: 1.5rem;
}

.vote-step-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.vote-progress-modern {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
}

.vote-progress-modern .bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.4s ease;
}

.step-dots {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: all var(--transition);
}

.step-dot.done {
  background: var(--success);
}

.step-dot.current {
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  transform: scale(1.15);
}

/* Post header */
.post-header-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.post-header-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--post-color, var(--primary));
}

.post-header-card h2 {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-header-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Candidate cards */
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.candidate-vote-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 1.15rem;
  cursor: pointer;
  transition: all var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: left;
  color: inherit;
  width: 100%;
}

.candidate-vote-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.candidate-vote-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow);
}

.candidate-vote-card .select-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.75rem;
  transition: all var(--transition);
}

.candidate-vote-card.selected .select-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.candidate-vote-card .cand-media-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-right: 2rem; /* room for select-check */
}

.candidate-vote-card .cand-photo {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  display: block;
}

.candidate-vote-card .cand-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
}

/* Election symbol stays fully inside its own box on the card */
.candidate-vote-card .cand-symbol-box {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
}

[data-theme="dark"] .candidate-vote-card .cand-symbol-box {
  background: #1e293b;
}

.candidate-vote-card .cand-symbol {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  position: static;
}

.candidate-vote-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  padding-right: 2rem;
}

.candidate-vote-card .cand-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.candidate-vote-card .manifesto {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 0.85rem;
}

.candidate-vote-card .vote-cta {
  margin-top: auto;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
}

.candidate-vote-card.selected .vote-cta {
  color: var(--primary);
}

/* Nav footer */
.vote-nav {
  position: sticky;
  bottom: 0;
  margin-top: 1.75rem;
  padding: 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  z-index: 20;
}

.vote-nav .nav-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1 1 100%;
  min-width: 0;
  order: -1;
  text-align: center;
}

.vote-nav .btn {
  flex: 1 1 auto;
  min-width: 120px;
}

@media (min-width: 576px) {
  .vote-nav .nav-hint {
    flex: 1 1 auto;
    order: 0;
    text-align: left;
  }
}

/* Confirm page */
.confirm-list .confirm-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  margin-bottom: 0.75rem;
}

.confirm-list .confirm-item img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
}

.confirm-list .post-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 0.15rem;
}

/* Success */
.success-hero {
  text-align: center;
  padding: 2.5rem 1.5rem;
  max-width: 520px;
  margin: 0 auto;
}

.success-hero .check-ring {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  animation: popIn 0.5s ease;
}

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

.receipt-box {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.9rem;
  text-align: left;
  margin-top: 1.5rem;
}

@media (max-width: 576px) {
  .candidate-grid {
    grid-template-columns: 1fr;
  }
  .student-topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .student-topbar .top-meta {
    justify-content: space-between;
  }
}
