/* Questionario di candidatura: stesso inchiostro, stessa carta e stesso giallo della pagina di Frank.
   Usa le variabili e i pulsanti (.btn, .btn-2) definiti nella pagina: qui solo quello che serve al dialogo. */

html.qz-aperto { overflow: hidden; }
.qz, .qz *, .qz *::before, .qz *::after { box-sizing: border-box; }
/* Il marchio del reCAPTCHA coprirebbe la barra in basso sul telefono: si nasconde, e la dicitura di Google
   sta sotto il consenso (lo consentono le regole di reCAPTCHA). */
.grecaptcha-badge { visibility: hidden; }
.qz-recaptcha { margin: 0; font-size: .82rem; line-height: 1.4; color: var(--muted); }
.qz-recaptcha a { color: inherit; }

.qz {
  width: min(42rem, calc(100% - 2rem)); max-width: none; max-height: min(92vh, 54rem);
  margin: auto; padding: 0; border: 2px solid var(--ink); border-radius: 16px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 24px 60px -24px rgba(21, 23, 28, .55);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-optical-sizing: auto;
}
.qz[open] { display: flex; }
.qz::backdrop { background: rgba(21, 23, 28, .55); backdrop-filter: blur(2px); }
.qz-form { display: flex; flex-direction: column; width: 100%; min-height: 0; }

/* testata: titolo a mano col tratto giallo, chiusura, avanzamento */
.qz-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem 0; }
.qz-k { margin: 0; font: 700 1.6rem/1.1 var(--font-hand); }
.qz-k::after { content: ""; display: block; width: 7.5em; max-width: 100%; height: .28em; margin-top: .12em; background: var(--signal); border-radius: 999px; transform: rotate(-1deg); }
.qz-x { flex: none; width: 2.75rem; height: 2.75rem; margin: -.35rem -.5rem 0 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.qz-x:hover { background: var(--paper-2); }
.qz-x svg { width: 1.4rem; height: 1.4rem; }
.qz-prog { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.25rem 0; font: 600 .9rem/1 var(--font-disp); color: var(--muted); font-variant-numeric: tabular-nums; }
.qz-prog-n { flex: none; min-width: 3.2em; }
.qz-bar { flex: 1; height: .6rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.qz-bar-in { display: block; height: 100%; width: 0; background: var(--signal); transition: width .25s ease; }

/* corpo: una domanda per schermata */
.qz-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.4rem 1.25rem 1.25rem; }
.qz-step { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.qz-step:not(.qz-attivo) { display: none; }
.qz-step.qz-entra { animation: qz-entra .22s ease both; }
@keyframes qz-entra { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.qz-q { padding: 0; margin: 0 0 .1rem; font: 800 clamp(1.5rem, 4.2vw, 2rem)/1.1 var(--font-disp); letter-spacing: -.015em; text-wrap: balance; }
.qz-q:focus { outline: none; }
.qz-hint { margin: -.35rem 0 0; color: var(--muted); }

/* scelte: schede grandi, la scelta fatta diventa un pulsante giallo */
.qz-opts { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 600px) {
  .qz-opts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qz-opts-row { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
}
.qz-opt {
  position: relative; display: flex; align-items: center; gap: .75rem; min-height: 3.25rem; padding: .75rem 1rem;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); cursor: pointer;
  font: 600 1.05rem/1.3 var(--font-disp);
  transition: background-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.qz-opt:hover { background: var(--paper-2); }
.qz-opt input, .qz-privacy input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.qz-mark { flex: none; position: relative; width: 1.3rem; height: 1.3rem; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
.qz-mark-c { border-radius: 4px; }
.qz-opt:has(input:checked) { background: var(--signal); color: var(--on-signal); box-shadow: 0 4px 0 var(--ink); transform: translateY(-1px); }
.qz-opt:has(input:checked) .qz-mark { background: var(--ink); border-color: var(--ink); }
.qz-opt:has(input:checked) .qz-mark::after,
.qz-privacy:has(input:checked) .qz-mark::after { content: ""; position: absolute; inset: 0; margin: auto; }
.qz-opt:has(input[type=radio]:checked) .qz-mark::after { width: .45rem; height: .45rem; border-radius: 50%; background: var(--signal); }
.qz-opt:has(input[type=checkbox]:checked) .qz-mark::after,
.qz-privacy:has(input:checked) .qz-mark::after { width: .38rem; height: .7rem; border: solid var(--signal); border-width: 0 2.5px 2.5px 0; transform: translateY(-.08rem) rotate(45deg); }
.qz-privacy:has(input:checked) .qz-mark { background: var(--ink); }
.qz-opt:has(input:focus-visible), .qz-privacy:has(input:focus-visible) .qz-mark { outline: 3px solid var(--ink); outline-offset: 3px; }

/* campi di testo */
.qz-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.qz-lab { font: 700 .98rem/1.3 var(--font-disp); }
.qz-fac { font-weight: 500; color: var(--muted); }
.qz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qz-in {
  width: 100%; box-sizing: border-box; min-height: 3.25rem; padding: .75rem .95rem; margin: 0;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink);
  font: 400 1.1rem/1.45 var(--font-body);
  -webkit-appearance: none; appearance: none;
}
textarea.qz-in { min-height: 8rem; resize: vertical; }
.qz-in::placeholder { color: var(--muted); opacity: .8; }
.qz-in:focus { outline: none; box-shadow: 0 0 0 4px var(--hl); }
.qz-in[aria-invalid="true"] { border-color: var(--red); }
.qz-grid { display: grid; grid-template-columns: 1fr; gap: .9rem; }
@media (min-width: 600px) { .qz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qz-wide { grid-column: 1 / -1; } }

.qz-privacy { position: relative; display: flex; align-items: flex-start; gap: .75rem; font-size: .98rem; line-height: 1.45; cursor: pointer; margin-top: .25rem; }
.qz-privacy .qz-mark { margin-top: .12rem; }
.qz-privacy a { font-weight: 600; }

.qz-err { margin: 1rem 0 0; font: 600 .98rem/1.35 var(--font-disp); color: var(--red); }
.qz-err:empty { display: none; }

/* piede: indietro e avanti sempre a portata di pollice */
.qz-nav {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .9rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1.5px solid var(--rule); background: var(--paper);
}
.qz-nav .btn { align-self: auto; }
.qz-indietro { min-height: 3rem; padding-inline: 1.1rem; font-size: 1rem; }
.qz-indietro[aria-hidden="true"] { visibility: hidden; }
.qz-avanti, .qz-invia { margin-left: auto; }
.qz-invia[aria-busy="true"] { opacity: .75; cursor: progress; }

@media (max-width: 560px) {
  .qz { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .qz-q { font-size: 1.45rem; }
  .qz-nav .btn { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .qz-step.qz-entra { animation: none; }
  .qz-bar-in, .qz-opt { transition: none; }
}
