/* ===== STYLES D'AUTHENTIFICATION - CHESSBET ===== */

/* Variables CSS communes */
:root {
    /* Harmonisation avec le dashboard tout en gardant l'arrière-plan actuel */
    --glass-bg: rgba(26, 26, 26, 0.75);
    --glass-blur: blur(12px);
    --glass-border: rgba(184, 115, 51, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --copper-primary: #b87333;
    --copper-secondary: #daa520;
    --copper-accent: #cd853f;
    --copper-glow: #ffd700;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-color: #ffffff;
}

/* ===== SECTIONS D'AUTHENTIFICATION ===== */

/* Section de connexion */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.login-container {
    max-width: 500px;
    margin: 0 auto;
}

.login-card {
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    padding: 3rem;
    animation: slideUp 0.6s ease-out;
}

/* Section d'inscription */
.register-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.register-container {
    max-width: 600px;
    margin: 0 auto;
}

.register-card {
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    padding: 3rem;
    animation: slideUp 0.6s ease-out;
}

/* Section mot de passe oublié */
.forgot-password-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.forgot-password-container {
    max-width: 500px;
    margin: 0 auto;
}

.forgot-password-card {
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    padding: 3rem;
    animation: slideUp 0.6s ease-out;
}

/* Section réinitialisation mot de passe */
.reset-password-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.reset-password-container {
    max-width: 500px;
    margin: 0 auto;
}

.reset-password-card {
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    padding: 3rem;
    animation: slideUp 0.6s ease-out;
}

/* ===== TITRES ET SOUS-TITRES ===== */

.auth-title {
    font-size: 2.4rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #b87333 0%, #daa520 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    text-shadow: 0 2px 12px rgba(0,0,0,0.45), 0 1px 0 #fff1;
    margin-bottom: 0.5rem;
    text-align: center;
    line-height: 1.1;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.6;
    margin-top: 0.75rem;
    margin-bottom: 0;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== FORMULAIRES ===== */

/* Pour éviter le double checkmark (Bootstrap + notre icône) */
.form-control.is-valid, .was-validated .form-control:valid {
    background-image: none !important;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(184, 115, 51, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
    backdrop-filter: blur(8px);
}

.form-control:focus {
    outline: none;
    border-color: var(--copper-accent);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.15);
    background: rgba(255, 255, 255, 1);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.form-control::placeholder {
    /* Meilleur contraste sur champ clair */
    color: #999999;
}

/* Groupes d'entrée */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group .form-control {
    padding-right: 5rem; /* Espace pour 2 icônes */
}

/* Positionnement direct des icônes */
.input-group .input-group-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 100%;
    width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    z-index: 10;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* Position de l'icône de validation */
.input-group .validation-icon {
    right: 0;
    color: #28a745;
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
}

.input-group .validation-icon.show {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    text-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

/* Position de l'icône oeil */
.input-group .toggle-password {
    right: 2.5rem;
    color: var(--copper-secondary);
}

/* Animation de l'icône oeil */
.input-group .toggle-password i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out;
    transform-origin: center; /* Assure une rotation centrée */
}

/* Classe pour l'état de transition de l'icône */
.icon-changing {
    transform: rotate(90deg) scale(0.5);
    opacity: 0;
}

.input-group .toggle-password:hover {
    color: var(--copper-accent);
    transform: translateY(-50%) scale(1.1);
}

.input-group .validation-icon:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Cases à cocher */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.form-check input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--copper-primary);
}

.form-check-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    accent-color: var(--copper-primary);
}

.checkbox-group label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
}

.checkbox-group a {
    color: var(--copper-accent);
    text-decoration: none;
    transition: var(--transition);
}

.checkbox-group a:hover {
    color: var(--copper-glow);
    text-decoration: underline;
}

/* ===== BOUTONS ===== */

.btn-login,
.btn-register,
.btn-reset {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--copper-primary), var(--copper-accent));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-login::before,
.btn-register::before,
.btn-reset::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;
}

.btn-login:hover::before,
.btn-register:hover::before,
.btn-reset:hover::before {
    left: 100%;
}

