/* auth-system.css */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

:root {
    /* Font dimensions */
    --text-base: 1rem;          /* 16px */
    --text-lg: 1.125rem;        /* 18px */
    --text-xl: 1.25rem;         /* 20px */
    --text-2xl: 1.5rem;         /* 24px */
    --text-3xl: 1.875rem;       /* 30px */
    --text-4xl: 2.25rem;        /* 36px */
    
    /* Color palette - mantenuta uguale al tuo sito */
    --color-accent: #327fa8;     /* Blu per scritte in grassetto*/
    --color-text: #000000;       /* nero */
    --color-accent-hover: #FF4B33;
    --color-white: #ffffff;
    --color-border: #000000;
    --color-background: #F2A93B; /* ocra */
    
    /* Form specific colors */
    --form-background: #fff;
    --form-border: #dcdee0;
    --input-border: #dadce0;
    --input-focus: #1a73e8;
    --btn-success: #0f9d58;
    --btn-success-hover: #0b8043;
    --error-color: #d93025;
    --success-color: #0f9d58;
    --progress-bar: #e6e6e6;
    --progress-fill: #1a73e8;
}

/* Globals */
html, body {
    margin: 0;
    padding: 0;
    color: var(--color-text);
    font-family: system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
}

/* ===== SFONDO AGGIORNATO DAL SISTEMA PRINCIPALE ===== */
body {
    /* Mantiene le proprietà di layout necessarie per auth */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    
    /* Animazione di respirazione dello sfondo */
    animation: backgroundBreathe 8s ease-in-out infinite;
    
    /* Font e layout aggiuntivi */
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    overflow-x: hidden;
    position: relative;
    
    /* SFONDO COMPLESSO A LAYER MULTIPLI */
    background: 
        /* Layer principale - gradient diagonale dinamico */
        linear-gradient(135deg, 
            #0a0a0a 0%, 
            #151515 25%, 
            #1a1a1a 40%, 
            #1f1f1f 60%, 
            #1a1a1a 80%, 
            #0f0f0f 100%),
        
        /* Zone di competenza - focal points con brand blu */
        radial-gradient(ellipse at 20% 20%, rgba(50, 127, 168, 0.15) 0%, rgba(50, 127, 168, 0.08) 25%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(50, 127, 168, 0.12) 0%, rgba(50, 127, 168, 0.06) 30%, transparent 70%),
        radial-gradient(ellipse at 60% 10%, rgba(50, 127, 168, 0.08) 0%, transparent 50%),
        
        /* Subtle accent arancione per bilanciare */
        radial-gradient(ellipse at 10% 90%, rgba(242, 169, 59, 0.06) 0%, transparent 40%);

}

/* ===== PSEUDO-ELEMENTO ::BEFORE - PATTERN E GRID ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    /* Pattern complessi sovrapposti */
    background-image: 
        /* Grid principale */
        linear-gradient(rgba(50, 127, 168, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(50, 127, 168, 0.05) 1px, transparent 1px),
        
        /* Cross-hatch pattern per profondità */
        linear-gradient(45deg, rgba(50, 127, 168, 0.03) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(50, 127, 168, 0.03) 1px, transparent 1px),
        
        /* Dots pattern per texture fine */
        radial-gradient(circle at 25% 25%, rgba(50, 127, 168, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(50, 127, 168, 0.04) 1px, transparent 1px);
    
    /* Dimensioni dei pattern */
    background-size: 
        60px 60px,
        60px 60px,
        30px 30px,
        30px 30px,
        15px 15px,
        15px 15px;
    
    /* Posizioni dei pattern */
    background-position: 
        0 0,
        0 0,
        0 0,
        0 0,
        0 0,
        7.5px 7.5px;
    
    z-index: -1;
    pointer-events: none;
    animation: patternFloat 20s linear infinite;
}

/* ===== PSEUDO-ELEMENTO ::AFTER - EFFETTO VIGNETTE ===== */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    /* Vignette effect per focus */
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
    pointer-events: none;
}

/* ===== ANIMAZIONI SFONDO ===== */

/* Animazione di respirazione dello sfondo */
@keyframes backgroundBreathe {
    0%, 100% { 
        background-size: 100% 100%, 120% 120%, 110% 110%, 100% 100%, 90% 90%; 
    }
    50% { 
        background-size: 100% 100%, 110% 110%, 120% 120%, 110% 110%, 100% 100%; 
    }
}

/* Animazione di movimento dei pattern */
@keyframes patternFloat {
    0% { 
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 7.5px 7.5px; 
    }
    100% { 
        background-position: 60px 60px, 60px 60px, 30px 30px, 30px 30px, 15px 15px, 22.5px 22.5px; 
    }
}

main.container {
  flex: 1; /* Questo farà espandere il main per occupare tutto lo spazio disponibile */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Questo centra verticalmente il contenuto */
}

footer {
  margin-top: auto; /* Questo spingerà il footer verso il basso */
}

.auth-container {
    max-width: 500px;
    width: 100%;
    margin: 2rem auto;
    animation: fadeIn 0.5s ease;
}

/* Auth Card */
.auth-card {
    background-color: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 
                0 2px 4px rgba(0, 0, 0, 0.06);
    
}

.auth-card-header {
    background-color: var(--color-white);
    padding: 1.5rem;
   
}

.auth-card-header h2 {
    color: var(--color-accent);
    font-size: var(--text-2xl);
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.auth-card-body {
    padding: 1.5rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: var(--text-base);
}

.form-control {
    width: 100%;
    height: 46px;
    padding: 0 20px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    font-size: 16px;
    line-height: 46px;
    outline: none;
    background-color: #fff;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.form-control:hover {
    box-shadow: 0 1px 8px rgba(32, 33, 36, 0.35);
    border-color: rgba(223, 225, 229, 0);
}

.form-control:focus {
    border-color: rgba(223, 225, 229, 0);
    box-shadow: 0 1px 10px rgba(32, 33, 36, 0.4);
    border-color: var(--color-accent);
}

.form-control.is-invalid {
    border-color: var(--error-color);
}

.invalid-feedback {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-check {
    display: flex;
    align-items: center; /* Cambiato da center a flex-start */
    margin-bottom: 1rem;
}

.form-check-input {
    margin-right: 0.5rem;
    margin-top: 0.25rem; /* Aggiunto questo per allineare meglio con il testo */
    min-width: 20px;     /* Imposta una larghezza minima */
    height: 20px;        /* Ridotto leggermente l'altezza */
    flex-shrink: 0;      /* Impedisce che si restringa */
    border: 1px solid #dfe1e5;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.form-check-input:hover{
    box-shadow: 0 1px 8px rgba(32, 33, 36, 0.35);
    border-color: rgba(223, 225, 229, 0);  
}

.form-check-label {
    font-size: var(--text-base);
    margin-top: 0;
    margin-bottom: 0;
}

/* Buttons */
.btn-auth {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.5rem 1rem;
    border-radius: 24px;
    transition: all 0.3s ease;
    width: 100%;
    height: 46px;
    font-size: var(--text-base);
    line-height: 28px;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-accent);
    border: 1px solid var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
}

.btn-outline:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: white;
}

.btn-link {
    color: var(--color-accent);
    text-decoration: none;
    background-color: transparent;
    border: none;
}

.btn-link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Alerts */
.alert {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: var(--text-base);
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* Dividers and Text */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider::before, .divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.divider-text {
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Logo */
.auth-logo {
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 120px;
    height: auto;
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength-meter {
    height: 5px;
    background-color: #e9ecef;
    margin-top: 0.25rem;
    border-radius: 3px;
    overflow: hidden;
}

.password-strength-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-weak .password-strength-meter-fill {
    width: 25%;
    background-color: #dc3545;
}

.strength-medium .password-strength-meter-fill {
    width: 50%;
    background-color: #ffc107;
}

.strength-strong .password-strength-meter-fill {
    width: 75%;
    background-color: #20c997;
}

.strength-very-strong .password-strength-meter-fill {
    width: 100%;
    background-color: #198754;
}

.password-strength-text {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    text-align: right;
}

.strength-weak .password-strength-text {
    color: #dc3545;
}

.strength-medium .password-strength-text {
    color: #ffc107;
}

.strength-strong .password-strength-text {
    color: #20c997;
}

.strength-very-strong .password-strength-text {
    color: #198754;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-accent);
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 576px) {
    .auth-container {
        max-width: 90%;
        margin: 1rem auto;
    }
    
    .auth-card-body {
        padding: 1rem;
    }
    
    .form-control {
        height: 40px;
        font-size: 14px;
        line-height: 40px;
    }
    
    .btn-auth {
        height: 40px;
        font-size: 14px;
        line-height: 24px;
    }
    
    .auth-card-header h2 {
        font-size: var(--text-2xl);
    }
}

/* Two-factor Authentication */
.two-factor-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.two-factor-container input {
    width: 3rem;
    height: 3rem;
    text-align: center;
    font-size: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
}

.two-factor-container input:focus {
    border-color: var(--color-accent);
    outline: none;
}

/* JWT Token Notification */
.token-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.token-info-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.token-info-text {
    color: #6c757d;
}

/* Remember me checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
}

.custom-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* GDPR consent */
.gdpr-consent {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}


/* stili login a 2 steps*/

#email-display {
    font-weight: 500;
    color: var(--color-accent);
}

#edit-email-btn {
    padding: 0;
    color: var(--color-accent);
    text-decoration: none;
    background: none;
    border: none;
    font-size: 0.875rem;
}

#edit-email-btn:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}