/* ─── PRAI Anagrafica UM — CSS v2.0 ─── */

/* Header form */
.prai-header {
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid #e5e7eb;
}
.prai-header-logo {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #1d4ed8;
    margin-bottom: 2px;
}
.prai-header-sub {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: .8rem;
}
.prai-header-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 .3rem !important;
    padding: 0 !important;
    border: none !important;
}
.prai-header-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ── Contenitore extra ── */
#prai-extra-fields {
    margin-top: 1.5rem;
    border-top: 1px dashed #d1d5db;
    padding-top: 1.2rem;
}

/* ── Titoli sezione ── */
.prai-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 1.4rem 0 .7rem;
    padding-bottom: .4rem;
    border-bottom: 1.5px solid #dbeafe;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ── Copia sede ── */
.prai-copy-lbl {
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}
.prai-copy-lbl input[type="checkbox"] {
    accent-color: #2563eb;
    cursor: pointer;
    margin: 0;
}

/* ── Grid righe ── */
.prai-row {
    display: grid;
    gap: 12px;
    margin-bottom: 0;
}
.prai-r2 { grid-template-columns: 1fr 1fr; }
.prai-r3 { grid-template-columns: 2fr 1fr 1fr; }

/* ── Campo singolo ── */
.prai-field {
    margin-bottom: .9rem;
}
.prai-field-full {
    grid-column: 1 / -1;
}
.prai-field > label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 4px !important;
}
.prai-req {
    color: #dc2626;
}

/* ── Input ── */
.prai-field input[type="text"],
.prai-field input[type="email"],
.prai-field input[type="tel"] {
    width: 100% !important;
    padding: 9px 11px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #111827 !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s !important;
}
.prai-field input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15) !important;
}
.prai-field input.prai-ok {
    border-color: #16a34a !important;
}
.prai-field input.prai-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}

/* ── Messaggi errore ── */
.prai-err {
    font-size: 11px;
    color: #dc2626;
    min-height: 14px;
    margin-top: 3px;
    line-height: 1.4;
}

/* ── Checkbox categoria ── */
.prai-checkgroup {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.prai-check-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #374151;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: background .1s, border-color .1s;
    user-select: none;
}
.prai-check-item:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}
.prai-check-item input[type="checkbox"] {
    accent-color: #2563eb;
    width: 15px;
    height: 15px;
    cursor: pointer;
    margin: 0;
}
.prai-check-item.prai-checked {
    background: #dbeafe;
    border-color: #2563eb;
    color: #1e40af;
    font-weight: 500;
}

/* ── Utente loggato ── */
.prai-logged-in {
    padding: 1.5rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    font-size: 15px;
    color: #166534;
}
.prai-logged-in p { margin: 0 0 1rem; }
.prai-btn-link {
    display: inline-block;
    padding: 9px 18px;
    background: #1d4ed8;
    color: #fff !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    margin-right: 8px;
    transition: background .15s;
}
.prai-btn-link:hover { background: #1e40af; }
.prai-btn-secondary { background: #6b7280 !important; }
.prai-btn-secondary:hover { background: #4b5563 !important; }

/* ── Link login sotto il form ── */
.prai-login-link {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-top: 1rem;
}
.prai-login-link a {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
}
.prai-login-link a:hover { text-decoration: underline; }

/* ── Radio tipo soggetto ── */
.prai-radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.prai-radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
    min-width: 180px;
    transition: border-color .15s, background .15s;
    position: relative;
}
.prai-radio-item:hover { border-color: #93c5fd; background: #f0f9ff; }
.prai-radio-item.prai-radio-checked { border-color: #2563eb; background: #dbeafe; }
.prai-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.prai-radio-icon { font-size: 24px; line-height: 1; }
.prai-radio-label {
    display: flex;
    flex-direction: column;
    font-size: 15px;
    font-weight: 600;
    color: #1e3a5f;
}
.prai-radio-label small {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    margin-top: 2px;
}
.prai-radio-item.prai-radio-checked .prai-radio-label { color: #1d4ed8; }

/* ── Box errori form ── */
.prai-form-errors {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    font-size: 14px;
    color: #991b1b;
}
.prai-form-errors strong { display: block; margin-bottom: .5rem; }
.prai-form-errors ul { margin: 0; padding-left: 1.2rem; }
.prai-form-errors li { margin-bottom: 3px; }

/* ── Box informativo ── */
.prai-info-box {
    display: flex;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}
.prai-info-icon {
    font-size: 20px;
    color: #2563eb;
    flex-shrink: 0;
    line-height: 1.4;
}
.prai-info-text p {
    margin: 0 0 .5rem;
    font-size: 14px;
    color: #1e3a5f;
    line-height: 1.5;
}
.prai-info-text p:last-child { margin-bottom: 0; }
.prai-info-warning {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #92400e !important;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    padding: 6px 10px;
}

/* ── reCAPTCHA badge — nascosto globalmente, visibile solo su pagina registrazione ── */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
/* Nota legale reCAPTCHA sotto il form */
.prai-recaptcha-note {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    margin-top: .5rem;
}
.prai-recaptcha-note a { color: #6b7280; }
.prai-privacy-field {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.prai-privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
}
.prai-privacy-label input[type="checkbox"] {
    accent-color: #2563eb;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 3px;
    cursor: pointer;
}
.prai-privacy-label a {
    color: #2563eb;
    text-decoration: underline;
}
.prai-privacy-label a:hover { color: #1d4ed8; }

/* ── Genera password ── */
.prai-gen-lbl {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    margin-top: 4px;
}
.prai-gen-lbl input { accent-color: #2563eb; cursor: pointer; }

/* ── Messaggio successo ── */
.prai-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    font-size: 15px;
    color: #166534;
    margin-bottom: 1rem;
}
@media (max-width: 600px) {
    .prai-r2,
    .prai-r3 {
        grid-template-columns: 1fr;
    }
    .prai-section-title {
        flex-wrap: wrap;
    }
    .prai-copy-lbl {
        margin-left: 0;
    }
}
