/* ===== IMPORT DES VARIABLES ===== */
@import url('root.css');

/* ===== PAGE DE CONNEXION SIMPLIFIÉE ===== */
.connexion-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

/* Fond avec éléments décoratifs */
.connexion-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: 1;
}

.connexion-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(255, 255, 255, 0.02) 50%, transparent 60%);
    z-index: 1;
}

/* ===== CONTAINER PRINCIPAL ===== */
.connexion-container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* ===== CARD PRINCIPALE ===== */
.connexion-card {
    width: 100%;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 3rem;
    position: relative;
}

/* ===== HEADER ===== */
.panel-header {
    margin-bottom: 2rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--neutral);
}

.back-button:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-2px);
}

.back-button i {
    font-size: 0.8rem;
}

/* ===== TITRE ET DESCRIPTION ===== */
.panel-title-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.panel-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.panel-subtitle {
    font-size: 1rem;
    color: var(--light-text);
    margin: 0;
    line-height: 1.5;
}

/* ===== FORMULAIRE ===== */
.connexion-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-primary);
    background: var(--white);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--light-text);
    opacity: 0.7;
}

/* ===== CONTAINER MOT DE PASSE ===== */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container .form-input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--neutral);
}

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

/* ===== OPTIONS DU FORMULAIRE ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-text {
    user-select: none;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* ===== BOUTON DE CONNEXION ===== */
.connexion-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.connexion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.connexion-btn:active {
    transform: translateY(0);
}

.connexion-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.connexion-btn:hover i {
    transform: translateX(2px);
}

/* ===== ALERTES ===== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert i {
    font-size: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .connexion-page {
        padding: 1rem;
        min-height: 100vh;
        box-sizing: border-box;
    }
    
    .connexion-container {
        padding: 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .connexion-card {
        padding: 2rem;
        border-radius: 15px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .panel-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .panel-subtitle {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .form-input {
        padding: 0.9rem;
        font-size: 0.95rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .connexion-btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .back-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .connexion-page {
        padding: 0.5rem;
    }
    
    .connexion-container {
        padding: 0;
    }
    
    .connexion-card {
        padding: 1.5rem;
        border-radius: 12px;
        margin: 0;
    }
    
    .panel-title {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .panel-subtitle {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }
    
    .form-input {
        padding: 0.8rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .connexion-btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .checkbox-label {
        font-size: 0.85rem;
    }
    
    .back-button {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Très petits écrans */
@media (max-width: 360px) {
    .connexion-page {
        padding: 0.25rem;
    }
    
    .connexion-card {
        padding: 1.25rem;
        border-radius: 10px;
    }
    
    .panel-title {
        font-size: 1.4rem;
    }
    
    .panel-subtitle {
        font-size: 0.85rem;
    }
    
    .form-input {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    .connexion-btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.connexion-card {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== ÉTATS DE CHARGEMENT ===== */
.connexion-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.connexion-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.connexion-btn.loading {
    position: relative;
    color: transparent;
}

.connexion-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
