/* ============================================================
   MAPPA DELLE ENERGIE — style.css
   Condiviso tra index.html e risultato.php
   ============================================================ */

:root {
  --rosso:    #E8402A;
  --arancione:#E87D2A;
  --giallo:   #D4A820;
  --verde:    #3A8C4E;
  --blu:      #2A5BAE;
  --indaco:   #5A3A9E;
  --viola:    #8E3A8E;
  --bg:       #FAF8F4;
  --ink:      #1A1714;
  --muted:    #7A7470;
  --border:   #E0DAD4;
  --card:     #FFFFFF;
}

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

body {
  font-family: 'Jost', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- HEADER ---- */
.site-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.site-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  letter-spacing: .08em;
  color: var(--ink);
}
.site-header p {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .4rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---- PROGRESS BAR (quiz) ---- */
.progress-wrap {
  padding: .8rem 2rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .4rem;
  letter-spacing: .04em;
}
.progress-bar-bg {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  width: 0%;
}

/* ---- MAIN ---- */
main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

/* ---- SCREENS (quiz) ---- */
.screen { display: none; width: 100%; max-width: 640px; }
.screen.active { display: block; animation: fadeUp .4s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- INTRO CARD ---- */
.intro-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}
.intro-card .rainbow-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.5rem;
}
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.intro-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: .8rem;
}
.intro-card p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ---- FORM ---- */
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label {
  display: block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .4rem;
}
.form-group input {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Jost', sans-serif;
  font-size: .95rem;
  background: var(--bg);
  color: var(--ink);
  transition: border-color .2s;
  outline: none;
}
.form-group input:focus { border-color: var(--ink); }

/* ---- QUESTION CARD ---- */
.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2rem 1.5rem;
}
.q-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.4rem;
}
.q-color-badge {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.q-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.question-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 400;
  line-height: 1.55;
  margin-bottom: 1.8rem;
  color: var(--ink);
}
.options { display: flex; flex-direction: column; gap: .6rem; }
.option-btn {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: .95rem;
  color: var(--ink);
  transition: all .15s ease;
  text-align: left;
  width: 100%;
}
.option-btn:hover { border-color: var(--ink); background: var(--card); }
.option-btn.selected { border-color: var(--ink); background: var(--ink); color: #fff; }
.option-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.option-btn.selected .option-dot::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  display: block;
}

/* ---- BOTTONI ---- */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}
.btn {
  padding: .65rem 1.6rem;
  border-radius: 6px;
  font-family: 'Jost', sans-serif;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: .04em;
  transition: all .15s;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { opacity: .85; }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }
.btn-start { width: 100%; padding: .9rem; font-size: 1rem; margin-top: 1rem; }

/* ---- LOADING ---- */
.loading-screen { text-align: center; padding: 4rem 2rem; }
.spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.2rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- ERROR ---- */
.error-msg {
  background: #FFF0EE;
  border: 1px solid #FBCFC8;
  color: #C0392B;
  border-radius: 6px;
  padding: .7rem 1rem;
  font-size: .85rem;
  margin-top: .8rem;
  display: none;
}

/* ---- RISULTATO: container ---- */
.container { max-width: 700px; margin: 0 auto; padding: 2rem 1rem 4rem; }

/* ---- RISULTATO: hero ---- */
.hero-card {
  border-radius: 12px;
  padding: 2.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  background: var(--dominant);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.15);
}
.hero-card > * { position: relative; }
.hero-eyebrow {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .8;
  margin-bottom: .5rem;
}
.hero-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 300;
  letter-spacing: .06em;
  margin-bottom: .3rem;
}
.hero-significato { font-size: 1rem; opacity: .85; letter-spacing: .06em; margin-bottom: 1.5rem; }
.hero-greeting { font-size: .9rem; opacity: .9; line-height: 1.5; }
.hero-actions {
  display: flex;
  gap: .8rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.btn-hero {
  padding: .6rem 1.4rem;
  border-radius: 6px;
  font-family: 'Jost', sans-serif;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: .04em;
  text-decoration: none;
  transition: opacity .15s;
  border: 1.5px solid rgba(255,255,255,.6);
  color: #fff;
  background: rgba(255,255,255,.15);
}
.btn-hero:hover { opacity: .8; }
.btn-hero.solid { background: #fff; color: var(--dominant); border-color: #fff; }

/* ---- RISULTATO: tabella ---- */
.section-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 1rem;
  margin-top: 2rem;
}
.results-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.result-row {
  display: grid;
  grid-template-columns: 28px 1fr auto 140px;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; }
.result-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.result-name { font-size: .9rem; font-weight: 500; }
.result-sig { font-size: .75rem; color: var(--muted); }
.result-points { font-size: .9rem; font-weight: 500; text-align: right; white-space: nowrap; }
.chakra-bar-wrap { display: flex; align-items: center; gap: .5rem; }
.chakra-bar-bg { flex: 1; height: 6px; background: #F0EDE8; border-radius: 3px; overflow: hidden; }
.chakra-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.chakra-pct { font-size: .75rem; color: var(--muted); min-width: 36px; text-align: right; }

/* ---- FOOTER ---- */
.page-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 500px) {
  .question-card { padding: 1.5rem 1.2rem; }
  .intro-card    { padding: 1.8rem 1.2rem; }
  .result-row    { grid-template-columns: 10px 1fr auto; }
  .chakra-bar-wrap { display: none; }
}

@media print {
  .btn-hero, .hero-actions { display: none; }
  body { background: #fff; }
}