/* ===================================================================
   Sistema di Votazione — GEI-SIBSC 2026
   Design unificato con il portale: palette blu navy + oro
   =================================================================== */

/* ── Variabili (stesse del portale) ─────────────────────────────── */
:root {
  --blu-scuro:  #0a1628;
  --blu-medio:  #12254a;
  --blu-chiaro: #1e3a6e;
  --oro:        #c9a84c;
  --oro-chiaro: #e0c06a;
  --grigio-ch:  #f4f6fb;
  --testo:      #1a2540;
  --font-sans:  'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius:     12px;
  --transition: .2s ease;

  /* ── Sovrascrive il primary di Bootstrap con l'oro ── */
  --bs-primary:                #c9a84c;
  --bs-primary-rgb:            201, 168, 76;
  --bs-primary-text-emphasis:  #0a1628;
  --bs-primary-bg-subtle:      rgba(201,168,76,.12);
  --bs-primary-border-subtle:  rgba(201,168,76,.35);
  --bs-link-color:             #c9a84c;
  --bs-link-hover-color:       #e0c06a;
}

/* ── Reset / Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.voto-body {
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background: var(--grigio-ch);
  color: var(--testo);
}

/* ── Navbar ──────────────────────────────────────────────────────── */
.voto-navbar {
  background: var(--blu-scuro);
  border-bottom: 3px solid var(--oro);
  padding: .65rem 0;
  z-index: 1030;
}

.voto-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.voto-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.voto-brand-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--oro);
  flex-shrink: 0;
}
.voto-brand-main {
  font-size: .9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
}
.voto-brand-pill {
  font-size: .68rem;
  font-weight: 700;
  background: var(--oro);
  color: var(--blu-scuro);
  padding: .1rem .45rem;
  border-radius: 20px;
  letter-spacing: .03em;
}

.voto-navbar-title {
  font-size: .85rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  flex-shrink: 0;
}

.voto-nav-links {
  display: flex;
  align-items: center;
  gap: .4rem;
  list-style: none;
  margin: 0; padding: 0;
  flex-shrink: 0;
}

.voto-nav-link {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  padding: .3rem .6rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.voto-nav-link:hover { color: var(--oro); background: rgba(201,168,76,.1); }

.voto-btn-outline {
  font-size: .78rem;
  font-weight: 700;
  color: var(--oro);
  border: 1.5px solid var(--oro);
  border-radius: 6px;
  padding: .28rem .75rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.voto-btn-outline:hover { background: var(--oro); color: var(--blu-scuro); }

.voto-nav-email {
  font-size: .75rem;
  color: rgba(255,255,255,.55);
  max-width: 160px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.voto-footer {
  background: var(--blu-scuro);
  border-top: 3px solid var(--oro);
  padding: 1.6rem 0 1rem;
  color: rgba(255,255,255,.75);
  font-size: .82rem;
}
.voto-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.voto-footer strong { color: var(--oro); font-size: .9rem; }
.voto-footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.voto-footer-links a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: .8rem;
  transition: color var(--transition);
}
.voto-footer-links a:hover { color: var(--oro); }
.voto-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: .8rem;
  text-align: center;
  font-size: .75rem;
  color: rgba(255,255,255,.4);
}

/* ── Bootstrap overrides con palette GEI-SIBSC ───────────────────── */
/* Pulsante primario → oro su blu */
.btn-primary {
  --bs-btn-bg:             var(--oro);
  --bs-btn-border-color:   var(--oro);
  --bs-btn-color:          var(--blu-scuro);
  --bs-btn-hover-bg:       var(--oro-chiaro);
  --bs-btn-hover-border-color: var(--oro-chiaro);
  --bs-btn-hover-color:    var(--blu-scuro);
  --bs-btn-active-bg:      #b8963e;
  --bs-btn-active-border-color: #b8963e;
  --bs-btn-active-color:   var(--blu-scuro);
  font-weight: 700;
}

/* Outline secondary → stile coherente */
.btn-outline-secondary {
  --bs-btn-color:          var(--blu-medio);
  --bs-btn-border-color:   var(--blu-medio);
  --bs-btn-hover-color:    #fff;
  --bs-btn-hover-bg:       var(--blu-medio);
  font-weight: 600;
}

/* Card con ombra più morbida */
.card {
  border-radius: var(--radius) !important;
  border-color: #dde3f0 !important;
}
.card.shadow-sm {
  box-shadow: 0 2px 16px rgba(10,22,40,.08) !important;
}

/* Titoli pagina */
.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--blu-scuro);
}
.page-subtitle {
  color: #6b7a99;
  font-size: .9rem;
}

