/* ============================================
   Fichier CSS pour les pages d'authentification
   Design moderne aligné avec checkout
   ============================================ */

:root {
    --auth-primary: #0aa61f;
    --auth-primary-dark: #088518;
    --auth-secondary: #EF2D2D; /* Rouge du drapeau */
    --auth-accent: #FCD116; /* Jaune du drapeau */
    --auth-success-color: #009739; /* Vert du drapeau */
    --auth-text-dark: #1a1a1a;
    --auth-text-light: #666;
    --auth-bg-light: #f8f9fa;
    --auth-white: #ffffff;
    --auth-error: #dc3545;
    --auth-success: #28a745;
    --auth-warning: #ffc107;
    --auth-shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --auth-shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --auth-shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --auth-border-radius: 16px;
    --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --auth-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Background animé avec couleurs du drapeau burkinabé (Rouge, Jaune, Vert) */
.auth-page-background {
    background: linear-gradient(135deg, #EF2D2D 0%, #FCD116 50%, #009739 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-page-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(252,209,22,0.1) 0%, transparent 60%);
    pointer-events: none;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Container principal */
.auth-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    width: 100%;
}

.auth-container {
    width: 100%;
    max-width: 500px;
    animation: fadeInUp 0.6s ease-out;
    box-sizing: border-box;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Carte d'authentification */
.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--auth-border-radius);
    box-shadow: var(--auth-shadow-lg);
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: var(--auth-font-family);
    width: 100%;
    box-sizing: border-box;
}

/* Header de la carte */
.auth-card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo-container {
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.auth-logo-container img {
    width: 70px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.auth-card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-text-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: var(--auth-font-family);
    letter-spacing: -0.02em;
}

.auth-card-title .logo {
    width: 32px;
    height: auto;
    transition: transform 0.3s ease;
}

.auth-card-title .logo:hover {
    transform: rotate(360deg);
}

.auth-card-subtitle {
    font-size: 1rem;
    color: var(--auth-text-light);
    font-weight: 400;
    font-family: var(--auth-font-family);
    line-height: 1.5;
}

/* Messages d'erreur/succès */
.auth-message {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-message.error {
    background: #fee;
    color: var(--auth-error);
    border-left: 4px solid var(--auth-error);
}

.auth-message.success {
    background: #efe;
    color: var(--auth-success);
    border-left: 4px solid var(--auth-success);
}

.auth-message i {
    font-size: 1.2rem;
}

/* Groupes de formulaire */
.auth-form-group {
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.auth-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--auth-text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--auth-font-family);
    letter-spacing: -0.01em;
}

.auth-form-group label .optional {
    color: var(--auth-text-light);
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Inputs modernes */
.auth-input-group {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.auth-input-prefix {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-light);
    font-size: 1rem;
    z-index: 2;
    pointer-events: none;
}

.auth-input-suffix {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--auth-text-light);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    transition: var(--auth-transition);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-input-suffix:hover {
    color: var(--auth-text-dark);
}

.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-left: 3rem;
    padding-right: 2.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--auth-transition);
    background: var(--auth-white);
    color: var(--auth-text-dark);
    font-family: var(--auth-font-family);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(10, 166, 31, 0.1);
}

.auth-input.error {
    border-color: var(--auth-error);
}

.auth-input.success {
    border-color: var(--auth-success);
}

.auth-input:disabled,
.auth-input[readonly] {
    background: var(--auth-bg-light);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Messages d'erreur de champ */
.auth-field-error {
    color: var(--auth-error);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.2s ease-out;
    font-family: var(--auth-font-family);
    line-height: 1.4;
}

.auth-field-error i {
    font-size: 0.9rem;
}

/* Toggle de méthode (Email/Téléphone) */
.auth-toggle-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    background: var(--auth-bg-light);
    padding: 0.5rem;
    border-radius: 12px;
}

.auth-toggle-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: var(--auth-text-light);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--auth-transition);
    text-align: center;
}

.auth-toggle-btn.active {
    background: var(--auth-white);
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    box-shadow: var(--auth-shadow-sm);
}

/* Boutons */
.auth-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--auth-white);
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    box-shadow: var(--auth-shadow-md);
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.auth-btn::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;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(10, 166, 31, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-secondary {
    background: transparent;
    color: var(--auth-text-dark);
    border: 2px solid #e0e0e0;
    box-shadow: none;
}

.auth-btn-secondary:hover {
    background: var(--auth-bg-light);
    border-color: var(--auth-text-light);
    box-shadow: none;
}

/* Actions row (Précédent, Souvenir, Submit) */
.auth-actions-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.auth-remember-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--auth-text-dark);
    cursor: pointer;
}

.auth-remember-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--auth-primary);
}

/* Panels d'étapes */
.auth-step-panel {
    opacity: 0;
    transform: translateY(8px);
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
}

.auth-step-panel.active {
    opacity: 1;
    transform: none;
    max-height: 2000px;
}

/* Checklist de mot de passe */
.auth-pw-checklist {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    font-size: 0.85rem;
    font-family: var(--auth-font-family);
    line-height: 1.5;
}

.auth-pw-checklist li {
    padding: 0.5rem 0;
    padding-left: 1.75rem;
    position: relative;
    color: var(--auth-text-light);
    transition: var(--auth-transition);
}

.auth-pw-checklist li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: var(--auth-error);
    font-weight: bold;
}

.auth-pw-checklist li.valid {
    color: var(--auth-success);
}

.auth-pw-checklist li.valid::before {
    content: '✓';
    color: var(--auth-success);
}

/* Indicateur Caps Lock */
.auth-caps-hint {
    font-size: 0.85rem;
    color: var(--auth-warning);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Liens d'aide */
.auth-help-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.auth-help-section {
    margin: 1.25rem 0;
    font-size: 0.9rem;
    color: var(--auth-text-light);
    font-family: var(--auth-font-family);
    line-height: 1.6;
}

.auth-help-section strong {
    color: var(--auth-text-dark);
    display: block;
    margin-bottom: 0.5rem;
}

.auth-help-section a {
    color: var(--auth-secondary);
    text-decoration: none;
    transition: var(--auth-transition);
}

.auth-help-section a:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

.auth-divider {
    margin: 1.25rem 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
}

/* Footer */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-card-title {
        font-size: 1.5rem;
    }

    .auth-actions-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .auth-actions-row > * {
        width: 100%;
    }

    .auth-input {
        padding-left: 2.75rem;
        padding-right: 2.25rem;
        font-size: 16px; /* Évite le zoom sur iOS */
        max-width: 100%;
    }

    .auth-input-prefix {
        left: 0.875rem;
    }

    .auth-input-suffix {
        right: 0.625rem;
    }
}

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
    }

    .auth-logo-container img {
        width: 50px;
    }

    .auth-input {
        padding: 0.75rem 0.875rem;
        padding-left: 2.5rem;
        padding-right: 2rem;
        font-size: 16px;
        max-width: 100%;
    }

    .auth-input-prefix {
        left: 0.75rem;
        font-size: 0.9rem;
    }

    .auth-input-suffix {
        right: 0.5rem;
        padding: 0.375rem;
        font-size: 0.875rem;
    }

    .auth-input-group {
        max-width: 100%;
        overflow: hidden;
    }
}

