/* --- 1. Global Page Layout & Background --- */


/* --- 2. Left Side Images Positioning --- */
.image-container { position: relative; height: 380px; }
.main-house-img { width: 380px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.city-overlay-img { 
    position: absolute; top: 150px; left: 160px; width: 260px; 
    border-radius: 15px; border: 8px solid white; box-shadow: 0 15px 35px rgba(0,0,0,0.15); 
}

/* --- 3. Form Styling (No Card, No Shadow) --- */
.reg-card { 
    border: none !important; box-shadow: none !important; 
    background: transparent !important; padding: 0 !important; margin-bottom: 100px !important; 
}
.brand-orange { color: #f28532; }
.btn-orange { 
    background-color: #f28532 !important; color: white !important; 
    padding: 12px; font-weight: bold; border-radius: 10px !important; 
}

/* --- 4. User Type Buttons --- */
.user-type-btn { 
    border: 1px solid #dce2ee !important; background: white !important; 
    color: #666 !important; font-size: 13px !important; border-radius: 10px !important;
    padding: 10px !important;
}
.user-type-btn.active { 
    border: 2px solid #f28532 !important; background: #fff8f3 !important; 
    color: #f28532 !important; font-weight: bold; 
}
.popular-badge { 
    background: #f28532; color: white; font-size: 10px; padding: 2px 8px; 
    border-radius: 10px; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 10; 
}

/* --- 5. Figma Style OTP Modal Fixes --- */
.modal-content {
    border-radius: 24px !important;
    border: none !important;
}

.otp-lock-icon {
    background: #fff8f3;
    color: #f28532;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 24px;
}

/* OTP row + inputs — responsive, no clipped digits */
.otp-inputs-row {
  --otp-box-size: 52px;
  --otp-gap: 10px;
  --otp-font-size: 1.375rem;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: var(--otp-gap);
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

#otpModal .otp-input,
.otp-input {
  flex: 1 1 0;
  min-width: 0;
  max-width: var(--otp-box-size);
  width: 100% !important;
  height: var(--otp-box-size) !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1.5px solid #e0e0e0 !important;
  border-radius: 12px !important;
  font-size: var(--otp-font-size) !important;
  font-weight: 700 !important;
  line-height: var(--otp-box-size) !important;
  text-align: center !important;
  background: #fff !important;
  box-sizing: border-box !important;
  color: #111827 !important;
  -webkit-appearance: none;
  appearance: none;
}

/* iOS Safari: line-height alone can clip digits in fixed-height inputs */
@supports (-webkit-touch-callout: none) {
  #otpModal .otp-input,
  .otp-input {
    line-height: 1 !important;
    padding-top: calc((var(--otp-box-size) - 1em) / 2) !important;
    padding-bottom: calc((var(--otp-box-size) - 1em) / 2) !important;
  }
}

.otp-input:focus {
    border-color: #f28532 !important;
    box-shadow: 0 0 0 4px rgba(242, 133, 50, 0.1) !important;
    outline: none !important;
}

.btn-verify {
    background: #f28532 !important;
    color: white !important;
    border-radius: 12px !important;
    padding: 14px !important;
    font-weight: 600 !important;
    width: 100%;
    border: none !important;
    transition: 0.3s;
}

.btn-verify:hover {
    background: #e07622 !important;
    transform: translateY(-1px);
}

.forgot-card {
    border-radius: 24px !important;
}

.forgot-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fff4ea;
    color: #f28532;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.forgot-help-text {
    color: #7b8698;
    font-size: 14px;
    line-height: 1.5;
}

.forgot-captcha-box {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #f2c7a5;
    border-radius: 12px;
    background: #fff8f3;
    color: #1f2937;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.forgot-modal .form-control,
.forgot-modal .input-group-text,
.forgot-modal .btn {
    border-radius: 12px !important;
}

.forgot-modal .form-control {
    min-height: 48px;
}

.forgot-modal .input-group .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.forgot-modal .input-group .form-control {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.forgot-otp-input {
    width: 44px !important;
    height: 52px !important;
    padding: 0 !important;
    line-height: 52px !important;
}

.forgot-password-actions .btn {
    min-height: 48px;
}

/* --- 6. Responsive Fixes --- */
@media (max-width: 991px) {
    .image-container { display: none; }
}

/* iPad portrait + tablets: scale OTP boxes to modal width */
@media (min-width: 576px) and (max-width: 1024px) and (orientation: portrait) {
    #otpModal .modal-dialog {
        max-width: min(92vw, 440px);
        margin-left: auto;
        margin-right: auto;
    }

    #otpModal .modal-body.p-5 {
        padding: 2.25rem 1.5rem !important;
    }

    .otp-inputs-row {
        --otp-box-size: clamp(46px, 11vw, 54px);
        --otp-gap: clamp(8px, 2vw, 12px);
        --otp-font-size: clamp(1.2rem, 3.8vw, 1.45rem);
        max-width: min(100%, 380px);
    }
}

/* Phones */
@media (max-width: 575.98px) {
    .otp-inputs-row {
        --otp-box-size: clamp(40px, 12vw, 48px);
        --otp-gap: clamp(5px, 1.6vw, 8px);
        --otp-font-size: clamp(1.05rem, 4.2vw, 1.25rem);
        max-width: 100%;
    }

    .forgot-otp-input {
        width: clamp(36px, 11vw, 44px) !important;
        height: clamp(44px, 12vw, 50px) !important;
        line-height: clamp(44px, 12vw, 50px) !important;
    }
}

.otp-resend-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.otp-resend-row.d-none {
    display: none !important;
}

#resendOtpBtn {
    line-height: 1;
}

#verifyOtpBtn .spinner-border,
#openOtpModalBtn .spinner-border,
#resendOtpBtn .spinner-border {
    vertical-align: middle;
}
.captcha-box,
#captcha-input,
#login-captcha-refresh {
    height: 40px !important;
    min-height: 40px !important;
}