/* Badges stat in dashboard */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #dde3f0;
  padding: 1.2rem 1.4rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(10,22,40,.06);
}
.stat-card .stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--blu-scuro);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8896b4;
  margin-top: .3rem;
}
.stat-card.stat-primary .stat-num { color: var(--oro); }

/* Badge LIVE */
.badge-live {
  background: #16a34a;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .3em .7em;
  border-radius: 20px;
  letter-spacing: .06em;
}

/* Form controls con focus oro */
.form-control:focus, .form-select:focus {
  border-color: var(--oro);
  box-shadow: 0 0 0 .2rem rgba(201,168,76,.25);
}

/* Alert overrides */
.alert-success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.alert-danger  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fef9c3; border-color: #fde047; color: #854d0e; }

/* Progress bar colore oro */
.progress-bar { background-color: var(--oro) !important; }

/* bg-primary / badge primary → oro su blu */
.bg-primary {
  background-color: var(--oro) !important;
  color: var(--blu-scuro) !important;
}
/* Neutralise Bootstrap's text-white when combined with bg-primary (higher specificity) */
.bg-primary.text-white,
.bg-primary .text-white {
  color: var(--blu-scuro) !important;
}
.badge.bg-primary, span.badge.bg-primary {
  background-color: var(--oro) !important;
  color: var(--blu-scuro) !important;
}
/* link color */
a { color: var(--oro); }
a:hover { color: var(--oro-chiaro); }

/* ── Pagina hero (login / registrazione) ────────────────────────── */
.voto-hero-header {
  background: linear-gradient(160deg, var(--blu-scuro) 0%, var(--blu-medio) 60%, var(--blu-chiaro) 100%);
  color: #fff;
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  margin: -1rem -12px 2rem;
  border-radius: 0 0 var(--radius) var(--radius);
}
.voto-hero-header h1 {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 900;
  color: var(--oro);
  margin-bottom: .3rem;
}
.voto-hero-header p { color: rgba(255,255,255,.7); font-size: .9rem; }

/* ── Section divider ────────────────────────────────────────────── */
.section-divider {
  height: 3px;
  background: linear-gradient(90deg, var(--oro), transparent);
  border: none;
  margin: 2rem 0;
  border-radius: 2px;
}

/* ── background body specifico ─────────────────────────────────── */
body { background: var(--grigio-ch); }

/* ── Opzioni di voto (card selezionabili) ─────────────────────────── */
.opzione-card {
  cursor: pointer;
  border-color: #dde3f0 !important;
  transition: border-color .2s, box-shadow .2s, transform .15s, background-color .2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.opzione-card:hover {
  border-color: var(--oro) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(10,22,40,.12);
}
@media (hover: none) {
  .opzione-card:hover { transform: none; box-shadow: none; border-color: #dde3f0 !important; }
}
.opzione-card:active { transform: scale(.97); }

/* Stato selezionato */
.btn-check:checked + .opzione-card {
  border-color: var(--oro) !important;
  background-color: rgba(201,168,76,.1);
  box-shadow: 0 0 0 3px rgba(201,168,76,.3), 0 4px 12px rgba(201,168,76,.15);
}
.btn-check:checked + .opzione-card .opzione-check {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 1rem;
}

/* Immagine opzione */
.opzione-card img {
  max-height: 160px; width: 100%; object-fit: contain; border-radius: .375rem;
}

/* ── LIVE badge pulse ─────────────────────────────────────────────── */
.live-pulse { animation: livePulse .5s ease; }
@keyframes livePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── Scrollbar sottile ────────────────────────────────────────────── */
.overflow-auto::-webkit-scrollbar { width: 6px; }
.overflow-auto::-webkit-scrollbar-track { background: transparent; }
.overflow-auto::-webkit-scrollbar-thumb { background: #c9a84c44; border-radius: 3px; }

/* ── Mobile tweaks ────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .card-body { padding: 1rem; }
  .voto-footer-inner { flex-direction: column; }
}
