/* La Lingua Madre — stile globale */
:root {
  --nero:        #1a1a2e;
  --blu-scuro:   #16213e;
  --blu-medio:   #0f3460;
  --accent:      #e94560;
  --grigio-bg:   #f7f6f3;
  --grigio-card: #ffffff;
  --testo:       #2d2d2d;
  --testo-muted: #7a7a7a;
  --bordo:       #e2e0db;
  --font-sans:   'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-serif:  'Georgia', 'Times New Roman', serif;
  --radius:      12px;
  --shadow:      0 2px 16px rgba(26,26,46,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--grigio-bg);
  color: var(--testo);
  line-height: 1.7;
}

/* ── Header ── */
.site-header {
  background: var(--nero);
  color: white;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span { color: var(--accent); }

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.875rem;
  margin-left: 1.5rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: white; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--blu-scuro) 0%, var(--nero) 100%);
  color: white;
  text-align: center;
  padding: 4rem 2rem 3rem;
}

.hero-corsia {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 2rem;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Layout principale ── */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── Sezioni esercizi ── */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--testo-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--bordo);
}

.section-title::before {
  content: attr(data-symbol);
  font-size: 1.1rem;
  color: var(--accent);
}

/* ── Card esercizio ── */
.exercise-card {
  background: var(--grigio-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--bordo);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.exercise-card:hover {
  box-shadow: 0 4px 24px rgba(26,26,46,0.13);
}

.card-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--bordo);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.card-num {
  background: var(--nero);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-meta {
  flex: 1;
}

.card-cap {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nero);
  line-height: 1.3;
}

.card-body {
  padding: 1.25rem 1.5rem;
}

.scenario {
  background: var(--grigio-bg);
  border-left: 3px solid var(--blu-medio);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: var(--testo);
  margin-bottom: 1.25rem;
  font-style: italic;
}

.exercise-prompt {
  font-size: 0.875rem;
  color: var(--testo-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

textarea.risposta {
  width: 100%;
  min-height: 110px;
  border: 1.5px solid var(--bordo);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--testo);
  background: white;
  resize: vertical;
  transition: border-color 0.2s;
  outline: none;
}

textarea.risposta:focus {
  border-color: var(--blu-medio);
  box-shadow: 0 0 0 3px rgba(15,52,96,0.1);
}

.card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--nero);
  color: white;
}

.btn-primary:hover {
  background: var(--blu-medio);
}

.btn-ghost {
  background: transparent;
  color: var(--testo-muted);
  border: 1.5px solid var(--bordo);
}

.btn-ghost:hover {
  border-color: var(--nero);
  color: var(--nero);
}

.char-count {
  font-size: 0.75rem;
  color: var(--testo-muted);
  margin-left: auto;
}

/* ── Feedback box ── */
.feedback-box {
  display: none;
  margin-top: 1rem;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.feedback-box.show { display: block; }

.feedback-box.positivo {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.feedback-box.neutro {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.feedback-box.negativo {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.feedback-header {
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Suggerimento ── */
.suggerimento {
  display: none;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #3730a3;
}

.suggerimento.show { display: block; }

.suggerimento strong { display: block; margin-bottom: 0.3rem; }

/* ── Esempio modello ── */
.esempio-modello {
  display: none;
  margin-top: 0.75rem;
}

.esempio-modello.show { display: block; }

.esempio-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--testo-muted);
  margin-bottom: 0.4rem;
}

.esempio-testo {
  background: var(--grigio-bg);
  border: 1px solid var(--bordo);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--testo);
  font-family: var(--font-sans);
  white-space: pre-wrap;
}

/* ── Progress bar ── */
.progress-wrap {
  background: white;
  border: 1px solid var(--bordo);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--testo-muted);
  white-space: nowrap;
}

.progress-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--bordo);
  border-radius: 9px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blu-medio), var(--accent));
  border-radius: 9px;
  width: 0%;
  transition: width 0.5s ease;
}

.progress-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--nero);
  min-width: 36px;
  text-align: right;
}

/* ── Footer ── */
.site-footer {
  background: var(--nero);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  margin-top: 3rem;
}

.site-footer a { color: rgba(255,255,255,0.8); text-decoration: none; }
.site-footer a:hover { color: white; }
.site-footer strong { color: white; }

/* ── Badge corsia ── */
.corsia-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 2rem;
  letter-spacing: 0.07em;
}

.corsia-a { background: #dbeafe; color: #1e40af; }
.corsia-b { background: #ede9fe; color: #5b21b6; }
.corsia-c { background: #fce7f3; color: #9d174d; }

/* ── Tastiera visuale ── */
.checklist {
  list-style: none;
  margin-top: 0.5rem;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  color: var(--testo-muted);
}
.checklist li.ok { color: #166534; }
.checklist li::before { content: '○'; }
.checklist li.ok::before { content: '✓'; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .header-inner { height: 56px; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-stats { gap: 1.5rem; }
  .card-header { flex-direction: column; gap: 0.5rem; }
  .card-num { width: 24px; height: 24px; }
}
