/* ============================================================
   verifica-form.css — Form multi-step verifica identità
   ============================================================ */

/* Wrapper */
.vif-wrapper {
    max-width: 700px;
    margin: 0 auto;
    font-family: inherit;
}

/* ── Progress bar ── */
.vif-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0;
}

.vif-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.vif-progress-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #777;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .3s, color .3s;
}

.vif-progress-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    transition: color .3s;
}

.vif-progress-connector {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin: 0 8px;
    margin-bottom: 18px;
    transition: background .3s;
}

/* Active step */
.vif-progress-step.vif-active .vif-progress-num {
    background: #2175d9;
    color: #fff;
}

.vif-progress-step.vif-active .vif-progress-label {
    color: #2175d9;
    font-weight: 600;
}

/* Done step */
.vif-progress-step.vif-done .vif-progress-num {
    background: #28a745;
    color: #fff;
}

.vif-progress-step.vif-done .vif-progress-num::after {
    content: '✓';
    font-size: 14px;
}

.vif-progress-step.vif-done .vif-progress-num span {
    display: none;
}

.vif-progress-step.vif-done + .vif-progress-connector {
    background: #28a745;
}

/* ── Steps ── */
.vif-step {
    display: none;
}

.vif-step.vif-step-active {
    display: block;
}

.vif-step h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid #f0f0f0;
}

/* ── Fields & rows ── */
.vif-row {
    margin-bottom: 1.2rem;
}

.vif-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 540px) {
    .vif-row-2 {
        grid-template-columns: 1fr;
    }
}

.vif-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vif-field label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.vif-field input[type="text"],
.vif-field input[type="date"],
.vif-field select {
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    box-sizing: border-box;
}

.vif-field input:focus,
.vif-field select:focus {
    border-color: #2175d9;
    box-shadow: 0 0 0 3px rgba(33, 117, 217, .15);
    outline: none;
}

.vif-field input.vif-invalid,
.vif-field select.vif-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .1);
}

/* ── Upload area ── */
.vif-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fafafa;
    position: relative;
}

.vif-upload-area:hover,
.vif-upload-area.vif-dragover {
    border-color: #2175d9;
    background: #f0f6ff;
}

.vif-upload-area.vif-has-file {
    border-color: #28a745;
    background: #f0fff4;
}

.vif-upload-icon {
    font-size: 2rem;
    margin-bottom: .4rem;
}

.vif-upload-area p {
    margin: 0;
    font-size: 13px;
    color: #555;
}

.vif-upload-hint {
    font-size: 11px !important;
    color: #999 !important;
    margin-top: 4px !important;
}

.vif-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* ── Preview immagine ── */
.vif-preview {
    margin-top: 8px;
}

.vif-preview img {
    max-width: 100%;
    max-height: 160px;
    border-radius: 5px;
    border: 1px solid #ddd;
    display: block;
}

/* ── Note privacy ── */
.vif-privacy-note {
    background: #f0f6ff;
    border: 1px solid #c8dff8;
    border-radius: 6px;
    padding: 12px 14px;
    margin: 1rem 0;
}

.vif-privacy-note p {
    margin: 0;
    font-size: 12px;
    color: #444;
    line-height: 1.5;
}

/* ── Actions (bottoni) ── */
.vif-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.vif-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, opacity .2s;
    text-decoration: none;
}

.vif-btn-next,
.vif-btn-submit {
    background: #2175d9;
    color: #fff;
}

.vif-btn-next:hover,
.vif-btn-submit:hover {
    background: #1a65bf;
}

.vif-btn-back {
    background: #f0f0f0;
    color: #444;
}

.vif-btn-back:hover {
    background: #e0e0e0;
}

.vif-btn:disabled {
    opacity: .6;
    cursor: default;
}

/* ── Messaggi ── */
.vif-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: .9rem 1rem;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 1rem;
}

.vif-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: .9rem 1rem;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 1rem;
}

/* ── Link GDPR ── */
.vif-gdpr-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.vif-gdpr-link a {
    font-size: 12px;
    color: #999;
    text-decoration: underline;
}

.vif-gdpr-link a:hover {
    color: #555;
}

/* ── Tooltip help ── */
.vif-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #aaa;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    cursor: default;
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
    flex-shrink: 0;
}

.vif-help:hover {
    background: #2175d9;
}

.vif-tooltip {
    display: none;
    position: absolute;
    left: 22px;
    top: -8px;
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 5px;
    width: 240px;
    z-index: 9999;
    white-space: normal;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    pointer-events: none;
}

.vif-tooltip::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 12px;
    border: 6px solid transparent;
    border-right-color: #1a1a1a;
    border-left: 0;
}

.vif-help:hover .vif-tooltip {
    display: block;
}

/* ── Sesso radio group ── */
.vif-radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 4px;
}

.vif-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
}

.vif-radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2175d9;
}

/* ── Stesso paese checkbox ── */
.vif-checkbox-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
}

.vif-checkbox-hint input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #2175d9;
    flex-shrink: 0;
}

/* ── Lightbox immagini documenti ── */
#vi-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.88);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

#vi-lightbox.open {
    display: flex;
}

#vi-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    cursor: default;
}

#vi-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
    background: none;
    border: none;
    padding: 4px 8px;
}

/* ── Autocomplete widget (vif-autocomplete.js) ── */
.vif-ac-wrap {
    position: relative;
}

.vif-ac-input {
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    box-sizing: border-box;
}

.vif-ac-input:focus {
    border-color: #2175d9;
    box-shadow: 0 0 0 3px rgba(33, 117, 217, .15);
    outline: none;
}

.vif-ac-input.vif-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .1);
}

.vif-ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
}

.vif-ac-item {
    padding: 9px 12px;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}

.vif-ac-item:hover,
.vif-ac-item.vif-ac-active {
    background: #f0f6ff;
    color: #2175d9;
}

.vif-ac-noresult {
    padding: 9px 12px;
    font-size: 13px;
    color: #888;
    font-style: italic;
}
