/* ===== AUTH STYLES ===== */
/* Styles partagés pour login.html et register.html */

/* Variables CSS pour l'authentification */
:root {
    --auth-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --auth-glass-primary: rgba(255, 255, 255, 0.15);
    --auth-glass-secondary: rgba(255, 255, 255, 0.1);
    --auth-glass-tertiary: rgba(255, 255, 255, 0.2);
    --auth-border: rgba(255, 255, 255, 0.2);
    --auth-border-focus: rgba(255, 255, 255, 0.6);
    --auth-text: white;
    --auth-text-secondary: rgba(255, 255, 255, 0.8);
    --auth-text-tertiary: rgba(255, 255, 255, 0.7);
    --auth-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --auth-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body authentification */
body.auth-theme {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--auth-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Container principal glassmorphism */
.auth-container {
    background: var(--auth-glass-primary);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(15px);
    border: 1px solid var(--auth-border);
    box-shadow: var(--auth-shadow);
    width: 100%;
    max-width: 400px;
    animation: auth-slideUp 0.8s ease-out;
}

.auth-container.large {
    max-width: 500px;
}

/* Animation d'entrée */
@keyframes auth-slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--auth-text);
}

.auth-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 300;
}

.auth-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Groupes de formulaire */
.auth-form-group {
    margin-bottom: 20px;
    position: relative;
}

.auth-form-group.large {
    margin-bottom: 25px;
}

.auth-form-group label {
    display: block;
    color: var(--auth-text);
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Inputs */
.auth-input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: var(--auth-glass-secondary);
    color: var(--auth-text);
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-border-focus);
    background: var(--auth-glass-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.auth-input::placeholder {
    color: var(--auth-text-tertiary);
}

/* Select spécifique */
.auth-select {
    cursor: pointer;
}

.auth-select option {
    background: #667eea;
    color: white;
}

/* Boutons */
.auth-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.auth-btn-success {
    background: linear-gradient(45deg, #4ade80, #22c55e);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--auth-shadow-hover);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.3);
}

/* Messages d'alerte */
.auth-alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid;
    text-align: center;
    font-weight: 500;
}

.auth-alert.error {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
    border-color: #f87171;
    border-left: 4px solid #f87171;
}

.auth-alert.success {
    background: rgba(74, 222, 128, 0.2);
    color: #bbf7d0;
    border-color: #4ade80;
    border-left: 4px solid #4ade80;
}

.auth-alert.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
    border-color: #fbbf24;
    border-left: 4px solid #fbbf24;
}

/* États de chargement */
.auth-loading {
    display: none;
    text-align: center;
    color: var(--auth-text);
    margin: 20px 0;
}

.auth-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: auth-spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Liens */
.auth-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-border);
}

.auth-link a {
    color: var(--auth-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link a:hover {
    color: var(--auth-text);
    text-decoration: underline;
}

/* Comptes de test */
.auth-test-accounts {
    margin-top: 30px;
    padding: 20px;
    background: var(--auth-glass-secondary);
    border-radius: 10px;
    color: var(--auth-text);
}

.auth-test-accounts h3 {
    margin-bottom: 15px;
    text-align: center;
    color: var(--auth-text);
    font-size: 1.1rem;
}

.auth-test-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: var(--auth-glass-secondary);
    border-radius: 5px;
    font-size: 0.9rem;
}

.auth-test-account button {
    padding: 5px 10px;
    background: var(--auth-glass-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: var(--auth-text);
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.auth-test-account button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Exigences de mot de passe */
.auth-password-requirements {
    background: var(--auth-glass-secondary);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--auth-text-secondary);
}

.auth-password-requirements h4 {
    margin-bottom: 8px;
    color: var(--auth-text);
    font-size: 0.9rem;
}

.auth-requirement {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.auth-requirement.valid {
    color: #4ade80;
}

.auth-requirement.invalid {
    color: #f87171;
}

.auth-requirement::before {
    content: "✗";
    margin-right: 8px;
    font-weight: bold;
}

.auth-requirement.valid::before {
    content: "✓";
}

/* Responsive Design */
@media (max-width: 600px) {
    .auth-container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .auth-header h1 {
        font-size: 2rem;
    }

    .auth-header p {
        font-size: 1rem;
    }

    .auth-input {
        padding: 12px 15px;
        font-size: 16px; /* Évite le zoom iOS */
    }

    .auth-test-account {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .auth-test-account button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 25px 15px;
    }

    .auth-header h1 {
        font-size: 1.8rem;
    }
}

/* Amélioration accessibilité */
.auth-input:focus,
.auth-btn:focus,
.auth-test-account button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Animations supplémentaires */
.auth-form-group {
    animation: auth-fadeIn 0.6s ease-out;
}

.auth-form-group:nth-child(2) { animation-delay: 0.1s; }
.auth-form-group:nth-child(3) { animation-delay: 0.2s; }
.auth-form-group:nth-child(4) { animation-delay: 0.3s; }
.auth-form-group:nth-child(5) { animation-delay: 0.4s; }

@keyframes auth-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* États de validation */
.auth-input.valid {
    border-color: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.auth-input.invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.2);
}

/* Indicateur de force mot de passe */
.auth-password-strength {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.auth-password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.auth-password-strength-bar.weak {
    width: 25%;
    background: #f87171;
}

.auth-password-strength-bar.medium {
    width: 50%;
    background: #fbbf24;
}

.auth-password-strength-bar.strong {
    width: 75%;
    background: #4ade80;
}

.auth-password-strength-bar.very-strong {
    width: 100%;
    background: #22c55e;
}