/* ============================================================================
   SCIA Quiz Funnel — Stile
   Design system: dark #141414, accent #9B51E0, Sora/DM Sans/Inter Tight
   ============================================================================ */

:root {
  --bg: #0E0E0E;
  --bg-elev: #141414;
  --bg-elev-2: #1B1B1B;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #FFFFFF;
  --text-muted: rgba(255, 255, 255, 0.65);
  --text-soft: rgba(255, 255, 255, 0.45);

  --accent: #9B51E0;
  --accent-soft: rgba(155, 81, 224, 0.12);
  --accent-strong: rgba(155, 81, 224, 0.6);
  --accent-glow: rgba(155, 81, 224, 0.35);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-ui: 'Inter Tight', sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s var(--ease); }
a:hover { opacity: 0.8; }

/* ============================================================================
   GLOW DI SFONDO
============================================================================ */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}
.bg-glow--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -200px; left: -200px;
}
.bg-glow--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6E1FCC 0%, transparent 70%);
  bottom: -150px; right: -150px;
}

/* ============================================================================
   HEADER / LOGO
============================================================================ */
.brand-bar {
  padding: 24px 32px;
  position: relative;
  z-index: 2;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
}
.logo-mark {
  color: var(--accent);
  font-size: 20px;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}
.logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  /* logo scuro → bianco per il fondo dark del quiz */
  filter: brightness(0) invert(1) drop-shadow(0 0 12px var(--accent-glow));
}
.logo-text {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.logo-sub {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ============================================================================
   QUIZ SHELL
============================================================================ */
.quiz-shell {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ============================================================================
   STEP — animazioni
============================================================================ */
.step {
  display: none;
  animation: stepIn 0.5s var(--ease-out);
}
.step.is-active {
  display: block;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   STEP INTRO
============================================================================ */
.step--intro {
  text-align: center;
  padding-top: 40px;
}
.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-strong);
  border-radius: 100px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 32px;
}
.intro-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

.intro-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.intro-title .accent {
  background: linear-gradient(135deg, #C58FFF, #9B51E0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-sub {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 40px;
}

.intro-bullets {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================================================
   PROGRESS BAR
============================================================================ */
.progress-wrap {
  margin-bottom: 40px;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}
.progress-pct { color: var(--accent); font-weight: 600; }
.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6E1FCC, var(--accent));
  border-radius: 100px;
  width: 17%;
  transition: width 0.5s var(--ease-out);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================================
   TITOLI STEP
============================================================================ */
.step-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.step-hint {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 32px;
}

/* ============================================================================
   OPZIONI
============================================================================ */
.options { margin-bottom: 32px; }

/* Grid layout */
.options--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.options--grid-2 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 600px) {
  .options--grid, .options--grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Card option */
.option-card {
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.option-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.option-card:hover {
  border-color: var(--accent-strong);
  transform: translateY(-2px);
}
.option-card:hover::before { opacity: 1; }
.option-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 8px 32px var(--accent-glow);
}
.option-card.is-selected::before { opacity: 1; }

.option-icon { font-size: 28px; }
.option-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.option-desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* List option */
.options--list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-row {
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  transition: all 0.25s var(--ease);
}
.option-row:hover {
  border-color: var(--accent-strong);
  transform: translateX(4px);
}
.option-row.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.row-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
}
.option-row.is-selected .row-icon {
  background: rgba(155, 81, 224, 0.2);
}
.row-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.row-content strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.row-content small {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================================================================
   FORM CONTATTI
============================================================================ */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.field .req { color: var(--accent); }

.field input,
.field textarea {
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  width: 100%;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-soft);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input.has-error,
.field textarea.has-error {
  border-color: #FF5A5A;
}
.field textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-body);
}

.field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}
.field--checkbox input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.field--checkbox label {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

/* ============================================================================
   NAVIGATION BUTTONS
============================================================================ */
.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s var(--ease);
  letter-spacing: -0.01em;
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn--primary:not(:disabled):hover {
  background: #B070EC;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn--ghost:not(:disabled):hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--large {
  padding: 18px 32px;
  font-size: 17px;
  border-radius: var(--radius-md);
}

/* ============================================================================
   THANK YOU
============================================================================ */
.step--thanks {
  text-align: center;
  padding: 60px 20px;
}
.thanks-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  animation: thanksPop 0.6s var(--ease-out);
}
@keyframes thanksPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.thanks-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.thanks-sub {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 32px;
}

