:root {
  --navy: #1a3a5c;
  --navy-dark: #0d2033;
  --gold: #c8a84b;
  --gold-light: #e8c877;
  --white: #ffffff;
  --mute: #6f88a0;
  --green: #2e7d4f;
  --amber: #b8860b;
  --red: #b3402a;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
}

header.brand {
  text-align: center;
  max-width: 720px;
  margin-bottom: 32px;
}

header.brand .eyebrow {
  color: var(--gold-light);
  letter-spacing: 2px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

header.brand h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.2rem;
  margin: 8px 0 6px;
}

header.brand p {
  color: #cfe0ee;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

main#app {
  width: 100%;
  max-width: 620px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(200,168,75,0.35);
  border-radius: var(--radius);
  padding: 32px;
}

.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  margin-bottom: 28px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.3s ease;
}

.question-block .fonte-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--mute);
  border: 1px solid rgba(111,136,160,0.4);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.question-block h2 {
  font-family: Georgia, serif;
  font-size: 1.4rem;
  line-height: 1.4;
  margin: 0 0 24px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.option-btn:hover, .option-btn:focus-visible {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
  outline: none;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--mute);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
}
.btn-back:hover { color: var(--gold-light); }
.btn-back:disabled { visibility: hidden; }

.result-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.result-badge.nessun_obbligo { background: rgba(46,125,79,0.2); color: #7fd9a3; border: 1px solid #2e7d4f; }
.result-badge.obbligo_limitato { background: rgba(184,134,11,0.2); color: #f0c674; border: 1px solid var(--amber); }
.result-badge.obbligo { background: rgba(179,64,42,0.2); color: #f0947e; border: 1px solid var(--red); }

.result-block h2 {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  margin: 0 0 12px;
}

.result-block p.motivo {
  color: #d7e2ee;
  line-height: 1.6;
  margin-bottom: 20px;
}

.icon-preview {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.icon-preview img { height: 70px; }

.refine-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.refine-row button {
  flex: 1;
  min-width: 140px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}
.refine-row button.active {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-primary, .btn-secondary {
  flex: 1;
  min-width: 160px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  color: var(--navy-dark);
}
.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
}
.btn-primary:hover, .btn-secondary:hover { opacity: 0.9; }

.disclaimer {
  font-size: 0.78rem;
  color: var(--mute);
  line-height: 1.5;
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}

footer.site-footer {
  max-width: 620px;
  width: 100%;
  text-align: center;
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--mute);
}
footer.site-footer a {
  color: var(--gold-light);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold-light);
}
footer.site-footer .links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.restart-link {
  text-align: center;
  margin-top: 16px;
}
.restart-link button {
  background: none;
  border: none;
  color: var(--mute);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  header.brand h1 { font-size: 1.7rem; }
  main#app { padding: 22px; }
}
