/* ==========================================================================
   AFFINIX - Auth pages design system
   Split-screen layout con pannello hero + card form.
   Riusa le variabili di palette definite in app.css (--primary, --secondary, ecc.)
   ========================================================================== */

/* ---------- Reset locale per l'area auth (bypassa il layout .app-container di MainLayout) ---------- */
body.affinix-auth-body {
    background: linear-gradient(135deg, #f9fafb 0%, #eef2ff 100%);
}

/* ---------- Layout split-screen ---------- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: linear-gradient(135deg, #f9fafb 0%, #eef2ff 100%);
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: 5fr 6fr;
    }
}

/* ---------- Pannello hero (sinistra) ---------- */
.auth-hero {
    position: relative;
    display: none;
    padding: 3rem 3.5rem;
    color: #fff;
    background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--secondary, #ec4899) 100%);
    overflow: hidden;
}

@media (min-width: 992px) {
    .auth-hero {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* Bolle decorative di sfondo */
.auth-hero::before,
.auth-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.auth-hero::before {
    width: 380px;
    height: 380px;
    top: -120px;
    right: -120px;
}

.auth-hero::after {
    width: 260px;
    height: 260px;
    bottom: -80px;
    left: -60px;
}

.auth-hero-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    z-index: 1;
}

.auth-hero-brand .bi {
    font-size: 2rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.auth-hero-content {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.auth-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 1.25rem 0;
    letter-spacing: -0.03em;
}

.auth-hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.92;
    margin: 0 0 2.25rem 0;
}

.auth-hero-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-hero-features li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.98rem;
    opacity: 0.95;
}

.auth-hero-features .bi {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    font-size: 1rem;
}

.auth-hero-footer {
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
    opacity: 0.75;
}

/* ---------- Pannello form (destra) ---------- */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    min-height: 100vh;
}

@media (min-width: 576px) {
    .auth-panel {
        padding: 3rem 2rem;
    }
}

/* Fallback: pagine senza .auth-card ricevono comunque una cornice card */
.auth-panel > :not(.auth-card):not(.auth-back-link) {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05));
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05));
    animation: auth-card-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 576px) {
    .auth-card {
        padding: 3rem 2.75rem;
    }
}

.auth-card--wide {
    max-width: 720px;
}

@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header interno alla card */
.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--secondary, #ec4899) 100%);
    color: #fff;
    border-radius: 18px;
    font-size: 1.8rem;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

.auth-card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.auth-card-subtitle {
    color: var(--gray-600, #4b5563);
    font-size: 0.95rem;
    margin: 0;
}

/* Form controls con look moderno */
.auth-card .form-floating > .form-control {
    border-radius: 12px;
    border: 1.5px solid var(--gray-200, #e5e7eb);
    padding: 1rem 0.75rem;
    height: 3.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-card .form-floating > .form-control:focus {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.auth-card .form-floating > label {
    color: var(--gray-600, #4b5563);
}

.auth-card .form-select {
    border-radius: 12px;
    border: 1.5px solid var(--gray-200, #e5e7eb);
    padding: 0.75rem;
    height: auto;
}

.auth-card .form-select:focus {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* Bottone primario */
.auth-card .btn-primary,
.auth-btn-primary {
    background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--primary-dark, #4f46e5) 100%);
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-card .btn-primary:hover,
.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.5);
}

.auth-card .btn-primary:active,
.auth-btn-primary:active {
    transform: translateY(0);
}

/* Link secondari */
.auth-card a {
    color: var(--primary-dark, #4f46e5);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.auth-card a:hover {
    color: var(--secondary, #ec4899);
    text-decoration: underline;
}

/* Separator con testo */
.auth-separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: var(--gray-600, #4b5563);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-separator::before,
.auth-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gray-200, #e5e7eb);
}

/* Footer links (Forgot password / Register / Resend) */
.auth-footer-links {
    margin-top: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-footer-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.auth-footer-links .bi {
    font-size: 0.95rem;
}

/* Alert / status message */
.auth-card .status-message,
.auth-card .validation-summary-errors {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

/* Bootstrap alerts inside auth card */
.auth-card .alert {
    border-radius: 12px;
    border: 1px solid transparent;
}

/* Checkbox row */
.auth-card .form-check {
    padding-left: 1.75rem;
}

.auth-card .form-check-input {
    width: 1.15em;
    height: 1.15em;
    margin-left: -1.75rem;
    border-color: var(--gray-300, #d1d5db);
    border-radius: 6px;
}

.auth-card .form-check-input:checked {
    background-color: var(--primary, #6366f1);
    border-color: var(--primary, #6366f1);
}

.auth-card .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    border-color: var(--primary-light, #818cf8);
}

/* Return-to-home link fisso in alto */
.auth-back-link {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-700, #374151);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 10px;
    box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0,0,0,0.05));
    backdrop-filter: blur(6px);
    transition: transform 0.15s, box-shadow 0.15s;
    z-index: 10;
}

.auth-back-link:hover {
    color: var(--primary-dark, #4f46e5);
    transform: translateX(-2px);
    box-shadow: var(--shadow, 0 1px 3px 0 rgba(0,0,0,0.1));
}
