/* ============================================================
   BuhayAhente – Auth Modal (Login & Register overlays)
   Appears on the homepage without leaving the page.
   ============================================================ */

/* ---------- Body lock (no scroll when modal open) ---------- */
body.auth-modal-open {
    overflow: hidden;
}

/* ---------- Full-screen overlay ---------- */
.auth-overlay {
    display: none;          /* hidden by default */
    position: fixed;
    inset: 0;               /* top/right/bottom/left: 0 */
    z-index: 1080;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-overlay.is-open {
    display: flex;
}

/* ---------- Blurred backdrop ---------- */
.auth-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 18, 40, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

/* ---------- Floating card ---------- */
.auth-overlay__container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.35),
        0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 2.5rem 2.25rem 2rem;
    max-height: 92vh;
    overflow-y: auto;
    animation: authSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
    /* Themed thin scrollbar — only a fallback for very short viewports now
       that the register form fits without scrolling on typical screens. */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.auth-overlay__container::-webkit-scrollbar {
    width: 6px;
}

.auth-overlay__container::-webkit-scrollbar-track {
    background: transparent;
}

.auth-overlay__container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

@keyframes authSlideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ---------- Close button ---------- */
.auth-overlay__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.auth-overlay__close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ---------- Logo ---------- */
.auth-modal-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.auth-modal-logo {
    width: 160px;          /* larger as requested */
    height: auto;
    object-fit: contain;
}

/* ---------- Headings ---------- */
.auth-modal-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f2042;
    text-align: center;
    margin-bottom: 0.3rem;
}

.auth-modal-subtitle {
    font-size: 0.875rem;
    color: #6b7a99;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ---------- Labels ---------- */
.auth-modal-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

/* ---------- Inputs with leading icon ---------- */
.auth-modal-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-modal-icon {
    position: absolute;
    left: 0.85rem;
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

.auth-modal-input {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 2.5rem 0.65rem 2.4rem;
    font-size: 0.9rem;
    color: #1a202c;
    background: #f8fafc;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-modal-input:focus {
    border-color: #1e4d8c;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(30, 77, 140, 0.12);
    outline: none;
}

.auth-modal-input::placeholder {
    color: #a0aec0;
}

/* Password toggle eye */
.auth-modal-toggle-pw {
    position: absolute;
    right: 0.85rem;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.auth-modal-toggle-pw:hover {
    color: #1e4d8c;
}

/* Bootstrap's built-in valid/invalid state draws its own checkmark/exclamation
   icon inside the field, which sits in the same spot as our show/hide password
   button. Keep the green/red border feedback but drop Bootstrap's icon and
   restore the field's normal padding so it doesn't collide with our button. */
.was-validated input[type="password"].auth-modal-input:valid,
.was-validated input[type="password"].auth-modal-input:invalid,
input[type="password"].auth-modal-input.is-valid,
input[type="password"].auth-modal-input.is-invalid {
    background-image: none;
    padding-right: 2.5rem;
}

/* ---------- URL input group ---------- */
.auth-modal-url-group {
    display: flex;
}

.auth-modal-url-prefix {
    border: 1.5px solid #e2e8f0;
    border-right: none;
    border-radius: 10px 0 0 10px;
    background: #eef2f7;
    color: #6b7a99;
    font-size: 0.82rem;
    padding: 0.65rem 0.85rem;
    white-space: nowrap;
}

.auth-modal-url-input {
    border-left: none !important;
    border-radius: 0 10px 10px 0 !important;
    padding-left: 0.75rem !important;
}

.auth-modal-url-input:focus {
    border-left: none !important;
}

/* ---------- Remember / forgot row ---------- */
.auth-modal-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-modal-check-label {
    font-size: 0.8125rem;
    color: #6b7a99;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #1e4d8c;
    border-color: #1e4d8c;
}

.auth-modal-forgot {
    font-size: 0.8125rem;
    color: #c0392b;
    text-decoration: none;
    font-weight: 500;
}

.auth-modal-forgot:hover {
    text-decoration: underline;
}

/* ---------- Submit button ---------- */
.auth-modal-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: #c0392b;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.35);
    margin-top: 0.25rem;
}

.auth-modal-btn:hover {
    background: #a93226;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.45);
}

.auth-modal-btn:active {
    transform: translateY(0);
}

/* ---------- Error alert ---------- */
.auth-modal-alert {
    border-radius: 10px;
    font-size: 0.8375rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    background: #fff0f0;
    color: #c0392b;
    border-left: 4px solid #e74c3c;
}

/* ---------- Helper text ---------- */
.auth-modal-hint {
    font-size: 0.775rem;
    color: #94a3b8;
    margin-top: 0.3rem;
}

/* ---------- Footer link ---------- */
.auth-modal-footer-text {
    text-align: center;
    font-size: 0.8125rem;
    color: #6b7a99;
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.auth-modal-footer-text a {
    color: #c0392b;
    font-weight: 600;
    text-decoration: none;
}

.auth-modal-footer-text a:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .auth-overlay {
        padding: 0.5rem;
    }

    .auth-overlay__container {
        padding: 2rem 1.4rem 1.75rem;
        border-radius: 18px;
        max-width: 100%;
    }

    .auth-modal-logo {
        width: 130px;
    }

    .auth-modal-title {
        font-size: 1.25rem;
    }

    .auth-password-requirements {
        grid-template-columns: 1fr;
    }
}

/* ---------- Terms checkbox row ---------- */
.auth-modal-terms {
    display: flex;
    align-items: flex-start;
    gap: 0.1rem;
}

.auth-modal-terms .form-check-input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.auth-modal-inline-link {
    color: #1e4d8c;
    font-weight: 600;
    text-decoration: none;
}

.auth-modal-inline-link:hover {
    text-decoration: underline;
}

/* ---------- Register panel: compact spacing ----------
   The register form has more fields than login (confirm password,
   requirements checklist, terms), so it needs a tighter rhythm to still
   fit on a typical screen without scrolling. */
#authPanelRegister .auth-modal-logo-wrap {
    margin-bottom: 0.65rem;
}

#authPanelRegister .auth-modal-logo {
    width: 110px;
}

