/* Variabili CSS */
:root {
    --primary-gradient: linear-gradient(135deg, #763895 0%, #5a2b6f 100%);
    --secondary-gradient: linear-gradient(135deg, #F7956C 0%, #F15B22 100%);
    --accent-color: #763895;
    --accent-secondary: #F7956C;
    --accent-orange: #F15B22;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --white: #ffffff;
    --error-color: #e53e3e;
    --success-color: #38a169;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 4px 6px rgba(118, 56, 149, 0.1);
    --shadow-medium: 0 10px 25px rgba(118, 56, 149, 0.15);
    --shadow-heavy: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* Body / Html: Sfondo Globale a tutto schermo con griglia */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Background fisso con gradient e griglia */
    background: 
        linear-gradient(rgba(255,255,255,0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.14) 1px, transparent 1px),
        var(--primary-gradient);
    background-size: 50px 50px, 50px 50px, cover;
    background-position: 0 0, 0 0, center center;
    background-attachment: fixed, fixed, fixed;
    background-repeat: repeat, repeat, no-repeat;
    font-family: 'Nunito', sans-serif;
}

/* Container principale: Centra la card */
.login-page-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* MAIN CARD - Form Centrato - COMPATTO */
.login-card-wrapper {
    width: 100%;
    max-width: 500px;
    min-width: 0;
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    position: relative;
    z-index: 10;
}

/* Form Side - Occupa tutto lo spazio - COMPATTO */
.form-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 2.5rem;
    position: relative;
    background: var(--white);
    width: 100%;
    box-sizing: border-box;
}

.login-form-wrapper {
    width: 100%;
    max-width: 100%;
}

.form-header-section {
    text-align: center;
    margin-bottom: 1.75rem;
}

.logo-img {
    height: 60px;
    width: auto;
    margin-bottom: 0.75rem;
}

.brand-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.form-title {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Form Inputs */
.form-group { 
    margin-bottom: 1.25rem; 
    display: block;
    position: relative;
} 

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper i {
    position: absolute;
    left: 1.25rem;
    color: var(--text-light);
    font-size: 1.1rem;
    z-index: 2;
    transition: color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    border: 2px solid #edf2f7;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-weight: 500;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(118, 56, 149, 0.1);
}

.toggle-password {
    right: 1rem;
    font-size: 1.1rem;
}

/* Buttons */
.login-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(118, 56, 149, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(118, 56, 149, 0.35);
}

.divider {
    position: relative;
    margin: 2rem 0;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--white);
    padding: 0 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Checkpoint Button - Stile Professionale */
.checkpoint-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border: none;
    font-weight: 600;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.25);
    position: relative;
    overflow: hidden;
}

.checkpoint-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.checkpoint-button:hover::before {
    left: 100%;
}

.checkpoint-button i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.checkpoint-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.checkpoint-button:hover i {
    transform: scale(1.1) rotate(5deg);
}

.checkpoint-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
}

/* Alert Box */
.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fee2e2;
    border: 1px solid #fc8181;
    color: var(--error-color);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--error-color);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Responsive - Tablet (10" e superiori) */
@media (min-width: 768px) {
    .login-page-container {
        padding: 2.5rem !important;
    }

    .login-card-wrapper {
        max-width: 480px !important;
        border-radius: 28px !important;
    }

    .form-side {
        padding: 2.5rem 3rem !important;
    }

    .logo-img {
        height: 65px !important;
    }

    .brand-title {
        font-size: 1.875rem !important;
    }

    .form-title {
        font-size: 1.05rem !important;
    }

    .input-wrapper input {
        padding: 1.1rem 1.1rem 1.1rem 3.75rem !important;
        font-size: 1.05rem !important;
    }

    .login-button {
        padding: 1.1rem !important;
        font-size: 1.15rem !important;
    }
}

/* Tablet grandi (oltre 1024px) */
@media (min-width: 1025px) {
    .login-card-wrapper {
        max-width: 500px !important;
    }

    .form-side {
        padding: 3rem 3.5rem !important;
    }
}

/* Responsive - Mobile e Tablet piccoli */
@media (max-width: 767px) {
    .login-page-container {
        align-items: flex-start;
        padding: 1rem;
        height: auto;
    }

    .login-card-wrapper {
        max-width: 100% !important;
        border-radius: 20px !important;
    }

    .form-side {
        padding: 2rem !important;
    }
}
