/* ── Flash override: hide global base flash for this page ── */
body#forgot-password .flash-popup,
body#reset-password .flash-popup { display: none !important; }

/* ── Overlay ── */
.login-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(35, 35, 64, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Close button ── */
.close-popup {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    transition: background 0.25s, transform 0.25s;
    z-index: 10000;
}
.close-popup:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    color: #ffffff;
}

/* ── Card ── */
.login-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 32px 64px rgba(35, 35, 64, 0.4);
    overflow: hidden;
    max-width: 520px;
    width: 100%;
    animation: slideUp 0.35s cubic-bezier(.22,.68,0,1.2);
    display: flex;
    flex-direction: column;
}

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

/* ── Top: Logo header ── */
.login-logo-bar {
    background: linear-gradient(135deg, #454796, #232340);
    padding: 30px;
    text-align: center;
    position: relative;
}
.login-logo-bar img {
    height: 55px;
    display: block;
    margin: 0 auto;
}

/* ── Body ── */
.login-body-wrapper {
    padding: 44px 40px 36px;
    text-align: center;
}

/* ── Icon circle ── */
.fp-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(69,71,150,0.12), rgba(43,196,243,0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: iconPop 0.5s 0.2s cubic-bezier(.22,.68,0,1.2) both;
}
@keyframes iconPop {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.fp-icon svg {
    width: 34px;
    height: 34px;
}

/* ── Heading ── */
.login-heading {
    margin-bottom: 28px;
}
.login-heading h1 {
    font-size: 22px;
    font-weight: 700;
    color: #232340;
    margin: 0 0 10px;
    letter-spacing: -0.3px;
}
.login-heading p {
    color: #6b6b7e;
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}

/* ── Form fields ── */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #454796;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.form-field-wrapper {
    position: relative;
}
.form-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0a0b8;
    pointer-events: none;
    transition: color 0.25s;
}
.form-field {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border-radius: 12px;
    font-size: 15px;
    /* Fond/bordure/focus/hover : règle globale dans styles.css. */
}
.form-field::placeholder {
    color: #b0b0c8;
}
.form-field:focus + .form-field-icon,
.form-field-wrapper:focus-within .form-field-icon {
    color: #454796;
}

/* ── Submit button ── */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #454796, #232340);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 6px 20px rgba(69, 71, 150, 0.35);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}
.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(69, 71, 150, 0.45);
}
.btn-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

/* ── Loading spinner ── */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.btn-submit.loading .btn-label { opacity: 0; }
.btn-submit.loading .btn-spinner { display: block; position: absolute; }

/* ── Alert messages (in-card) ── */
.fp-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideUp 0.3s ease;
}
.fp-alert svg { flex-shrink: 0; margin-top: 1px; }
.fp-alert-error {
    background: #fff0f0;
    color: #b91c1c;
    border-left: 4px solid #ef4444;
}
.fp-alert-success {
    background: #f0fdf4;
    color: #15803d;
    border-left: 4px solid #22c55e;
}

/* ── Success state ── */
.fp-success-state {
    display: none;
    text-align: center;
    padding: 8px 0 12px;
    animation: fadeIn 0.4s ease;
}
.fp-success-state.visible { display: block; }
.fp-form-state.hidden { display: none; }

.success-envelope {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: iconPop 0.6s cubic-bezier(.22,.68,0,1.2) both;
    box-shadow: 0 8px 24px rgba(34,197,94,0.3);
}
.success-envelope svg {
    width: 40px;
    height: 40px;
    color: #fff;
}
.fp-success-state h2 {
    font-size: 20px;
    font-weight: 700;
    color: #232340;
    margin: 0 0 10px;
}
.fp-success-state p {
    color: #6b6b7e;
    font-size: 14px;
    line-height: 1.65;
    margin: 0 0 24px;
}
.fp-success-state .email-highlight {
    font-weight: 700;
    color: #232340;
}

/* ── Bottom links ── */
.fp-footer-links {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
}
.fp-footer-links a {
    color: #2BC4F3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.fp-footer-links a:hover { color: #454796; }
.fp-footer-links span { color: #d1d1e0; }

/* ── Back to login button ── */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid #454796;
    border-radius: 10px;
    color: #454796;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn-back:hover {
    background: #454796;
    color: #fff;
    transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .login-overlay { padding: 10px; }
    .close-popup {
        top: 15px; right: 15px;
        width: 32px; height: 32px;
        font-size: 20px;
    }
    .login-card { max-height: calc(100vh - 20px); border-radius: 16px; }
    .login-logo-bar { padding: 20px; }
    .login-logo-bar img { height: 40px; }
    .login-body-wrapper { padding: 30px 24px 24px; overflow-y: auto; }
    .login-heading h1 { font-size: 20px; }
}

@media (max-width: 480px) {
    .login-overlay { padding: 0; }
    .login-card { height: 100vh; max-height: 100vh; border-radius: 0; }
    .close-popup { top: 15px; right: 15px; }
}
