/**
 * FMPUEH - Forgot Password Page Styles
 * Styles spécifiques pour la page de récupération de mot de passe
 * 
 * Couleur principale: Vert professionnel (#1a5f3f)
 * En cohérence avec le système de design FMPUEH
 *
 * @version 1.0.0 - Nouvelle version moderne
 */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */

:root {
    /* Couleurs Primaires - Vert Professionnel */
    --fp-primary: #1a5f3f;
    --fp-primary-rgb: 26, 95, 63;
    --fp-primary-light: #2d8a5e;
    --fp-primary-dark: #0d3d2a;
    --fp-primary-hover: #247a4f;
    
    /* Couleurs Secondaires */
    --fp-secondary: #0d3b4d;
    --fp-secondary-light: #1a5f7a;
    
    /* Couleurs d'Accent */
    --fp-success: #27ae60;
    --fp-danger: #e74c3c;
    --fp-warning: #f39c12;
    --fp-info: #3498db;
    
    /* Couleurs de Fond */
    --fp-bg-page: linear-gradient(135deg, var(--fp-primary) 0%, var(--fp-primary-dark) 100%);
    --fp-bg-form: #ffffff;
    --fp-bg-input: #ffffff;
    --fp-bg-input-focus: #f8fafc;
    
    /* Couleurs de Texte */
    --fp-text-primary: #1e293b;
    --fp-text-secondary: #4a5568;
    --fp-text-muted: #767676;
    --fp-text-light: #ffffff;
    --fp-text-brand: #ffffff;
    
    /* Bordures */
    --fp-border: #e2e8f0;
    --fp-border-focus: var(--fp-primary);
    
    /* Ombres */
    --fp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --fp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --fp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --fp-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Rayons */
    --fp-radius-sm: 8px;
    --fp-radius-md: 10px;
    --fp-radius-lg: 12px;
    --fp-radius-xl: 20px;
    
    /* Transitions */
    --fp-transition: all 0.2s ease;
    --fp-transition-slow: all 0.3s ease;
}

/* ========================================
   RESET ET BASE
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: var(--fp-text-primary);
    background: var(--fp-bg-page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LAYOUT
   ======================================== */

.fp-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    background: var(--fp-bg-page);
    align-items: center;
    justify-content: center;
}

.fp-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 600px;
    margin: auto;
    background: var(--fp-bg-form);
    border-radius: var(--fp-radius-xl);
    box-shadow: var(--fp-shadow-xl);
    overflow: hidden;
    animation: fpFadeIn 0.5s ease-out;
}

@keyframes fpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   BRANDING SECTION (LEFT)
   ======================================== */

.fp-branding {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: linear-gradient(145deg, var(--fp-primary) 0%, var(--fp-primary-dark) 100%);
    color: var(--fp-text-brand);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Decorative pattern overlay */
.fp-branding::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

/* Medical cross decorative element */
.fp-branding::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    pointer-events: none;
}

.fp-branding-content {
    position: relative;
    z-index: 1;
    max-width: 400px;
}

.fp-branding-logo {
    margin-bottom: 30px;
    position: relative;
}

/* White circular background behind logo */
.fp-branding-logo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background-color: #ffffff;
    border-radius: 50%;
    z-index: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.fp-branding-logo img {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: var(--fp-transition);
    position: relative;
    z-index: 1;
}

.fp-branding-logo img:hover {
    transform: scale(1.05);
}

.fp-branding-title {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 16px;
    color: var(--fp-text-brand);
    letter-spacing: -0.01em;
}

.fp-branding-subtitle {
    font-size: 1.125rem;
    font-weight: 400;
    opacity: 0.92;
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========================================
   FORM SECTION (RIGHT)
   ======================================== */

.fp-form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 50px;
    background: var(--fp-bg-form);
}

.fp-form-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 380px;
}

.fp-form-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--fp-text-primary);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.fp-form-header p {
    font-size: 0.9375rem;
    color: var(--fp-text-secondary);
    margin: 0;
}

.fp-icon-large {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: var(--fp-primary);
    animation: fpIconBounce 0.6s ease-out;
}

@keyframes fpIconBounce {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   ALERTS
   ======================================== */

.fp-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--fp-radius-lg);
    margin-bottom: 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    width: 100%;
    max-width: 380px;
    animation: fpAlertSlideIn 0.3s ease-out;
}

@keyframes fpAlertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fp-alert-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border: 1px solid #fecaca;
}

