/* =========================================================================
   auxilium.auth.css
   Layout condiviso per le pagine di autenticazione (Login, Register,
   ForgotPassword, ResetPassword, ecc.) - card centrata su sfondo neutro.
   Consumer dei token di auxilium.tokens.css.
   ========================================================================= */

.auth-page {
    min-height: calc(100vh - var(--ax-topbar-height));
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--ax-space-8) var(--ax-space-6);
    background:
        radial-gradient(1100px 480px at 50% -120px, var(--ax-primary-100) 0%, var(--ax-body-bg) 60%),
        var(--ax-body-bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--ax-card-bg);
    border: 1px solid var(--ax-border-soft);
    border-radius: var(--ax-radius-lg);
    box-shadow: var(--ax-shadow-2);
    padding: var(--ax-space-8) var(--ax-space-7);
    display: flex;
    flex-direction: column;
    gap: var(--ax-space-6);
}

/* ---------- HEADER ---------- */
.auth-header {
    display: flex;
    flex-direction: column;
    gap: var(--ax-space-3);
    text-align: left;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--ax-space-2);
    align-self: flex-start;
    padding: 4px 10px;
    background: var(--ax-primary-50);
    color: var(--ax-primary-700);
    border: 1px solid var(--ax-primary-200);
    border-radius: var(--ax-radius-pill);
    font-size: var(--ax-fs-11);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ax-accent-500);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.auth-title {
    margin: 0;
    font-size: var(--ax-fs-24);
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ax-primary-700);
    line-height: 1.2;
}

.theme-dark .auth-title {
    color: #2f6fe4;
}

.auth-subtitle {
    margin: 0;
    font-size: var(--ax-fs-13);
    color: var(--ax-text-3);
    line-height: 1.5;
}

/* ---------- FORM ---------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--ax-space-4);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--ax-space-2);
}

.form-row-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ax-space-3);
    margin-top: -4px;
}

.form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--ax-space-2);
    font-size: var(--ax-fs-13);
    color: var(--ax-text-2);
    cursor: pointer;
    user-select: none;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ax-primary-700);
    cursor: pointer;
}

/* Variante per consenso GDPR: testo su più righe con link, checkbox
   allineato in alto. */
.form-checkbox.form-consent {
    align-items: flex-start;
    gap: var(--ax-space-3);
    font-size: var(--ax-fs-12);
    line-height: 1.5;
    color: var(--ax-text-2);
}

.form-checkbox.form-consent input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.form-checkbox.form-consent a {
    color: var(--ax-primary-700);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-checkbox.form-consent a:hover {
    color: var(--ax-primary-800);
}

/* ---------- SUBMIT ---------- */
.auth-submit {
    width: 100%;
    min-height: 42px;
    font-size: var(--ax-fs-14);
    font-weight: 600;
}

/* ---------- DIVIDER ---------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--ax-space-3);
    color: var(--ax-text-3);
    font-size: var(--ax-fs-12);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ax-border-soft);
}

/* ---------- FOOTER ---------- */
.auth-footer {
    margin-top: var(--ax-space-2);
    text-align: center;
    font-size: var(--ax-fs-13);
    color: var(--ax-text-3);
}

.auth-link-primary {
    color: var(--ax-primary-700);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.auth-link-primary:hover {
    color: var(--ax-primary-800);
    text-decoration: underline;
}

.auth-link-secondary {
    color: var(--ax-text-2);
    font-size: var(--ax-fs-13);
    text-decoration: none;
}

.auth-link-secondary:hover {
    color: var(--ax-primary-700);
    text-decoration: underline;
}

/* ---------- VALIDAZIONE ---------- */
.validation-summary {
    margin: 0;
    padding: var(--ax-space-3) var(--ax-space-4);
    background: var(--ax-danger-bg);
    border: 1px solid var(--ax-danger-border);
    border-radius: var(--ax-radius-sm);
    color: var(--ax-danger-strong);
    font-size: var(--ax-fs-13);
    list-style: none;
}

.validation-summary:empty {
    display: none;
}

.validation-summary ul {
    margin: 0;
    padding-left: var(--ax-space-4);
}

/* ---------- STATUS MESSAGE ---------- */
.auth-status-alert {
    margin: 0;
    padding: var(--ax-space-3) var(--ax-space-4);
    border-radius: var(--ax-radius-sm);
    font-size: var(--ax-fs-13);
    line-height: 1.4;
}

.auth-status-alert.is-error {
    background: var(--ax-danger-bg);
    border: 1px solid var(--ax-danger-border);
    color: var(--ax-danger-strong);
}

.auth-status-alert.is-success {
    background: var(--ax-success-bg);
    border: 1px solid var(--ax-success-border);
    color: var(--ax-success-strong);
}

/* ---------- MESSAGE / PARAGRAFO DI STATO ----------
   Usato nelle pagine di conferma/errore (senza form) per mostrare il
   testo esplicativo principale sotto al titolo. */
.auth-message {
    margin: 0;
    color: var(--ax-text-2);
    font-size: var(--ax-fs-14);
    line-height: 1.6;
}

.auth-message + .auth-message {
    margin-top: var(--ax-space-3);
}

.auth-message strong {
    color: var(--ax-text-1);
}

/* ---------- VARIANTI TITOLO PER PAGINE DI STATO ---------- */
.auth-title.is-danger {
    color: var(--ax-danger-strong);
}

.auth-title.is-success {
    color: var(--ax-success-strong);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
    .auth-page {
        padding: var(--ax-space-5) var(--ax-space-4);
    }

    .auth-card {
        padding: var(--ax-space-6) var(--ax-space-5);
        border-radius: var(--ax-radius-md);
    }

    .auth-title {
        font-size: var(--ax-fs-20);
    }
}
