/* ===================================================
   voter.css — Mobile-first styles for voter pages
   Gironi Divini 2026 — Live Communication Group
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ---- Variables ---- */
:root {
  --wine-red: #8b1a1a;
  --wine-red-dark: #6b1212;
  --wine-red-light: #a82020;
  --navy: #1a2744;
  --gold: #c8a84b;
  --gold-light: #e0c76a;
  --cream: #faf8f5;
  --white: #ffffff;
  --text-dark: #2c2c2c;
  --text-muted: #666;
  --border: #e0dbd4;
  --shadow: 0 4px 24px rgba(26, 39, 68, 0.10);
  --shadow-lg: 0 8px 40px rgba(26, 39, 68, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'EB Garamond', Georgia, serif;
  line-height: 1.2;
}

/* ---- Voter Layout ---- */
.voter-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #f5f0e8 0%, var(--cream) 50%, #f0ece4 100%);
}

.voter-header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.voter-header .session-name {
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.voter-header .participant-name {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
}

.wine-glass-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* ---- Main Content ---- */
.voter-main {
  flex: 1;
  padding: 24px 16px 40px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-bottom: 20px;
}

.card-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Join Page ---- */
.join-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(160deg, var(--navy) 0%, #2a3d6b 40%, #1f3056 100%);
}

.join-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.join-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.join-logo svg {
  width: 44px;
  height: 44px;
}

.join-title {
  font-family: 'EB Garamond', serif;
  font-size: 2rem;
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 4px;
}

.join-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
  font-style: italic;
}

.join-session-name {
  font-family: 'EB Garamond', serif;
  font-size: 1.2rem;
  color: var(--wine-red);
  font-weight: 600;
  margin-bottom: 24px;
  padding: 8px 16px;
  background: rgba(139,26,26,0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--wine-red);
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--wine-red);
  box-shadow: 0 0 0 3px rgba(139,26,26,0.12);
}

.form-input::placeholder {
  color: #aaa;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
  min-height: 52px;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--wine-red);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(139,26,26,0.30);
}

.btn-primary:hover {
  background: var(--wine-red-dark);
  box-shadow: 0 6px 20px rgba(139,26,26,0.40);
}

.btn-secondary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(26,39,68,0.25);
}

.btn-secondary:hover {
  background: #253563;
}

.btn-full { width: 100%; }

.btn-lg {
  padding: 18px 32px;
  font-size: 1.1rem;
  min-height: 60px;
  border-radius: 10px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---- Error / Alert ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: rgba(139,26,26,0.08);
  border: 1px solid rgba(139,26,26,0.25);
  color: var(--wine-red);
}

.alert-success {
  background: rgba(34,139,34,0.08);
  border: 1px solid rgba(34,139,34,0.25);
  color: #1a6b1a;
}

.join-hint {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---- Wine Badge ---- */
.wine-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--wine-red);
  color: var(--white);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- Voting Status Header ---- */
.vote-header {
  text-align: center;
  margin-bottom: 24px;
}

.vote-header .vote-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.8rem;
  color: var(--navy);
  margin-bottom: 8px;
}

/* ---- Stars Rating ---- */
.stars-container {
  margin: 28px 0;
}

.stars-label-area {
  text-align: center;
  min-height: 24px;
  margin-bottom: 16px;
}

.stars-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  transition: color 0.2s;
}

.stars-label.active { color: var(--wine-red); font-weight: 500; }

.stars-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}

.star-btn:active { transform: scale(0.9); }

.star-btn svg {
  width: 48px;
  height: 48px;
  display: block;
  transition: fill 0.15s, filter 0.15s;
}

.star-btn .star-icon {
  fill: #e0dbd4;
  stroke: #ccc;
  stroke-width: 1;
}

.star-btn.filled .star-icon,
.star-btn.hovered .star-icon {
  fill: var(--gold);
  stroke: var(--gold);
  filter: drop-shadow(0 2px 4px rgba(200,168,75,0.4));
}

.stars-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Centesimal Slider ---- */
.centesimal-container {
  margin: 28px 0;
}

.score-display {
  text-align: center;
  margin-bottom: 20px;
}

.score-number {
  font-family: 'EB Garamond', serif;
  font-size: 4rem;
  font-weight: 600;
  color: var(--wine-red);
  line-height: 1;
  display: block;
}

.score-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  display: block;
  margin-top: 4px;
  min-height: 20px;
}

.range-wrapper {
  padding: 0 8px;
  margin-bottom: 12px;
}

input[type="range"].score-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--wine-red) 0%, var(--gold) 50%, #4a90d9 100%);
  outline: none;
  cursor: pointer;
}

input[type="range"].score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--wine-red);
  box-shadow: 0 2px 8px rgba(0,0,0,0.20);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

input[type="range"].score-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

input[type="range"].score-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--wine-red);
  box-shadow: 0 2px 8px rgba(0,0,0,0.20);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 4px;
  margin-top: 6px;
}

.score-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.score-input-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

input[type="number"].score-number-input {
  width: 80px;
  padding: 10px 12px;
  font-size: 1.1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--wine-red);
  -webkit-appearance: none;
  appearance: none;
}

input[type="number"].score-number-input:focus {
  outline: none;
  border-color: var(--wine-red);
  box-shadow: 0 0 0 3px rgba(139,26,26,0.12);
}

/* ---- Waiting State ---- */
.waiting-state {
  text-align: center;
  padding: 40px 24px;
}

.waiting-glass {
  margin: 0 auto 28px;
  width: 80px;
  height: 80px;
}

.waiting-glass svg {
  width: 80px;
  height: 80px;
}

.waiting-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.7rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.waiting-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Pulse animation */
@keyframes pulse-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}

.pulse-anim {
  animation: pulse-breathe 2.4s ease-in-out infinite;
}

/* ---- Vote Confirmed State ---- */
.confirmed-state {
  text-align: center;
  padding: 32px 24px;
}

.confirmed-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1a8b3a, #22a847);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  box-shadow: 0 4px 20px rgba(26,139,58,0.30);
}

.confirmed-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.8rem;
  color: #1a6b2a;
  margin-bottom: 8px;
}

.confirmed-score-display {
  background: rgba(139,26,26,0.06);
  border: 1px solid rgba(139,26,26,0.15);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0;
  display: inline-block;
  min-width: 160px;
}

.confirmed-score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.confirmed-score-value {
  font-family: 'EB Garamond', serif;
  font-size: 2rem;
  color: var(--wine-red);
  font-weight: 600;
}

.confirmed-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
}

/* ---- Counter Badge ---- */
.counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(26,39,68,0.08);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 500;
  margin-top: 12px;
}

/* ---- Completed State ---- */
.completed-state {
  text-align: center;
  padding: 40px 24px;
}

.completed-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.8rem;
  color: var(--navy);
  margin-bottom: 12px;
}

.completed-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.trophy-icon { font-size: 3rem; margin-bottom: 16px; }

/* ---- Responsive tablet ---- */
@media (min-width: 520px) {
  .voter-main { padding: 32px 24px 48px; }
  .card { padding: 36px 32px; }
  .star-btn svg { width: 56px; height: 56px; }
  .stars-row { gap: 12px; }
}
