/* Questionario stile Typeform: una domanda alla volta */
.q-body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(900px 600px at 100% 0%, var(--soft), transparent 60%), var(--bg); }
.q-progress { position: fixed; inset: 0 0 auto 0; height: 4px; background: var(--line); z-index: 20; }
.q-progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .35s ease; }
.q-top { display: flex; justify-content: space-between; align-items: center; padding: 18px clamp(16px, 4vw, 40px) 0; }
.q-count { font-size: 14px; color: var(--muted); font-weight: 600; }
.q-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px 120px; }
.q-step { width: min(720px, 100%); }
.q-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.q-enter { animation: q-in .35s ease both; }
@keyframes q-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .q-enter { animation: none; } .q-progress-bar { transition: none; } }

.q-num { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.q-title { font: 600 clamp(1.6rem, 3.6vw, 2.3rem)/1.2 var(--head); letter-spacing: -0.02em; margin: 0 0 10px; }
.q-help { color: var(--muted); font-size: 1.02rem; margin: 0 0 26px; max-width: 620px; }
.q-warn { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; font-size: 14.5px; color: var(--ink-2); margin: -10px 0 22px; }

/* Campi */
.q-fields { display: grid; gap: 20px; }
.q-fields-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.q-field { display: grid; gap: 6px; }
.q-field > span { font-size: 14px; font-weight: 600; color: var(--muted); }
.q-input, .q-select, .q-textarea {
  width: 100%; font: 400 1.35rem/1.4 var(--body); color: var(--ink); background: transparent;
  border: 0; border-bottom: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); padding: 8px 2px; border-radius: 0; min-width: 0;
}
.q-select { font-size: 1.15rem; cursor: pointer; }
.q-textarea { font-size: 1.1rem; border: 2px solid color-mix(in srgb, var(--primary) 25%, transparent); border-radius: 14px; padding: 14px 16px; min-height: 170px; resize: vertical; background: var(--surface); }
.q-input:focus, .q-select:focus { outline: none; border-bottom-color: var(--primary); }
.q-textarea:focus { outline: none; border-color: var(--primary); }
.q-input::placeholder, .q-textarea::placeholder { color: #a7a3bd; }
.q-counter { font-size: 13px; color: var(--muted); text-align: right; }

/* Scelte */
.q-options { display: grid; gap: 10px; max-width: 520px; }
.q-option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: 12px; padding: 13px 16px; font: 500 1.05rem/1.3 var(--body); color: var(--ink); transition: background .15s, border-color .15s;
}
.q-option:hover { border-color: var(--primary); }
.q-option[aria-pressed='true'] { background: var(--primary); border-color: var(--primary); color: #fff; }
.q-key { width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; opacity: .75; }
.q-option small { display: block; font-size: 13px; opacity: .75; font-weight: 400; margin-top: 2px; }
.q-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.q-chip { border-radius: 999px; padding: 10px 16px; font: 500 15px/1.2 var(--body); cursor: pointer; background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--primary) 25%, transparent); color: var(--ink); }
.q-chip[aria-pressed='true'] { background: var(--primary); border-color: var(--primary); color: #fff; }
.q-chip:disabled { opacity: .4; cursor: not-allowed; }

/* Piani */
.q-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.q-plan { text-align: left; cursor: pointer; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 20px; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.q-plan:hover { border-color: var(--primary); transform: translateY(-2px); }
.q-plan[aria-pressed='true'] { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.q-plan-kind { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.q-plan strong { font: 600 1.4rem/1.1 var(--head); }
.q-plan-price { font: 700 1.6rem/1 var(--head); margin-top: 4px; }
.q-plan-price small { font: 500 13px var(--body); color: var(--muted); }
.q-plan p { font-size: 14px; color: var(--muted); margin: 0; }
.q-plan ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.q-plan-note { font-size: 13.5px; color: var(--muted); margin-top: 14px; }
@media (max-width: 700px) { .q-plans { grid-template-columns: 1fr; } }

/* Palette */
.q-palettes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.q-palette { cursor: pointer; border: 2px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden; background: var(--surface); text-align: left; font: inherit; color: var(--ink); }
.q-palette[aria-pressed='true'] { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.q-palette-mock { padding: 16px; display: grid; gap: 8px; }
.q-palette-mock i { display: block; height: 10px; border-radius: 4px; }
.q-palette-mock b { display: inline-block; width: 64px; height: 20px; border-radius: 999px; margin-top: 4px; }
.q-palette span { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 14px; font-weight: 600; border-top: 1px solid var(--line); }
.q-swatches { display: flex; gap: 4px; }
.q-swatches em { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
@media (max-width: 640px) { .q-palettes { grid-template-columns: repeat(2, 1fr); } }

/* Foto */
.q-uploads { display: grid; gap: 22px; }
.q-upload-group > span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.q-thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.q-thumb { width: 120px; height: 120px; border-radius: 14px; overflow: hidden; position: relative; background: var(--soft); }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; }
.q-thumb-logo img { object-fit: contain; padding: 10px; background: #fff; }
.q-thumb button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; }
.q-thumb.loading::after { content: 'Caricamento…'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; }
.q-add { width: 120px; height: 120px; border-radius: 14px; border: 2px dashed color-mix(in srgb, var(--primary) 40%, transparent); background: transparent; color: var(--primary); cursor: pointer; font: 600 14px/1.3 var(--body); display: grid; place-items: center; text-align: center; padding: 10px; }
.q-add:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }

/* Servizi */
.q-services { display: grid; gap: 14px; }
.q-service { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; display: grid; grid-template-columns: 1fr 110px 110px 36px; gap: 12px; align-items: end; }
.q-service .q-field:nth-child(2) { grid-column: 1 / -2; grid-row: 2; }
.q-service .q-input { font-size: 1.05rem; }
.q-remove { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: none; cursor: pointer; color: var(--muted); font-size: 16px; }
.q-link-btn { background: none; border: 0; color: var(--primary); font: 700 15px var(--body); cursor: pointer; padding: 6px 0; justify-self: start; }
@media (max-width: 640px) { .q-service { grid-template-columns: 1fr 1fr 36px; } .q-service .q-field:first-child { grid-column: 1 / -1; } .q-service .q-field:nth-child(2) { grid-column: 1 / -1; grid-row: auto; } }

/* Azioni */
.q-actions { display: flex; align-items: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.q-ok { font-size: 17px; padding: 13px 26px; }
.q-hint { font-size: 13px; color: var(--muted); }
.q-hint kbd { font: 600 12px var(--body); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.q-skip { background: none; border: 0; color: var(--muted); font: 600 15px var(--body); cursor: pointer; text-decoration: underline; }
.q-error { color: #b23a2e; font-weight: 600; font-size: 15px; margin-top: 14px; min-height: 1.4em; }
.q-consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink-2); margin-top: 6px; cursor: pointer; }
.q-consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; }

.q-arrows { position: fixed; right: clamp(16px, 4vw, 40px); bottom: 24px; display: flex; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 20px -10px rgba(0,0,0,.4); }
.q-arrows button { width: 44px; height: 40px; border: 0; background: var(--primary); color: #fff; font-size: 18px; cursor: pointer; }
.q-arrows button + button { border-left: 1px solid rgba(255,255,255,.25); }
.q-arrows button:disabled { opacity: .45; cursor: default; }

/* Intro, attesa e risultato */
.q-intro h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 14px 0 16px; }
.q-intro p { color: var(--muted); font-size: 1.12rem; max-width: 560px; }
.q-intro ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; color: var(--ink-2); }
.q-intro li::before { content: '\2713'; color: var(--primary); font-weight: 800; margin-right: 10px; }
.q-wait { text-align: center; }
.q-spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--soft); border-top-color: var(--primary); margin: 0 auto 26px; animation: q-spin 1s linear infinite; }
@keyframes q-spin { to { transform: rotate(360deg); } }
.q-wait-list { list-style: none; padding: 0; margin: 24px auto 0; display: grid; gap: 10px; max-width: 320px; text-align: left; color: var(--muted); }
.q-wait-list li.done { color: var(--ink); }
.q-wait-list li.done::before { content: '\2713'; color: var(--primary); font-weight: 800; margin-right: 10px; }
.q-wait-list li:not(.done)::before { content: '\2022'; margin-right: 14px; }
.q-done { text-align: center; }
.q-done .check-big { margin-bottom: 20px; }
.q-done p { color: var(--muted); max-width: 520px; margin: 0 auto 12px; }
.q-link { display: flex; gap: 8px; max-width: 520px; margin: 22px auto 0; }
.q-link input { flex: 1; min-width: 0; font: 500 14px var(--body); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