#authPanelRegister .auth-modal-title {
    margin-bottom: 0.15rem;
}

#authPanelRegister .auth-modal-subtitle {
    margin-bottom: 1rem;
}

#registerForm .mb-3 {
    margin-bottom: 0.65rem !important;
}

#registerForm .mb-4 {
    margin-bottom: 0.85rem !important;
}

/* Password requirements: collapsed by default, expands once the person
   starts typing a password (see marketing.php JS) — saves ~2 lines of
   height for everyone who hasn't reached that field yet. */
.auth-password-requirements {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.auth-password-requirements.is-visible {
    max-height: 6rem;
    margin-top: 0.5rem;
    opacity: 1;
}

/* Field status/error slots only take up space once they have something
   to say, so empty ones don't add dead vertical space by default. */
.auth-field-status {
    min-height: 0;
}

/* ============================================================
   "Continue with Google" button + divider (homepage login modal)
   Purely additive — matches the modal's existing input/button
   radius and spacing language.
   ============================================================ */
.auth-modal-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0.7rem;
    border-radius: 10px;
    border: 1.5px solid #e2e5f0;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.auth-modal-oauth-btn:hover {
    background: #f9fafb;
    border-color: #cbd2e0;
    color: #1f2937;
    transform: translateY(-1px);
}

.auth-modal-oauth-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

.auth-modal-oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
    margin: 0 0 1rem;
}

.auth-modal-oauth-divider::before,
.auth-modal-oauth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.auth-modal-oauth-divider span {
    padding: 0 12px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .auth-modal-oauth-btn {
        font-size: 0.875rem;
        padding: 0.6rem;
    }
}
