/* ================================================================ */
/* Stili Globali per il Flusso di Autenticazione        */
/* (imagotutum.css)                       */
/* ================================================================ */

/* Definizioni delle variabili di colore e stile */
:root {
    --primary-blue: #1e3a8a;
    --secondary-blue: #3b82f6;
    --content-bg: #f8fafc;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-light: #e2e8f0;
    --gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

/* Stile per l'overlay che copre l'intera pagina */
.auth-overlay {
    background: var(--content-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Stile per il contenitore/modal del form */
.auth-modal {
    background: var(--white);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(30, 58, 138, 0.2);
    width: 100%;
    max-width: 32rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.tab-content {
    padding: 2.5rem 2rem;
}

/* Sezione del logo */
.logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 4rem;
    height: 4rem;
    background: var(--gradient);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.3);
}

.logo i {
    color: var(--white);
    font-size: 1.5rem;
}

/* Stili del Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Stili per i componenti Input di Blazor */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Stili per il bottone primario */
.btn-primary {
    width: 100%;
    background: var(--gradient);
    color: var(--white);
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

/* Sezione per i login esterni (usata solo in Register.razor) */
.external-logins {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* Classi di utilità */
.text-center { text-align: center; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-light { color: var(--text-light); }
.text-danger { color: #dc2626; }

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

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

.other-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.other-links p {
    margin-bottom: 0.5rem;
}

/* Passkey pages */
.passkey-card {
    max-width: 34rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.14),
        0 8px 24px rgba(30, 58, 138, 0.08);
}

.passkey-content {
    padding: 2.75rem 2.5rem 2.25rem;
}

.passkey-header {
    text-align: center;
    margin-bottom: 2rem;
}

.passkey-icon {
    width: 4.75rem;
    height: 4.75rem;
    margin: 0 auto 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 1.4rem;
    color: var(--white);
    background: var(--gradient);
    box-shadow: 0 14px 30px rgba(30, 58, 138, 0.28);
}

.passkey-icon i {
    font-size: 2rem;
}

.passkey-kicker {
    display: inline-block;
    margin-bottom: 0.65rem;
    color: var(--secondary-blue);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.passkey-header h1 {
    margin: 0 0 0.75rem;
    color: var(--text-dark);
    font-size: clamp(1.65rem, 5vw, 2rem);
    font-weight: 750;
    letter-spacing: -0.035em;
}

.passkey-header p {
    max-width: 27rem;
    margin: 0 auto;
    color: var(--text-light);
    font-size: 0.98rem;
    line-height: 1.65;
}

.passkey-form {
    display: grid;
    gap: 1.25rem;
}

.passkey-field label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 650;
}

.passkey-input-wrap {
    position: relative;
}

.passkey-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 1rem;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.passkey-input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.85rem 1rem 0.85rem 2.85rem;
    color: var(--text-dark);
    background: #f8fafc;
    border: 1.5px solid var(--border-light);
    border-radius: 0.85rem;
    font-size: 1rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.passkey-input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.passkey-primary-button {
    width: 100%;
    min-height: 3.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.9rem 1.25rem;
    color: var(--white);
    background: var(--gradient);
    border: 0;
    border-radius: 0.9rem;
    box-shadow: 0 10px 24px rgba(30, 58, 138, 0.24);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.passkey-primary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(30, 58, 138, 0.3);
}

.passkey-primary-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 3px;
}

.passkey-primary-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.passkey-benefits {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.passkey-benefit {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 0.9rem;
}

.passkey-benefit > i {
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--secondary-blue);
    background: #eaf2ff;
    border-radius: 0.75rem;
}

.passkey-benefit div {
    display: grid;
    gap: 0.1rem;
}

.passkey-benefit strong {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.passkey-benefit span {
    color: var(--text-light);
    font-size: 0.8rem;
}

.passkey-message {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-top: 1.25rem;
    padding: 0.9rem 1rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.85rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.passkey-message i {
    margin-top: 0.2rem;
}

.passkey-security-note {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1.5rem;
    padding: 0 0.25rem;
    color: var(--text-light);
    font-size: 0.78rem;
    line-height: 1.5;
}

.passkey-security-note i {
    margin-top: 0.15rem;
    color: #16a34a;
}

.passkey-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
    padding-top: 1.35rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-light);
    font-size: 0.875rem;
    text-align: center;
}

.passkey-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--secondary-blue);
    font-weight: 650;
    text-decoration: none;
}

.passkey-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 576px) {
    .auth-overlay:has(.passkey-card) {
        align-items: flex-start;
        padding: 0;
        background: var(--white);
    }

    .passkey-card {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .passkey-content {
        padding: 2.25rem 1.35rem 1.75rem;
    }
}
