/* ================================================================ */
/* 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);
}

.auth-modal--split {
    max-width: 68rem;
}

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

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
}

.auth-pane {
    min-width: 0;
}

.auth-pane--primary {
    border-right: 1px solid var(--border-light);
}

.auth-pane--external {
    padding: 2.5rem 2rem;
    background: #f8fafc;
}

/* 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);
}

.external-logins h3 {
    color: var(--text-dark);
    font-weight: 700;
}

.external-login-card {
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    background: var(--white);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.external-login-card-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.external-login-card-title {
    margin: 0;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 700;
}

.external-login-card-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.45;
}

.external-login-card-body {
    padding: 1.25rem;
}

.external-login-button {
    width: 100%;
    min-height: 3.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid #dadce0;
    border-radius: 0.9rem;
    background: #fff;
    color: var(--text-dark);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    font-weight: 600;
    text-align: center;
}

.external-login-button:hover {
    transform: translateY(-1px);
    background: #f8faff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.external-login-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.22);
    outline-offset: 3px;
}

.external-login-button i {
    font-size: 1.05rem;
}

.external-login-button--google {
    border-color: #f1c7c7;
    color: #b91c1c;
}

.external-login-button--google:hover {
    border-color: #ef9a9a;
}

.external-login-button--facebook {
    border-color: #bcd2ff;
    color: #1d4ed8;
}

.external-login-button--facebook:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.external-login-button--linkedin {
    border-color: #9dd8f5;
    color: #0369a1;
}

.external-login-button--linkedin:hover {
    border-color: #67c3ec;
    background: #f0f9ff;
}

.external-login-button--generic {
    border-color: #bfd2f8;
    color: var(--primary-blue);
}

.auth-info-banner {
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    color: var(--text-dark);
    line-height: 1.55;
}

.auth-provider-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary-blue);
    border: 1px solid #bfdbfe;
    font-weight: 700;
}

.auth-provider-pill i {
    font-size: 1rem;
}

.auth-helper-list {
    margin: 1.25rem 0 0;
    padding-left: 1.1rem;
    color: var(--text-light);
    line-height: 1.7;
}

.auth-helper-list li + li {
    margin-top: 0.55rem;
}

.order-complete-shell {
    max-width: 72rem;
}

.order-complete-header {
    margin-bottom: 1.5rem;
}

.order-complete-logo {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.28);
}

.order-complete-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.order-complete-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.order-complete-stat {
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.order-complete-stat strong {
    display: block;
    margin: 0.35rem 0;
    color: var(--text-dark);
    font-size: 1.05rem;
}

.order-complete-stat span {
    display: block;
    color: var(--text-light);
    line-height: 1.45;
}

.order-complete-stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--secondary-blue) !important;
}

.order-complete-banner {
    margin-bottom: 1.5rem;
}

.order-complete-actions {
    display: flex;
}

.order-complete-actions .btn-primary {
    text-decoration: none;
}

.order-complete-side {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.order-complete-checklist {
    display: grid;
    gap: 0.85rem;
}

.order-complete-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
    font-weight: 600;
}

.order-complete-check i {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1d4ed8;
    flex-shrink: 0;
}

.order-complete-note {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    display: flex;
    gap: 0.85rem;
}

.order-complete-note i {
    color: #1d4ed8;
    font-size: 1.1rem;
    margin-top: 0.15rem;
}

.order-complete-note strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.order-complete-note span {
    color: var(--text-light);
    line-height: 1.5;
}

.order-abandoned-shell {
    max-width: 72rem;
}

.order-abandoned-header {
    margin-bottom: 1.5rem;
}

.order-abandoned-logo {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.28);
}

.order-abandoned-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #b45309;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.order-abandoned-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.order-abandoned-stat {
    padding: 1rem;
    border: 1px solid #fed7aa;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    box-shadow: 0 8px 24px rgba(120, 53, 15, 0.06);
}

.order-abandoned-stat strong {
    display: block;
    margin: 0.35rem 0;
    color: var(--text-dark);
    font-size: 1.05rem;
}

.order-abandoned-stat span {
    display: block;
    color: var(--text-light);
    line-height: 1.45;
}

.order-abandoned-stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #c2410c !important;
}

.order-abandoned-banner {
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid #fdba74;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    color: var(--text-dark);
    line-height: 1.55;
}

.order-abandoned-actions {
    display: grid;
    gap: 0.85rem;
}

.order-abandoned-actions .btn-primary,
.order-abandoned-actions .btn-secondary-action {
    text-decoration: none;
}

.order-abandoned-side {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 34%),
        linear-gradient(180deg, #fffaf5 0%, #fff7ed 100%);
}

.order-abandoned-checklist {
    display: grid;
    gap: 0.85rem;
}

.order-abandoned-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
    font-weight: 600;
}

.order-abandoned-check i {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffedd5;
    color: #c2410c;
    flex-shrink: 0;
}

.order-abandoned-note {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 1rem;
    background: #fff7ed;
    border: 1px solid #fdba74;
    display: flex;
    gap: 0.85rem;
}

.order-abandoned-note i {
    color: #c2410c;
    font-size: 1.1rem;
    margin-top: 0.15rem;
}

.order-abandoned-note strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.order-abandoned-note span {
    color: var(--text-light);
    line-height: 1.5;
}

.text-dark {
    color: var(--text-dark);
}

.btn-secondary-action {
    width: 100%;
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-secondary-action:hover {
    background: #dbeafe;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(29, 78, 216, 0.12);
}

/* 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;
}

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

    .auth-pane--primary {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .order-complete-summary {
        grid-template-columns: 1fr;
    }

    .order-abandoned-summary {
        grid-template-columns: 1fr;
    }
}

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

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

@media (max-width: 991.98px) {
    .auth-modal--split {
        max-width: 32rem;
    }

    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-pane--primary {
        border-right: 0;
        border-bottom: 1px solid var(--border-light);
    }

    .auth-pane--external {
        padding: 2rem;
    }
}

/* 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[hidden] {
    display: none;
}

.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;
    }
}

.post-login-passkey {
    position: fixed;
    inset: max(1rem, env(safe-area-inset-top)) 1rem auto;
    z-index: 1100;
    max-width: 28rem;
    margin-inline-start: auto;
}
