/* COPIED FROM PHASE 1 */
:root {
    --paper: #f8fafc;
    --ink: #0f172a;
    --muted: #64748b;
    --cta: #dc2626;
    /* Error color based on usage */
    --brand: #3b82f6;
    /* Primary Brand */
    --bg: #ffffff;
}

/* =============================================================
   Login / Forgot / Reset — Skin coerente con la landing
   Dipendenze: le CSS var della landing già definite in :root
   ============================================================= */

/* Sezione a tutta larghezza con leggera texture/gradient */
.hero-auth {
    position: relative;
    padding: clamp(48px, 6vw, 84px) 0;
    background:
        radial-gradient(60% 40% at 10% 0%, rgba(90, 124, 255, .08) 0%, rgba(90, 124, 255, 0) 80%),
        radial-gradient(60% 40% at 100% 0%, rgba(123, 255, 201, .10) 0%, rgba(123, 255, 201, 0) 70%),
        var(--paper);
    min-height: 100vh;
    /* Ensure full height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrap {
    position: relative;
    width: 100%;
}

/* Header brand */
.auth-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(18px, 3.6vw, 28px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

/* Logo container tweaked for real images */
.brand-logo {
    /* Dimensions handled inline or by image aspect ratio */
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
}

.brand-name {
    font-weight: 800;
    color: var(--ink);
    font-size: clamp(18px, 2.2vw, 22px);
    font-family: "Inter", sans-serif;
}

.brand-badge {
    margin-left: 6px;
    font-size: 12px;
    border: 1px solid #e6e9f5;
    border-radius: 8px;
    padding: 4px 8px;
    color: #4b5270;
}

/* Griglia 2 colonne (form + aside) su desktop */
.auth-grid {
    display: block;
}

@media (max-width: 960px) {
    .auth-grid {
        grid-template-columns: 1fr;
    }
}

/* Card form */
.auth-card {
    background: #fff;
    border-radius: 24px;
    padding: clamp(22px, 3vw, 28px);
    box-shadow: 0 20px 60px rgba(14, 19, 32, .10);
    border: 1px solid #eef2ff;
    margin-left: auto;
    margin-right: auto;
    display: block;
    position: relative;
    max-width: 480px;
}

.auth-card--center {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-title {
    margin: 0 0 6px;
    line-height: 1.2;
    font-size: clamp(22px, 2.6vw, 28px);
    color: var(--ink);
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    text-align: center;
}

/* Form fields */
.auth-form .form-field {
    margin-bottom: 14px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--ink);
    font-size: 0.9rem;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    height: 46px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease;
    font-size: 1rem;
}

/* Focus ring coerente */
.auth-form input:focus {
    border-color: #c7d0ff;
    box-shadow: 0 0 0 3px rgba(90, 124, 255, .15);
}

/* Stato errore (riusa .is-invalid globale) */
.auth-form .is-invalid {
    border-color: var(--cta) !important;
    box-shadow: 0 0 0 3px rgba(255, 122, 89, .15);
}

/* Errori */
.form-message {
    min-height: 1.2em;
    margin: 10px 0;
    color: #b91c1c;
    text-align: center;
}

.field-error {
    display: block;
    min-height: 1.2em;
    margin-top: 6px;
    color: #dc2626;
    font-size: .85em;
}

/* Row utilità */
.form-row {
    margin: 16px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    cursor: pointer;
}

.link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* Pulsante con gradiente coerente alla landing */
.btn--gradient {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #0074ff, #00c9b7);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    font-size: 1rem;
}

.btn--gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}

.btn--gradient:disabled {
    opacity: .65;
    cursor: not-allowed;
    filter: grayscale(.2);
}

.w-100 {
    width: 100%;
}

/* Footer minimale della pagina auth */
.auth-footer {
    margin-top: clamp(20px, 4vw, 32px);
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.auth-footer a {
    color: #c8cbe2;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-card {
        padding: 20px;
        border-radius: 20px;
        margin: 0 16px;
    }

    .brand-name {
        font-size: 18px;
    }

    .brand-badge {
        display: none;
    }
}