/* ── 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); /* #232340 with alpha */
    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: 850px;
    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;
}
.login-logo-bar img {
    height: 55px;
    display: block;
    margin: 0 auto;
}

/* ── Bottom: Form & Info Area ── */
.login-body-wrapper {
    display: flex;
    flex-direction: row;
}

.login-form-area {
    flex: 1;
    padding: 40px;
    border-right: 1px solid #e5e5e5;
}

.login-info-area {
    flex: 1;
    padding: 40px;
    background-color: #f8fafc;
}

.login-heading {
    text-align: center;
    margin-bottom: 30px;
}
.login-heading h1 {
    font-size: 24px;
    font-weight: 700;
    color: #232340;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}
.login-heading p {
    color: #58534C;
    font-size: 14px;
    margin: 0;
}

/* ── Form fields ── */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #454796;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-field {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 15px;
    /* Fond/bordure/focus/hover : règle globale dans styles.css. */
}
.form-field::placeholder {
    color: #a3a3a3;
}

/* ── Password visibility toggle ── */
.form-field-wrap {
    position: relative;
}
.form-field-wrap .form-field {
    padding-right: 46px;
}
.form-field-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    color: #9295b0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.form-field-toggle:hover {
    color: #454796;
}

/* ── Forgot password ── */
.login-forgot {
    text-align: right;
    margin-bottom: 28px;
}
.login-forgot a {
    font-size: 13px;
    color: #2BC4F3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.login-forgot a:hover { color: #454796; }

/* ── Submit button ── */
.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #454796, #232340);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 6px 20px rgba(69, 71, 150, 0.35);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(69, 71, 150, 0.45);
}
.btn-login:active {
    transform: translateY(0);
}

/* ── Error ── */
.error-msg {
    background: #fff0f0;
    color: #b91c1c;
    border-left: 4px solid #ef4444;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ── Success ── */
.success-msg {
    background: #f0fdf4;
    color: #15803d;
    border-left: 4px solid #16a34a;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ── Extra Info Text ── */
.login-extra-title {
    font-size: 16px;
    font-weight: 700;
    color: #454796;
    margin-bottom: 20px;
}
.login-info-area p {
    font-size: 13px;
    color: #58534C;
    line-height: 1.6;
    margin-bottom: 16px;
    position: relative;
    padding-left: 20px;
}
.login-info-area p::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: #2BC4F3;
    font-size: 16px;
    font-weight: bold;
}

/* ── Inline login/signup switch button ── */
.rec-switch-link {
    background: none;
    border: none;
    padding: 0;
    color: #2BC4F3;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.rec-switch-link:hover {
    color: #454796;
}

/* ── Long form variant (registration) ── */
.login-card--wide {
    max-width: 980px;
}
.login-form-area--scroll {
    max-height: 78vh;
    overflow-y: auto;
}
.form-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #454796;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 28px 0 16px;
    padding-top: 16px;
    border-top: 1px solid #eef0f4;
}
.form-section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group {
    flex: 1;
    min-width: 0;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #9295b0;
    margin-top: -12px;
    margin-bottom: 12px;
}
.field-hint strong {
    color: #454796;
    font-family: monospace;
}

/* ── Password strength meter ── */
.pwd-strength {
    margin: -12px 0 20px;
}
.pwd-strength-bar {
    height: 5px;
    border-radius: 4px;
    background: #e5e5e5;
    overflow: hidden;
}
.pwd-strength-bar span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: #ef4444;
    transition: width 0.25s ease, background-color 0.25s ease;
}
.pwd-strength-label {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 600;
    color: #9295b0;
}
.pwd-match-hint {
    display: block;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}
.pwd-match-hint.ok { color: #16a34a; }
.pwd-match-hint.bad { color: #dc2626; }

/* ── 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-body-wrapper {
        flex: 1;
        min-height: 0;
        flex-direction: column;
        overflow-y: auto;
    }
    .login-form-area--scroll {
        max-height: none;
        overflow-y: visible;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .login-logo-bar {
        padding: 20px;
    }
    .login-logo-bar img {
        height: 40px;
    }
    .login-form-area {
        padding: 24px;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    .login-info-area {
        padding: 24px;
    }
    .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;
    }
}
