/* =====================================
   RESET BASE
===================================== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; background: linear-gradient(135deg, #0e4166, #09293f); display: flex; justify-content: center; align-items: center; padding: 20px; }

/* =====================================
   LAYOUT PRINCIPALE
===================================== */
.auth-layout {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* =====================================
   HEADER PRODUZIONE E DISCLAIMER LEGALE
===================================== */
.top-header-prod {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 15px;
    margin-bottom: 25px;
    animation: fadeSlide .5s ease;
}

.nav-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-switcher:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    color: #fff;
}

.legal-copyright {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.15); /* Leggero sfondino per staccarlo dallo sfondo */
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}
.legal-copyright strong { color: rgba(255, 255, 255, 0.95); }

.legal-details {
    margin-top: 6px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.85);
}

.legal-fineprint {
    margin-top: 8px;
    font-size: 9px;
    opacity: 0.6;
    letter-spacing: 0.2px;
    line-height: 1.3;
}

/* =====================================
   CARD FORM CENTRALE (BIG CARD)
===================================== */
.auth-card {
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    overflow: hidden;
    animation: fadeSlide .45s ease;
}

.auth-card.big-card { max-width: 900px; margin: 0 auto; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* =====================================
   TABS E LAYOUT SPLIT
===================================== */
.auth-tabs { display: flex; border-bottom: 1px solid #ddd; background: #f6f7f9; }
.auth-tabs .tab { flex: 1; padding: 16px; font-size: 16px; font-weight: 600; text-align: center; border: none; background: transparent; cursor: pointer; color: #555; transition: all .2s ease; }
.auth-tabs .tab:hover { background: #eaecef; }
.auth-tabs .tab.active { background: #ffffff; color: #0e4166; border-bottom: 3px solid #0e4166; }

.auth-section { display: none; }
.auth-section.active { display: block; }
.hidden { display: none; }

.auth-split-layout { display: flex; flex-direction: row; align-items: stretch; }
.auth-col { flex: 1; padding: 30px; display: flex; flex-direction: column; }
.vertical-divider { width: 1px; background: #e0e0e0; margin: 20px 0; }
.col-header { text-align: center; margin-bottom: 25px; }
.col-header h3 { color: #0e4166; font-size: 20px; margin-bottom: 5px; }
.col-header p { color: #666; font-size: 14px; }

/* =====================================
   FORM E INPUT FIELDS
===================================== */
.auth-form-inline { width: 100%; }
.row-fields { display: flex; gap: 10px; }
.row-fields .field { flex: 1; }

.field { position: relative; margin-bottom: 20px; }
.field input, .field select { width: 100%; padding: 12px 12px; font-size: 14px; border-radius: 10px; border: 1px solid #ccc; outline: none; background: #fff; appearance: none; }
.field input:focus, .field select:focus { border-color: #0e4166; }
.field label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #777; pointer-events: none; background: #fff; padding: 0 4px; transition: .2s ease; }
.field input:focus + label, .field input:not(:placeholder-shown) + label { top: -8px; font-size: 11px; color: #0e4166; font-weight: 600; }

button { width: 100%; padding: 12px; border: none; border-radius: 10px; font-size: 15px; font-weight: bold; background: #0e4166; color: #fff; cursor: pointer; transition: .2s; margin-top: 5px; }
button:hover { background: #09293f; }
.btn-register { background: #28a745; }
.btn-register:hover { background: #218838; }

.feedback { margin-top: 12px; text-align: center; font-size: 13px; min-height: 18px; }
.feedback.success { color: #2e8b57; }
.feedback.error { color: #d9534f; }

.password-field input { padding-right: 40px; }
.toggle-password { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); cursor: pointer; font-size: 16px; color: #0e4166; opacity: 0.6; user-select: none; }
.toggle-password:hover { opacity: 1; }

/* ERRORE E SELECT FIX */
.field input.input-error, .field select.input-error { border-color: #dc2626 !important; background-color: #fef2f2; }
.field input.input-error { animation: shake 0.3s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.field select + label { top: -8px; font-size: 11px; color: #0e4166; font-weight: 600; z-index: 10; }
.field select { background-color: transparent; padding-top: 12px; padding-bottom: 12px; cursor: pointer; }

/* CHECKBOX E MODALE */
.field-checkbox { margin-bottom: 20px; font-size: 13px; color: #444; text-align: left; }
.field-checkbox label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; position: static; transform: none; pointer-events: auto; }
.field-checkbox input[type="checkbox"] { width: 18px; height: 18px; margin-top: 1px; cursor: pointer; accent-color: #0e4166; border: 1px solid #ccc; border-radius: 4px; }
.field-checkbox input.input-error { outline: 2px solid #dc2626; outline-offset: 1px; }
.privacy-link { color: #0e4166; text-decoration: underline; font-weight: 600; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 1; transition: opacity 0.3s ease; }
.modal-overlay.hidden { display: none; opacity: 0; }
.modal-content { background: white; width: 90%; max-width: 500px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; flex-direction: column; max-height: 80vh; }
.modal-header { padding: 15px 20px; background: #f8f9fa; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; color: #0e4166; margin: 0; }
.close-modal { background: none; border: none; font-size: 24px; cursor: pointer; color: #666; width: auto; padding: 0; margin: 0; }
.modal-body { padding: 20px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #333; }
.modal-body ul { padding-left: 20px; margin-bottom: 15px; }
.modal-body p { margin-bottom: 10px; }
.modal-footer { padding: 15px 20px; border-top: 1px solid #eee; text-align: right; }
.btn-accept { width: auto; padding: 10px 20px; background: #0e4166; margin: 0; }

@media (max-width: 768px) {
    .auth-split-layout { flex-direction: column; }
    .vertical-divider { width: 100%; height: 1px; margin: 0; }
    .auth-col { padding: 20px; }
    .row-fields { flex-direction: column; gap: 0; }
}