#login-captcha-refresh {
    width: 48px;
    padding: 0 !important;
}
#login-captcha-refresh {
    height: 40px !important;
    border-radius: 8px !important;
}
.otp-edit-mobile-btn {
    border: none;
    background: transparent;
    color: #f28532;
    margin-left: 6px;
    padding: 2px 4px;
    font-size: 14px;
    cursor: pointer;
}

.otp-edit-mobile-btn:hover {
    color: #e07622;
    transform: scale(1.08);
}

/* =====================================================================
   Responsive enhancements — login (horizontal + vertical, Apple-focused)
   Covers iPhone (portrait/landscape), iPad portrait, and small laptops.
   ===================================================================== */

/* Tablets / iPad portrait: the left graphic is hidden below lg, so the
   form column becomes full width. Center it and cap the width instead of
   letting the inputs stretch edge-to-edge. */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container.py-5 > .row.w-100 > .card {
        max-width: 40rem;
        margin-right: auto !important;
        margin-left: auto !important;
        flex: 0 0 auto;
    }
}

/* Phones: tighten vertical rhythm and keep the OTP modal fully on-screen. */
@media (max-width: 575.98px) {
    .container.py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    /* Shrink modal padding, digit boxes and gaps so all 6 OTP inputs fit
       on small iPhones (down to 320px) with no horizontal overflow. */
    #otpModal .modal-body.p-5 {
        padding: 1.75rem 1.1rem !important;
    }

    .otp-inputs-row {
        --otp-box-size: clamp(38px, 11.5vw, 48px);
        --otp-gap: 6px;
        --otp-font-size: clamp(1rem, 4.5vw, 1.25rem);
    }
}

/* Short / landscape viewports (e.g. iPhone landscape): trim vertical padding
   and let the centered modal scroll instead of being clipped. */
@media (max-height: 520px) and (orientation: landscape) {
    .container.py-5 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    #otpModal .modal-content {
        max-height: 92vh;
        overflow-y: auto;
    }

    .otp-inputs-row {
        --otp-box-size: 44px;
        --otp-font-size: 1.15rem;
    }
}
 /* ===== Responsive fixes (scoped to this login page) ===== */

    /* Role buttons: keep all three identical in width + height (paired with
       the col-4 grid + w-100 h-100), and let the long "Buyer/Owner" label
       wrap inside its button instead of overflowing. */
    #loginForm .user-type-btn {
        height: 100%;
        min-width: 0;
        white-space: normal;
        overflow-wrap: break-word;
        line-height: 1.2;
        text-align: center;
    }

    /* Captcha row: guarantee it can never overlap — items wrap onto a new
       line if space runs out (Bootstrap col wrapping handles the layout). */
    #captcha-wrapper .row {
        flex-wrap: wrap;
    }

    /* iPad portrait: the row uses align-items-start and col-lg-5 has no width
       below lg, so the card was shrinking to its content width (looked
       compact). Make it fill the row, then cap + center it so it uses the
       available space without stretching edge-to-edge. */
    @media (min-width: 768px) and (max-width: 991.98px) {
        .container.py-5 > .row.w-100 > .card {
            flex: 0 0 100%;
            width: 100%;
            max-width: 42rem;
            margin-right: auto !important;
            margin-left: auto !important;
        }
    }

    /* iPad landscape (and large tablets): widen the form column without
       touching MacBook/desktop — touch devices report a coarse pointer,
       laptops/desktops report a fine pointer. */
    @media (min-width: 992px) and (pointer: coarse) {
        .container.py-5 > .row.w-100 > .card {
            flex: 0 0 auto;
            width: 41.6667%;
            max-width: 41.6667%;
        }
    }