@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/**
 * Premium Modern Login Styles - Matched to User Design
 */

/* ── Global/Reset for the Module ────────────────────────────────────────── */
#pf-login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(71, 85, 105, 0.7); /* Dark slate overlay */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    animation: dialFadeIn 0.3s ease-out forwards;
}

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

/* ── Container (Cards) ────────────────────────────────────────────────── */
.login-captcha-overlay,
.log_data,
.forgot_data,
.sms_check_dialog {
    background: #f4f6f8; /* Soft off-white/gray matching the screenshot */
    border-radius: 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    padding: 40px 32px;
    width: 420px;
    max-width: calc(100vw - 32px);
    position: relative;
    box-sizing: border-box;
    text-align: left;
    animation: cardSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardSlideUp {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Typography & Headings ────────────────────────────────────────────── */
.login-title {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

/* ── Close/Back Buttons ───────────────────────────────────────────────── */
.login-close-btn {
    position: absolute;
    right: 24px;
    top: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: 500;
    color: #4a5568;
    background: #e2e8f0;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    padding-bottom: 2px; /* Optical center adjustment for &times; */
    z-index: 10;
}

.login-close-btn:hover {
    background: #cbd5e0;
    color: #1a202c;
}

.forgot-back-btn {
    padding-bottom: 0; /* Reset for &larr; */
}

/* ── Google Auth Button ───────────────────────────────────────────────── */
.login-oauth-row {
    margin-bottom: 24px;
    position: relative;
}

.login-oauth-row::after {
    content: '';
    display: block;
    width: 80%;
    height: 1px;
    background: #e2e8f0;
    margin: 24px auto 0;
}

.login-gl {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-left: 0;
    padding: 14px 20px;
    box-sizing: border-box;
    border: none;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.login-gl:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.login-gl:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.5);
}

.login-gl.login-gl-selected {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5), 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    background: #f0f7ff;
}

.login-gl img {
    width: 20px !important;
    height: 20px;
    margin-right: 12px;
    position: static !important;
}

/* ── Toggle Bar (Login / Register) ─────────────────────────────────────── */
.login-toggle-bar {
    display: flex;
    margin-bottom: 24px;
    background: #e2e8f0; /* Darker gray track */
    border-radius: 12px;
    padding: 4px;
}

.login-toggle-option {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 700;
    color: #718096;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    user-select: none;
}

.login-toggle-active {
    color: #1a202c;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ── Form Inputs ──────────────────────────────────────────────────────── */
.login-form-fields {
    margin-bottom: 8px;
}

.required-inp {
    display: block;
    position: relative;
    margin-bottom: 16px;
}

#pf-login-modal .login-pop {
    width: 100%;
    padding: 26px 16px 10px !important; /* Space for floating label */
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    color: #1a202c;
    background: #ffffff;
    box-sizing: border-box;
    transition: all 0.2s ease;
    outline: none;
    height: 60px !important; /* Explicit height to prevent choice_main.css squishing */
}

/* Subtly differentiate unfocused empty fields */
#pf-login-modal .login-pop:placeholder-shown {
    color: #a0aec0;
    font-weight: 500;
    padding: 18px 16px !important;
}

#pf-login-modal .login-pop:focus {
    box-shadow: 0 0 0 2px #3b82f6;
}

#pf-login-modal .text_log {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 16px;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Floating Label */
#pf-login-modal .login-pop:focus + .text_log,
#pf-login-modal .login-pop:not(:placeholder-shown) + .text_log {
    top: 14px;
    font-size: 11px;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#pf-login-modal .login-pop:focus + .text_log {
    color: #3b82f6;
}

/* Helper Text */
.fine-print {
    font-size: 13px;
    color: #a0aec0;
    margin-top: -8px;
    margin-bottom: 24px;
    padding-left: 4px;
    font-weight: 500;
}

/* ── Primary Submit Button ────────────────────────────────────────────── */
.login-submit-btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: #3b82f6;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.6);
}

.login-submit-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -6px rgba(37, 99, 235, 0.7);
}

.login-submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.6);
}

/* ── Forgot Password Link ─────────────────────────────────────────────── */
.forgot-link {
    display: inline-block;
    width: 100%;
    text-align: center;
    margin-top: 20px;
    font-size: 15px;
    font-weight: 600;
    color: #718096;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #4a5568;
}

/* ── Error/Success Messages ───────────────────────────────────────────── */
.login-msg {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.login-msg[style*="rgb(255, 0, 0)"], 
.login-msg[style*="#FF0000"] {
    background: #fff5f5 !important;
    color: #e53e3e !important;
}

.login-msg[style*="rgb(8, 138, 8)"], 
.login-msg[style*="#088A08"] {
    background: #f0fff4 !important;
    color: #38a169 !important;
}

/* ── Captcha Overlay Specifics ────────────────────────────────────────── */
.login-captcha-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
.captcha-heading {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 24px;
}

/* ── Verify Section / SMS ─────────────────────────────────────────────── */
.verify-title {
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 24px;
    font-weight: 500;
    text-align: center;
}

/* ── Responsive Mobile ────────────────────────────────────────────────── */
@media (max-width: 500px) {
    .log_data,
    .forgot_data,
    .sms_check_dialog,
    .login-captcha-overlay {
        width: 100%;
        max-width: calc(100vw - 32px);
        padding: 32px 24px; /* Slightly less padding on mobile */
        border-radius: 20px;
        /* Remove full-height stretch to keep it looking like a premium app modal */
    }

    .login-title {
        font-size: 28px; /* Slightly smaller title */
        margin-bottom: 20px;
    }

    .login-close-btn {
        top: 20px;
        right: 20px;
    }
}
