/* =========================
   POPUP OVERLAY
========================= */

.blur-bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9998;
}

body.show-popup .blur-bg-overlay {
    opacity: 1;
    pointer-events: auto;
}


/* =========================
   POPUP CONTAINER
========================= */

.form-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 95%;
    max-width: 720px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.2s ease;
    z-index: 9999;
}

body.show-popup .form-popup {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: auto;
}

/* Prevent background scroll */
body.show-popup {
    overflow: hidden;
}


/* =========================
   CLOSE BUTTON
========================= */

.form-popup .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 18px;
    cursor: pointer;
    color: #777;
}

.form-popup .close-btn:hover {
    color: #000;
}


/* =========================
   FORM BOX LAYOUT
========================= */

.form-popup .form-box {
    display: none;
    width: 100%;
    min-height: 420px;
}

/* Default = Login */
.form-popup .login {
    display: flex;
}


/* =========================
   FORM SWITCHING STATES
========================= */

.form-popup.show-signup .form-box {
    display: none;
}

.form-popup.show-signup .signup {
    display: flex;
}

.form-popup.show-reset .form-box {
    display: none;
}

.form-popup.show-reset .reset {
    display: flex;
}


/* =========================
   LEFT SIDE PANEL
========================= */

.form-box .form-details {
    width: 45%;
    background: #0F2439;
    color: #ffffff;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Force heading white */
.form-box .form-details h2 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Paragraph styling */
.form-box .form-details p {
    color: #ffffff;
    font-size: 16px;
    opacity: 0.9;
}


/* =========================
   RIGHT SIDE FORM CONTENT
========================= */

.form-box .form-content {
    width: 55%;
    padding: 40px;
}

.form-box h2 {
    color: #0F2439;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}



/* =========================
   INPUT FIELDS
========================= */

.input-field {
    position: relative;
    margin-bottom: 20px;
}

.input-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    font-size: 16px;
}

.input-field input:focus {
    border-color: #0F2439;
}

.input-field label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    padding: 0 5px;
    font-size: 15px;
    color: #888;
    transition: 0.2s ease;
    pointer-events: none;
}

.input-field input:focus + label,
.input-field input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 15px;
    color: #0F2439;
}


/* =========================
   BUTTONS
========================= */

.form-box button {
    width: 100%;
    padding: 12px;
    background: #0F2439;
    border: 2px solid #0F2439;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s ease;
}

.form-box button:hover {
    background: #fff;
    border: 2px solid #0F2439;
    font-weight: 600;
    color:#0F2439;
}

/* Spinning loader for buttons */

.auth-submit-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}

.auth-submit-btn.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}


/* =========================
   LINKS
========================= */

.form-box a {
    color: #0F2439;
    font-size: 16px;
}

.form-box .bottom-link {
    text-align: center;
    margin-top: 15px;
}

.field-error {
    color: #e53935;
    font-size: 13px;
    margin-top: 6px;
}

.form-popup .verify {
    display: none;
}

.form-popup.show-verify .form-box {
    display: none;
}

.form-popup.show-verify .verify {
    display: flex;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    .form-box {
        flex-direction: column;
    }

    .form-box .form-details {
        display: none;
    }

    .form-box .form-content {
        width: 100%;
        padding: 30px;
    }
}