/* ============================================================================
   FOOTER
============================================================================ */
.footer {
  text-align: center;
  padding: 24px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-soft);
  position: relative;
  z-index: 1;
}

/* ============================================================================
   STATO LOADING SUBMIT
============================================================================ */
.btn.is-loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   ERROR MESSAGE
============================================================================ */
.form-error {
  background: rgba(255, 90, 90, 0.1);
  border: 1px solid rgba(255, 90, 90, 0.3);
  color: #FFB3B3;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============================================================================
   MOBILE
============================================================================ */
@media (max-width: 600px) {
  .brand-bar { padding: 20px; }
  .quiz-shell { padding: 16px 16px 60px; }
  .step--intro { padding-top: 20px; }
  .step-nav { flex-direction: column-reverse; }
  .step-nav .btn { width: 100%; }
  .option-card { padding: 18px 14px; }
  .option-icon { font-size: 24px; }
}


/* ============================================================================
   THANK YOU — riepilogo ricco
============================================================================ */
.thanks-quality-card {
  max-width: 540px;
  margin: 32px auto 36px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 24px 28px;
  text-align: left;
}
.thanks-quality-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.thanks-quality-label {
  font-size: 13px; color: var(--text-muted, #888);
  letter-spacing: .02em;
}
.thanks-quality-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display, 'Inter Tight', sans-serif);
  font-size: 16px; font-weight: 800; letter-spacing: .04em;
  padding: 8px 16px; border-radius: 50px;
  border: 1.5px solid rgba(255,255,255,.1);
}
.thanks-quality-badge.q-hot {
  background: rgba(255, 90, 60, .12); border-color: rgba(255,140,80,.4);
  color: #ff9d70;
}
.thanks-quality-badge.q-warm {
  background: rgba(255,180,87,.12); border-color: rgba(255,180,87,.35);
  color: #ffb457;
}
.thanks-quality-badge.q-cold {
  background: rgba(120,160,255,.1); border-color: rgba(120,160,255,.3);
  color: #92b0ff;
}
.thanks-quality-msg {
  font-size: 14px; line-height: 1.65;
  color: var(--text, #eee);
}

.thanks-steps {
  max-width: 540px; margin: 0 auto 36px;
  text-align: left;
}
.thanks-steps-title {
  font-family: var(--font-display, 'Inter Tight', sans-serif);
  font-size: 14px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent, #9B51E0);
  margin-bottom: 18px; text-align: center;
}
.thanks-steps-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.thanks-steps-list li {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 16px 20px;
}
.thanks-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent, #9B51E0); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display, 'Inter Tight', sans-serif);
  font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.thanks-steps-list strong { font-weight: 600; font-size: 15px; }
.thanks-steps-list small { color: var(--text-muted, #888); font-size: 13px; line-height: 1.5; }
.thanks-steps-list span { color: var(--accent, #9B51E0); font-weight: 600; }

.thanks-cta-row {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 20px;
}
.thanks-cta-row .btn--ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(37,211,102,.1);
  border: 1px solid rgba(37,211,102,.3);
  color: #4be07a;
}
.thanks-cta-row .btn--ghost:hover {
  background: rgba(37,211,102,.18);
  border-color: rgba(37,211,102,.5);
}

.thanks-bonus {
  max-width: 540px; margin: 0 auto;
  padding: 14px 20px; border-radius: 12px;
  background: rgba(255,90,60,.08);
  border: 1px solid rgba(255,140,80,.25);
  font-size: 14px; color: #ffaa80;
  line-height: 1.6;
}
.thanks-bonus strong { color: #ff9d70; }

@media (max-width: 600px) {
  .thanks-quality-card, .thanks-steps { padding-left: 4px; padding-right: 4px; }
  .thanks-quality-row { flex-direction: column; align-items: flex-start; }
  .thanks-cta-row .btn { flex: 1; justify-content: center; }
}
