﻿/* ========================================
   FORGOT PASSWORD - RESPONSIVE STYLES
   ======================================== */

/* ========================================
   1. VARIABLES CSS
   ======================================== */
:root {
    --primary-gradient-start: #667eea;
    --primary-gradient-end: #764ba2;
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --background-gray: #4a5568;
    --text-dark: #333;
    --text-muted: #666;
    --text-light: #555;
    --border-color: #e0e0e0;
    --error-bg: #ffe6e6;
    --error-color: #d32f2f;
    --error-border: #ffcdd2;
    --success-bg: #e8f5e8;
    --success-color: #388e3c;
    --success-border: #c8e6c9;
    --info-bg: #e3f2fd;
    --info-border: #bbdefb;
    --info-color: #1565c0;
    --info-icon: #2196f3;
    --shadow-sm: 0 5px 15px rgba(102, 126, 234, 0.4);
    --shadow-md: 0 8px 25px rgba(102, 126, 234, 0.6);
    --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

/* ========================================
   2. RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.forgot-password-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background-gray) 0%, var(--background-gray) 100%);
    min-height: 100vh;
    font-size: 16px; /* Minimum 16px pour éviter le zoom iOS */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   3. CONTAINER PRINCIPAL
   ======================================== */
.forgot-password-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

/* ========================================
   4. CARTE PRINCIPALE
   ======================================== */
.forgot-password-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    padding: 30px 20px;
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   5. LOGO & BRANDING
   ======================================== */
.logo-section {
    text-align: center;
    margin-bottom: 25px;
}

.logo-icon {
    margin-bottom: 10px;
}

    .logo-icon img {
        height: 70px;
        width: auto;
        object-fit: contain;
        animation: logoFloat 3s ease-in-out infinite;
    }

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.brand-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

/* ========================================
   6. TITRE DE LA PAGE
   ======================================== */
.page-title {
    text-align: center;
    margin-bottom: 10px;
}

    .page-title h2 {
        color: var(--primary-color);
        font-size: 22px;
        font-weight: 600;
        margin-bottom: 8px;
        line-height: 1.3;
    }

        .page-title h2 i {
            margin-right: 8px;
            font-size: 20px;
        }

.page-description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 14px;
}

/* ========================================
   7. ALERTES (ERREUR/SUCCÈS)
   ======================================== */
