*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f4f8; color: #333; line-height: 1.5; font-size: 15px; }
#wrap { max-width: 780px; margin: 0 auto; padding: 24px 16px 80px; }

#page-header { background: #fff; border: 1px solid #dde3ec; border-radius: 8px 8px 0 0; padding: 32px 36px 24px; text-align: center; }
#page-header h1 { font-size: 1.35rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #111; margin-bottom: 5px; }
.sottotitolo { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #4274b5; }

#tipo-select-card { background: #fff; border: 1px solid #dde3ec; border-top: none; padding: 22px 36px; }
.tipo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tipo-card { border: 2px solid #c8d0dc; border-radius: 8px; padding: 15px 18px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: border-color .18s, background .18s; }
.tipo-card:has(input:checked) { border-color: #4274b5; background: #eef3fc; }
.tipo-card input[type="radio"] { accent-color: #4274b5; width: 17px; height: 17px; cursor: pointer; flex-shrink: 0; }
.tipo-label { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.tipo-sub { font-size: .77rem; color: #888; }

#forms-container { background: #fff; border: 1px solid #dde3ec; border-top: none; border-radius: 0 0 8px 8px; }
#form-vc, #form-spo { display: none; padding: 0 36px 40px; }

@media(max-width:600px) {
    #page-header, #tipo-select-card { padding-left: 18px; padding-right: 18px; }
    #form-vc, #form-spo { padding-left: 18px; padding-right: 18px; }
    .tipo-grid { grid-template-columns: 1fr; }
}

.sezione { padding-top: 28px; }
.sez-titolo { font-size: .71rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #4274b5; border-bottom: 2px solid #4274b5; padding-bottom: 7px; margin-bottom: 20px; }

.row { margin-bottom: 18px; }
.c2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media(max-width:560px) { .c2 { grid-template-columns: 1fr; } }

.campo { display: flex; flex-direction: column; gap: 5px; }
.campo > label.flabel { font-size: .88rem; font-weight: 600; color: #222; }
.req { color: #c53030; margin-left: 2px; }
.hint { font-size: .73rem; color: #888; line-height: 1.3; }

input[type="text"], input[type="email"], input[type="date"],
input[type="number"], select, textarea {
    padding: 9px 11px; border: 1px solid #c8d0dc; border-radius: 5px;
    font-size: .9rem; color: #333; background: #fafbfc; outline: none;
    transition: border-color .18s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: #4274b5; background: #fff; }
textarea { min-height: 90px; resize: vertical; }

.sub-row { display: flex; gap: 10px; }
.sc { display: flex; flex-direction: column; gap: 3px; }
.sc input { min-width: 0; }
.sc-lbl { font-size: .68rem; color: #888; line-height: 1.2; }
.sc.pfx  { flex: 0 0 88px; }
.sc.pfxc { flex: 0 0 106px; }
.sc.num  { flex: 1; }

.upload-wrap { border: 2px dashed #c8d0dc; border-radius: 8px; padding: 26px 18px; text-align: center; background: #f9fbfd; cursor: pointer; position: relative; transition: border-color .2s; }
.upload-wrap:hover { border-color: #4274b5; }
.upload-wrap input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.upl-icon { font-size: 1.8rem; color: #aab; margin-bottom: 7px; }
.upl-title { font-weight: 700; font-size: .9rem; color: #4274b5; margin-bottom: 2px; }
.upl-sub { font-size: .77rem; color: #bbb; }
.upl-nome { font-size: .78rem; color: #2d6a4f; font-weight: 600; min-height: 15px; margin-top: 5px; }

.cl { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.cl label { display: flex; align-items: center; gap: 9px; font-size: .9rem; cursor: pointer; }
.cl input { accent-color: #4274b5; width: 15px; height: 15px; flex-shrink: 0; }
.rg { display: flex; gap: 22px; margin-top: 5px; }
.rg label { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.rg input { accent-color: #4274b5; width: 16px; height: 16px; }

.gdpr-box { background: #f8fafc; border: 1px solid #dde3ec; border-radius: 6px; padding: 16px; margin-top: 4px; }
.gdpr-box label { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; }
.gdpr-box input { accent-color: #4274b5; margin-top: 3px; flex-shrink: 0; width: 15px; height: 15px; }
.gdpr-box span { font-size: .83rem; line-height: 1.45; color: #444; }

.sbtn { display: block; width: 100%; padding: 14px; margin-top: 28px; background: #2c3e7a; color: #fff; border: none; border-radius: 6px; font-size: 1.02rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: background .2s; }
.sbtn:hover:not(:disabled) { background: #1e2e5c; }
.sbtn:disabled { background: #9aacce; cursor: not-allowed; }

.prog-wrap { display: none; height: 5px; background: #eef3fc; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.prog-fill { height: 100%; width: 0; background: #4274b5; transition: width .4s; border-radius: 3px; }

.err-banner { display: none; background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; border-radius: 6px; padding: 12px 16px; margin-top: 16px; font-size: .88rem; line-height: 1.4; }

.hp { display: none !important; }
/* select multiplo: niente freccia, altezza fissa */
select[multiple] { appearance: none; -webkit-appearance: none; min-height: 130px;
    background-image: none; padding-right: 11px; }
/* select con freccia personalizzata per coerenza cross-browser */
select:not([multiple]) { appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px; }

/* ── Aggiunte della versione online (messaggi al posto del modulo) ── */
.msg-box { background: #fff; border: 1px solid #dde3ec; border-radius: 8px;
    padding: 60px 36px; text-align: center; margin-top: 24px; }
.msg-icona { font-size: 2.6rem; color: #b45309; margin-bottom: 14px; font-weight: 700; }
.msg-titolo { color: #1f3a5f; font-size: 1.3rem; margin-bottom: 10px; }
.msg-testo { color: #52637a; font-size: .95rem; max-width: 480px; margin: 0 auto; }