.btn-login:hover,
.btn-register:hover,
.btn-reset:hover {
    background: linear-gradient(135deg, var(--copper-accent), var(--copper-primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(184, 115, 51, 0.4);
}

.btn-login:disabled,
.btn-register:disabled,
.btn-reset:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== LIENS ===== */

.login-links,
.register-links,
.forgot-password-links,
.reset-password-links {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.login-links a,
.register-links a,
.forgot-password-links a,
.reset-password-links a {
    color: var(--copper-accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    margin: 0 0.5rem;
}

.login-links a:hover,
.register-links a:hover,
.forgot-password-links a:hover,
.reset-password-links a:hover {
    color: var(--copper-glow);
    text-decoration: underline;
}

.login-link {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.login-link a {
    color: var(--copper-accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

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

.divider {
    margin: 0 1rem;
    color: var(--copper-secondary);
}

/* ===== ALERTES ===== */

.alert {
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: slideIn 0.25s ease-out;
}

.alert-success {
    border-color: #27ae60;
    color: #27ae60;
}

.alert-danger {
    border-color: #e74c3c;
    color: #e74c3c;
}

.alert-warning {
    border-color: #f39c12;
    color: #f39c12;
}

/* ===== BOÎTES D'INFORMATION ===== */

.info-box {
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    padding: 1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-box i {
    color: var(--copper-accent);
    margin-right: 0.5rem;
}

/* ===== FORCE DU MOT DE PASSE ===== */

.password-strength {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    padding: 12px;
}

.password-strength span {
    color: var(--copper-accent);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: block;
    margin-bottom: 8px;
}

.strength-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
    border: 1px solid rgba(184, 115, 51, 0.3);
}

.strength-fill {
    height: 100%;
    transition: all 0.4s ease;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Règles dynamiques du mot de passe */
.password-rules {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
}

.password-rules .rule-item {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-rules .rule-item i {
    color: #dc3545;
    font-size: 0.8rem;
    width: 12px;
    text-align: center;
}

.password-rules .rule-item.valid {
    color: #28a745;
}

.password-rules .rule-item.valid i {
    color: #28a745;
}

.strength-weak .strength-fill {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    width: 25%;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

.strength-fair .strength-fill {
    background: linear-gradient(90deg, #f39c12, #e67e22);
    width: 50%;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
}

.strength-good .strength-fill {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    width: 75%;
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
}

.strength-strong .strength-fill {
    background: linear-gradient(90deg, #27ae60, #00ff88);
    width: 100%;
    box-shadow: 0 0 12px rgba(39, 174, 96, 0.7);
}

.strength-text {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    letter-spacing: 0.5px;
}

/* États spécifiques pour l'indicateur */
.strength-weak .strength-text {
    color: #ff6b6b;
}

.strength-fair .strength-text {
    color: #ffa726;
}

.strength-good .strength-text {
    color: #66bb6a;
}

.strength-strong .strength-text {
    color: #4caf50;
    font-weight: 600;
}

/* ===== ANIMATIONS ===== */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .login-card,
    .register-card,
    .forgot-password-card,
    .reset-password-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .login-section,
    .register-section,
    .forgot-password-section,
    .reset-password-section {
        padding: 1rem 0;
    }
}

/* ===== TOASTS DE NOTIFICATION ===== */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    padding: 12px 16px;
    color: white;
    font-size: 0.9rem;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-content i {
    color: var(--copper-accent);
    font-size: 1rem;
}

.toast-warning .toast-content i {
    color: #f39c12;
}

.toast-info .toast-content i {
    color: #3498db;
}

.toast-success .toast-content i {
    color: #27ae60;
}

.toast-notification span {
    color: #ffffff;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Responsive pour les toasts */
@media (max-width: 768px) {
    .toast-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}

/* ===== MESSAGES DE FORMULAIRE DYNAMIQUES ===== */

.form-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
    margin-bottom: 1.5em;
    padding: 1.2em 1.5em;
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(184, 115, 51, 0.35);
    border-radius: 0; /* angles droits comme landing */
    box-shadow: none;
    font-size: 1.05em;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(10px);
    outline: none;
    position: relative;
    overflow: hidden;
}

.form-message.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.form-message.hiding {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
}

.form-message.success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.form-message.error {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.form-message.warning {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.form-message .icon {
    font-size: 1.3em;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.form-message span:not(.icon) {
    line-height: 1.4;
}

/* Animation d'apparition améliorée */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animation de disparition progressive */
@keyframes messageSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-15px) scale(0.9);
    }
}

.form-message.visible {
    animation: messageSlideIn 0.5s ease-out;
}

.form-message.hiding {
    animation: messageSlideOut 0.5s ease-in;
}

/* Effet de survol pour indiquer l'interactivité */
.form-message:hover {
    transform: translateY(-2px);
    border-color: rgba(184, 115, 51, 0.5);
}

/* Responsive pour les messages */
@media (max-width: 768px) {
    .form-message {
        margin-bottom: 1.2em;
        padding: 1em 1.2em;
        font-size: 1em;
    }
    
    .form-message .icon {
        font-size: 1.2em;
    }
} 

/* ===== BADGE RESTRICTION D'ÂGE ===== */

/* Badge 18+ dans la navbar */
.age-restriction-badge {
    display: inline-block;
    font-size: 1.1rem;
    margin-left: 0.5rem;
    line-height: 1;
    opacity: 0.7;
    filter: grayscale(20%) brightness(0.8);
    transition: all 0.3s ease;
}

.age-restriction-badge:hover {
    opacity: 0.9;
    filter: grayscale(0%) brightness(1);
}

@media (max-width: 768px) {
    .age-restriction-badge {
        font-size: 0.9rem;
        margin-left: 0.3rem;
    }
}

/* ===== ÉTATS DE CHARGEMENT AMÉLIORÉS ===== */

/* Bouton en état de chargement */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
    transition: opacity 0.3s ease;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: inherit;
    z-index: 1;
}

/* Overlay de chargement pour les formulaires */
.form-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.form-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.form-loading-overlay .spinner-container {
    text-align: center;
    color: var(--copper-secondary);
}

.form-loading-overlay .spinner-container i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

.form-loading-overlay .spinner-container p {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Barre de progression pour les actions longues */
.progress-indicator {
    width: 100%;
    height: 4px;
    background: rgba(184, 115, 51, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
    display: none;
}

.progress-indicator.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.progress-indicator .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #b87333 0%, #cd7f32 50%, #daa520 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Animation de pulse pour les indicateurs */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Feedback visuel amélioré pour les champs */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(184, 115, 51, 0.25);
    border-color: var(--copper-primary);
    transition: all 0.3s ease;
}

.form-control.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2327ae60' d='m2.3 6.73.98-.98-.98-.98L1.32 4.77l.98.98zm2.1-4.46L4.4 2.3l.98-.98L5.38.34l-.98.98z'/%3e%3c/svg");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    transition: all 0.3s ease;
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23e74c3c'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linecap='round' d='m5.8 3.6.4.4.4-.4m0 4.8-.4-.4-.4.4'/%3e%3c/svg");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    transition: all 0.3s ease;
}

/* Animation de shake pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-control.is-invalid:focus {
    animation: shake 0.5s ease-in-out;
} 