/* ============================================
   GRU A TORRE - Camardo Formazione
   Style Pro Gold/Dark
   ============================================ */
:root {
  --bg: #0a0e1a;
  --bg-soft: #121825;
  --card: #1a2137;
  --gold: #d4af37;
  --gold-soft: #b8941f;
  --gold-dim: rgba(212, 175, 55, 0.15);
  --text: #e8e6e0;
  --text-dim: #a8a6a0;
  --ok: #4ade80;
  --err: #ef4444;
  --warn: #f59e0b;
  --border: rgba(212, 175, 55, 0.25);
  --shadow: 0 10px 40px rgba(0,0,0,0.5);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overscroll-behavior: none;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(212,175,55,0.08), transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(212,175,55,0.05), transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  position: relative;
  z-index: 1;
}
h1, h2, h3 { font-weight: 700; color: var(--gold); letter-spacing: 0.3px; }
h1 { font-size: 1.8rem; margin-bottom: 8px; }
h2 { font-size: 1.3rem; margin: 20px 0 12px; }
p { color: var(--text); }
.logo {
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
}
.subtitle { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.card:hover { border-color: var(--gold); }
.card.clickable { cursor: pointer; }
.card.clickable:active { transform: scale(0.98); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #0a0e1a;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(212,175,55,0.3);
  width: 100%;
  margin-top: 8px;
}
.btn:active { transform: scale(0.97); }
.btn.secondary {
  background: var(--bg-soft);
  color: var(--gold);
  border: 1px solid var(--gold);
  box-shadow: none;
}
.btn.small { padding: 8px 14px; font-size: 0.9rem; width: auto; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 6px;
}
.badge.ok { background: rgba(74,222,128,0.2); color: var(--ok); }
.badge.err { background: rgba(239,68,68,0.2); color: var(--err); }

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* === Slide specific === */
.slide-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.slide-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}
.slide-counter {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}
.slide-progress {
  height: 4px;
  background: var(--bg-soft);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.slide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold));
  transition: width .3s;
}
.slide-body {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.slide-title {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 6px;
  font-weight: 700;
}
.slide-subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-style: italic;
}
.slide-icon {
  font-size: 3rem;
  text-align: center;
  margin: 20px 0;
  filter: drop-shadow(0 4px 12px rgba(212,175,55,0.4));
}
.slide-note {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  padding: 16px;
  background: var(--bg-soft);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  margin-top: 12px;
}
.slide-ctrl {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.slide-ctrl .btn { flex: 1; min-width: 100px; margin-top: 0; }

.tts-panel {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.tts-btn {
  background: var(--bg-soft);
  color: var(--gold);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.tts-btn.active { background: var(--gold); color: #0a0e1a; }

/* === Quiz specific === */
.q-num {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.q-text {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
}
.q-option {
  display: block;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  font-size: 0.98rem;
  color: var(--text);
}
.q-option:active { transform: scale(0.98); }
.q-option.selected { border-color: var(--gold); background: var(--gold-dim); }
.q-option.correct { border-color: var(--ok); background: rgba(74,222,128,0.12); }
.q-option.wrong { border-color: var(--err); background: rgba(239,68,68,0.12); }

.result-box {
  text-align: center;
  padding: 30px 20px;
}
.result-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  margin: 16px 0;
}
.result-label { color: var(--text-dim); font-size: 0.95rem; }
.result-pass { color: var(--ok); }
.result-fail { color: var(--err); }

/* === Form === */
.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
  font-family: inherit;
}
.input:focus { outline: none; border-color: var(--gold); }
label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 4px;
  font-weight: 600;
}

/* === Admin === */
.admin-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  align-items: center;
}
@media (max-width: 600px) {
  .admin-row { grid-template-columns: 1fr; }
}

/* === QR === */
#qr-box {
  background: white;
  padding: 16px;
  border-radius: 10px;
  display: inline-block;
  margin: 12px auto;
}

/* === Responsive === */
@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .slide-title { font-size: 1.3rem; }
  .container { padding: 16px 12px 30px; }
}