.fp-alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.fp-alert-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.fp-alert svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.fp-alert .fp-alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: var(--fp-transition);
}

.fp-alert .fp-alert-close:hover {
    opacity: 1;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.fp-form {
    width: 100%;
    max-width: 380px;
}

.fp-form-group {
    margin-bottom: 24px;
}

.fp-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fp-text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.fp-input-wrapper {
    position: relative;
}

.fp-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    opacity: 0.6;
    transition: var(--fp-transition);
    z-index: 1;
    pointer-events: none;
}

.fp-form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--fp-text-primary);
    background: var(--fp-bg-input);
    border: 2px solid var(--fp-border);
    border-radius: var(--fp-radius-md);
    transition: var(--fp-transition);
    outline: none;
}

.fp-form-control:focus {
    border-color: var(--fp-primary);
    box-shadow: 0 0 0 4px rgba(26, 95, 63, 0.1);
    background: var(--fp-bg-input-focus);
}

.fp-form-control:focus + .fp-input-icon,
.fp-input-wrapper:focus-within .fp-input-icon {
    opacity: 1;
    color: var(--fp-primary);
}

.fp-form-control::placeholder {
    color: var(--fp-text-muted);
}

.fp-form-control:hover:not(:focus) {
    border-color: #cbd5e1;
}

/* Password toggle */
.fp-password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: var(--fp-transition);
    color: var(--fp-text-secondary);
}

.fp-password-toggle:hover {
    opacity: 1;
    color: var(--fp-primary);
}

.fp-password-toggle:focus {
    outline: none;
    opacity: 1;
}

/* Password strength indicator */
.fp-password-strength {
    margin-top: 8px;
}

.fp-password-strength-bar {
    height: 4px;
    background: var(--fp-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.fp-password-strength-fill {
    height: 100%;
    width: 0;
    transition: var(--fp-transition-slow);
    border-radius: 2px;
}

.fp-password-strength-fill.weak {
    width: 33%;
    background: var(--fp-danger);
}

.fp-password-strength-fill.medium {
    width: 66%;
    background: var(--fp-warning);
}

.fp-password-strength-fill.strong {
    width: 100%;
    background: var(--fp-success);
}

.fp-password-strength-text {
    font-size: 0.75rem;
    color: var(--fp-text-muted);
}

/* Password requirements */
.fp-password-requirements {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: var(--fp-radius-sm);
    font-size: 0.8125rem;
}

.fp-password-requirements-title {
    font-weight: 600;
    color: var(--fp-text-secondary);
    margin-bottom: 8px;
}

.fp-password-requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fp-password-requirements-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fp-text-muted);
    margin-bottom: 4px;
    transition: var(--fp-transition);
}

.fp-password-requirements-list li.valid {
    color: var(--fp-success);
}

.fp-password-requirements-list li svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ========================================
   FORM OPTIONS
   ======================================== */

.fp-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding: 0 4px;
}

.fp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--fp-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--fp-transition);
}

.fp-back-link:hover {
    color: var(--fp-primary-hover);
    text-decoration: underline;
}

.fp-back-link svg {
    width: 16px;
    height: 16px;
    transition: var(--fp-transition);
}

.fp-back-link:hover svg {
    transform: translateX(-4px);
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */

.fp-btn {
    width: 100%;
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--fp-text-light);
    background: linear-gradient(135deg, var(--fp-primary) 0%, var(--fp-primary-dark) 100%);
    border: none;
    border-radius: var(--fp-radius-md);
    cursor: pointer;
    transition: var(--fp-transition-slow);
    box-shadow: 0 4px 14px 0 rgba(26, 95, 63, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.02em;
}

.fp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px 0 rgba(26, 95, 63, 0.4);
    background: linear-gradient(135deg, var(--fp-primary-hover) 0%, var(--fp-primary) 100%);
}

.fp-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px 0 rgba(26, 95, 63, 0.3);
}

.fp-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(26, 95, 63, 0.15), 0 4px 14px 0 rgba(26, 95, 63, 0.35);
}

.fp-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.fp-btn svg {
    width: 18px;
    height: 18px;
    transition: var(--fp-transition);
}

.fp-btn:hover svg {
    transform: translateX(4px);
}

/* Loading spinner */
.fp-btn .fp-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: fpSpin 0.8s linear infinite;
}

@keyframes fpSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   HOME BUTTON
   ======================================== */