.alert {
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: none;
    animation: slideIn 0.4s ease-out;
    font-size: 14px;
    line-height: 1.5;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert i {
    margin-right: 8px;
    font-size: 16px;
}

.alert-danger {
    background: var(--error-bg);
    color: var(--error-color);
    border: 1px solid var(--error-border);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid var(--success-border);
}

/* ========================================
   8. INFO BOX
   ======================================== */
.info-box {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.info-box i {
    color: var(--info-icon);
    margin-right: 10px;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box p {
    margin: 0;
    color: var(--info-color);
    font-size: 13px;
    line-height: 1.6;
}

/* ========================================
   9. FORMULAIRE
   ======================================== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 7px;
    display: block;
    font-size: 14px;
}

    .form-label i {
        margin-right: 6px;
        color: var(--primary-color);
    }

.form-control {
    width: 100%;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 16px; /* Minimum 16px pour éviter le zoom iOS */
    transition: all var(--transition-speed) ease;
    background: rgba(255, 255, 255, 0.95);
    font-family: inherit;
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
        background: white;
        outline: none;
    }

    .form-control::placeholder {
        color: #aaa;
        font-size: 14px;
    }

/* ========================================
   10. BOUTON DE SOUMISSION
   ======================================== */
.btn-submit {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    border: none;
    border-radius: 10px;
    padding: 14px 25px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    width: 100%;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

    .btn-submit:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .btn-submit:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-submit:disabled {
        background: #ccc;
        transform: none;
        box-shadow: none;
        cursor: not-allowed;
        opacity: 0.6;
    }

    .btn-submit:focus {
        outline: 3px solid rgba(102, 126, 234, 0.3);
        outline-offset: 2px;
    }

    .btn-submit i {
        font-size: 15px;
    }

/* ========================================
   11. LOADING SPINNER
   ======================================== */
.loading-spinner {
    display: none;
}

    .loading-spinner i {
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   12. RETOUR À LA CONNEXION
   ======================================== */
.back-to-login {
    text-align: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e0e0e0;
}

    .back-to-login a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 500;
        font-size: 14px;
        transition: all var(--transition-speed) ease;
        display: inline-block;
    }

        .back-to-login a:hover {
            color: var(--primary-dark);
            text-decoration: underline;
            transform: translateX(-3px);
        }

        .back-to-login a:focus {
            outline: 2px solid var(--primary-color);
            outline-offset: 3px;
            border-radius: 4px;
        }

    .back-to-login i {
        margin-right: 6px;
        font-size: 13px;
    }

/* ========================================
   13. UTILITAIRES
   ======================================== */
.me-2 {
    margin-right: 0.5rem;
}

/* ========================================
   14. PRÉFÉRENCES ACCESSIBILITÉ
   ======================================== */

/* Mode contraste élevé */
@media (prefers-contrast: high) {
    .forgot-password-card {
        border: 2px solid #000;
    }

    .form-control {
        border-width: 3px;
    }

    .back-to-login {
        border-top-width: 2px;
    }
}

/* Réduction des animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   15. RESPONSIVE BREAKPOINTS
   ======================================== */

/* 280px - 320px : Très petits smartphones */
@media (max-width: 320px) {
    .forgot-password-container {
        padding: 10px;
    }

    .forgot-password-card {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .logo-icon img {
        height: 50px;
    }

    .brand-name {
        font-size: 20px;
    }

    .page-title h2 {
        font-size: 18px;
    }

        .page-title h2 i {
            font-size: 16px;
        }

    .page-description {
        font-size: 13px;
    }

    .info-box {
        padding: 12px;
    }

        .info-box p {
            font-size: 12px;
        }

    .form-control {
        height: 45px;
        font-size: 16px;
        padding: 10px 12px;
    }

    .btn-submit {
        padding: 12px 20px;
        font-size: 15px;
    }

    .back-to-login {
        margin-top: 18px;
        padding-top: 15px;
    }
}

/* 321px - 374px : Petits smartphones */
@media (min-width: 321px) and (max-width: 374px) {
    .forgot-password-card {
        padding: 25px 18px;
    }

    .logo-icon img {
        height: 60px;
    }

    .brand-name {
        font-size: 22px;
    }

    .page-title h2 {
        font-size: 19px;
    }
}

/* 375px - 413px : Smartphones standards (iPhone SE, etc.) */
@media (min-width: 375px) and (max-width: 413px) {
    .forgot-password-card {
        padding: 28px 20px;
    }

    .logo-icon img {
        height: 65px;
    }

    .page-title h2 {
        font-size: 20px;
    }
}

/* 414px - 427px : Smartphones moyens (iPhone 13, etc.) */
@media (min-width: 414px) and (max-width: 427px) {
    .forgot-password-card {
        padding: 30px 22px;
    }

    .page-title h2 {
        font-size: 21px;
    }
}

/* 428px - 599px : Grands smartphones */
@media (min-width: 428px) and (max-width: 599px) {
    .forgot-password-card {
        padding: 32px 25px;
        max-width: 450px;
    }

    .logo-icon img {
        height: 75px;
    }

    .page-title h2 {
        font-size: 22px;
    }

    .page-description {
        font-size: 15px;
    }
}

/* 568px - 667px landscape : Mode paysage smartphones */
@media (min-width: 568px) and (max-width: 667px) and (orientation: landscape) {
    .forgot-password-container {
        padding: 15px 5px;
    }

    .forgot-password-card {
        max-width: 500px;
        padding: 20px 25px;
        max-height: 95vh;
        overflow-y: auto;
    }

    .logo-icon img {
        height: 50px;
    }

    .logo-section {
        margin-bottom: 15px;
    }

    .page-title {
        margin-bottom: 8px;
    }

    .page-description {
        margin-bottom: 15px;
        font-size: 13px;
    }

    .info-box {
        padding: 12px;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .back-to-login {
        margin-top: 15px;
        padding-top: 12px;
    }
}

/* 600px - 767px : Petites tablettes */
@media (min-width: 600px) and (max-width: 767px) {
    .forgot-password-card {
        padding: 35px 30px;
        max-width: 500px;
    }

    .logo-icon img {
        height: 85px;
    }

    .brand-name {
        font-size: 26px;
    }

    .page-title h2 {
        font-size: 23px;
    }

    .page-description {
        font-size: 15px;
        margin-bottom: 28px;
    }

    .info-box {
        padding: 16px;
    }
}

/* 768px - 1023px : Tablettes standard */
@media (min-width: 768px) and (max-width: 1023px) {
    .forgot-password-container {
        padding: 25px;
    }

    .forgot-password-card {
        padding: 40px 35px;
        max-width: 520px;
    }

    .logo-icon img {
        height: 95px;
    }

    .brand-name {
        font-size: 28px;
    }

    .page-title h2 {
        font-size: 24px;
    }

        .page-title h2 i {
            font-size: 22px;
        }

    .page-description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .info-box {
        padding: 16px 18px;
        margin-bottom: 25px;
    }

        .info-box p {
            font-size: 14px;
        }

    .form-group {
        margin-bottom: 20px;
    }

    .form-control {
        height: 52px;
    }

    .back-to-login {
        margin-top: 25px;
        padding-top: 20px;
    }
}

/* 1024px - 1279px : Grandes tablettes/petits laptops */
@media (min-width: 1024px) and (max-width: 1279px) {
    .forgot-password-card {
        padding: 45px 40px;
        max-width: 540px;
    }

    .logo-icon img {
        height: 100px;
    }

    .page-title h2 {
        font-size: 25px;
    }
}

/* 1280px - 1439px : Desktop standard */
@media (min-width: 1280px) and (max-width: 1439px) {
    .forgot-password-card {
        padding: 50px 45px;
        max-width: 560px;
    }

    .logo-icon img {
        height: 105px;
    }

    .brand-name {
        font-size: 30px;
    }

    .page-title h2 {
        font-size: 26px;
    }

    .page-description {
        font-size: 16px;
    }

    .form-group {
        margin-bottom: 22px;
    }
}

/* 1440px - 1919px : Full HD */
@media (min-width: 1440px) and (max-width: 1919px) {
    .forgot-password-card {
        padding: 55px 50px;
        max-width: 580px;
    }

    .logo-icon img {
        height: 110px;
    }

    .page-title h2 {
        font-size: 27px;
    }
}

/* 1920px+ : 2K/4K/Ultra-wide */
@media (min-width: 1920px) {
    .forgot-password-card {
        padding: 60px 55px;
        max-width: 620px;
    }

    .logo-icon img {
        height: 120px;
    }

    .brand-name {
        font-size: 32px;
    }

    .page-title h2 {
        font-size: 28px;
    }

        .page-title h2 i {
            font-size: 26px;
        }

    .page-description {
        font-size: 17px;
        margin-bottom: 32px;
    }

    .info-box {
        padding: 18px 20px;
    }

        .info-box p {
            font-size: 15px;
        }

    .form-control {
        height: 54px;
        font-size: 17px;
    }

    .btn-submit {
        padding: 16px 30px;
        font-size: 17px;
    }

    .back-to-login {
        margin-top: 28px;
        padding-top: 22px;
    }
}

/* ========================================
   16. MODES D'ORIENTATION SPÉCIAUX
   ======================================== */

/* Tablettes en mode paysage */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    .forgot-password-card {
        max-height: 90vh;
        overflow-y: auto;
        padding: 30px 35px;
    }

    .logo-section {
        margin-bottom: 20px;
    }

    .logo-icon img {
        height: 70px;
    }

    .page-title {
        margin-bottom: 8px;
    }

    .page-description {
        margin-bottom: 20px;
    }

    .info-box {
        padding: 14px;
        margin-bottom: 18px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .back-to-login {
        margin-top: 18px;
        padding-top: 16px;
    }
}

/* ========================================
   17. SCROLLBAR PERSONNALISÉE
   ======================================== */
.forgot-password-card::-webkit-scrollbar {
    width: 8px;
}

.forgot-password-card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.forgot-password-card::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

    .forgot-password-card::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark);
    }

/* ========================================
   18. ÉTATS DE CHARGEMENT
   ======================================== */
.forgot-password-card.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ========================================
   19. PRINT STYLES
   ======================================== */
@media print {
    .forgot-password-container {
        background: white;
    }

    .forgot-password-card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .btn-submit,
    .back-to-login {
        display: none;
    }
}

/* ========================================
   20. DARK MODE (Optionnel)
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #e0e0e0;
        --text-muted: #b0b0b0;
        --text-light: #c0c0c0;
        --border-color: #555;
        --background-gray: #1a1a2e;
    }

    body.forgot-password-page {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .forgot-password-card {
        background: rgba(30, 30, 30, 0.97);
        color: #e0e0e0;
    }

    .form-control {
        background: rgba(40, 40, 40, 0.95);
        color: #e0e0e0;
        border-color: #555;
    }

        .form-control:focus {
            background: #2a2a2a;
        }

        .form-control::placeholder {
            color: #888;
        }

    .info-box {
        background: rgba(30, 60, 100, 0.3);
        border-color: rgba(30, 60, 100, 0.5);
    }

        .info-box p {
            color: #90caf9;
        }

        .info-box i {
            color: #64b5f6;
        }

    .alert-danger {
        background: rgba(211, 47, 47, 0.2);
        border-color: rgba(211, 47, 47, 0.4);
    }

    .alert-success {
        background: rgba(56, 142, 60, 0.2);
        border-color: rgba(56, 142, 60, 0.4);
    }

    .back-to-login {
        border-top-color: #444;
    }
}

/* ========================================
   21. ANIMATIONS SPÉCIALES
   ======================================== */

/* Animation du bouton au focus */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.btn-submit:focus:not(:disabled) {
    animation: pulse 1.5s infinite;
}

/* Animation de succès */
@keyframes successBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.alert-success {
    animation: slideIn 0.4s ease-out, successBounce 0.6s ease-out 0.4s;
}

/* ========================================
   22. CLASSES UTILITAIRES SUPPLÉMENTAIRES
   ======================================== */
.text-center {
    text-align: center;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}