.fp-home-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--fp-text-secondary);
    background: #f1f5f9;
    border: none;
    border-radius: var(--fp-radius-md);
    cursor: pointer;
    transition: var(--fp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    text-decoration: none;
}

.fp-home-btn:hover {
    background: #e2e8f0;
    color: var(--fp-text-primary);
}

.fp-home-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   INPUT VALIDATION STATES
   ======================================== */

.fp-form-control.is-invalid {
    border-color: var(--fp-danger);
}

.fp-form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.fp-form-control.is-valid {
    border-color: var(--fp-success);
}

.fp-form-control.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

.fp-error-message {
    display: none;
    font-size: 0.8125rem;
    color: var(--fp-danger);
    margin-top: 6px;
    animation: fpErrorShake 0.4s ease;
}

@keyframes fpErrorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.fp-form-group.has-error .fp-error-message {
    display: block;
}

/* ========================================
   SUCCESS STATE
   ======================================== */

.fp-success-container {
    text-align: center;
    animation: fpSuccessFadeIn 0.5s ease-out;
}

@keyframes fpSuccessFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fp-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: var(--fp-success);
    animation: fpSuccessBounce 0.6s ease-out;
}

@keyframes fpSuccessBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.fp-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fp-text-primary);
    margin-bottom: 12px;
}

.fp-success-message {
    font-size: 1rem;
    color: var(--fp-text-secondary);
    margin-bottom: 32px;
}

/* ========================================
   PROGRESS STEPS
   ======================================== */

.fp-steps {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.fp-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--fp-text-muted);
}

.fp-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fp-border);
    color: var(--fp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    transition: var(--fp-transition);
}

.fp-step.active .fp-step-number {
    background: var(--fp-primary);
    color: white;
}

.fp-step.completed .fp-step-number {
    background: var(--fp-success);
    color: white;
}

.fp-step-line {
    width: 40px;
    height: 2px;
    background: var(--fp-border);
    transition: var(--fp-transition);
}

.fp-step.completed + .fp-step .fp-step-line,
.fp-step.completed .fp-step-line {
    background: var(--fp-success);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 991px) {
    .fp-container {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }
    
    .fp-branding {
        padding: 40px 30px;
    }
    
    .fp-branding-title {
        font-size: 1.25rem;
    }
    
    .fp-branding-subtitle {
        font-size: 0.75rem;
    }
    
    .fp-form-section {
        padding: 40px 30px;
    }
    
    .fp-form-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 575px) {
    .fp-wrapper {
        padding: 16px;
    }
    
    .fp-container {
        border-radius: var(--fp-radius-lg);
    }
    
    .fp-branding {
        padding: 30px 20px;
    }
    
    .fp-branding-logo::before {
        width: 100px;
        height: 100px;
    }
    
    .fp-branding-logo img {
        max-width: 120px;
    }
    
    .fp-form-section {
        padding: 30px 20px;
    }
    
    .fp-form-header {
        margin-bottom: 30px;
    }
    
    .fp-form-header h1 {
        font-size: 1.25rem;
    }
    
    .fp-form-header p {
        font-size: 0.875rem;
    }
    
    .fp-form {
        max-width: 100%;
    }
    
    .fp-form-group {
        margin-bottom: 20px;
    }
    
    .fp-form-control {
        padding: 12px 14px 12px 44px;
        font-size: 0.875rem;
    }
    
    .fp-password-requirements {
        display: none;
    }
    
    .fp-btn {
        padding: 14px 24px;
    }
    
    .fp-steps {
        gap: 8px;
    }
    
    .fp-step-line {
        width: 24px;
    }
    
    .fp-step-text {
        display: none;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Visible focus indicators */
.fp-form-control:focus-visible,
.fp-btn:focus-visible,
.fp-password-toggle:focus-visible,
.fp-back-link:focus-visible {
    outline: 2px solid var(--fp-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .fp-form-control {
        border-width: 3px;
    }
    
    .fp-btn {
        border: 2px solid var(--fp-text-light);
    }
}

/* ========================================
   ANIMATIONS ADDITIONELLES
   ======================================== */

/* Floating animation for branding icon */
@keyframes fpFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse animation for step indicators */
@keyframes fpPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(26, 95, 63, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(26, 95, 63, 0);
    }
}

.fp-step.active .fp-step-number {
    animation: fpPulse 2s infinite;
}

/* Typewriter effect for success message */
@keyframes fpTypewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.fp-success-message {
    overflow: hidden;
    white-space: nowrap;
    animation: fpTypewriter 2s steps(40, end);
}
