/* Register Now / franchise lead-capture modal — matches site brand. */

/* Constrain the dialog to the viewport so the footer (Cancel / Submit) stays
   visible even on short windows; the body scrolls instead. Use dvh (dynamic
   viewport height) so that when the iOS keyboard slides up the modal shrinks to
   the *visible* area — with plain vh the footer/Submit hides behind the keyboard. */
.btb-register-modal .modal-dialog,
.btb-advertise-modal .modal-dialog {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
}

.btb-register-modal .modal-content,
.btb-advertise-modal .modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(26, 43, 74, 0.25);
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* The body/footer that scroll + pin are nested inside <form>, so the form must
   itself be the flex column that fills the content — otherwise the body never
   gets a height to scroll within and the footer (Submit) is clipped off the
   bottom on short/keyboard-shrunk screens. */
.btb-register-modal .modal-content > form,
.btb-advertise-modal .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.btb-register-modal .modal-header,
.btb-register-modal .modal-footer,
.btb-advertise-modal .modal-header,
.btb-advertise-modal .modal-footer {
    flex: 0 0 auto;   /* fixed; never get pushed off-screen */
}

.btb-register-modal .modal-body,
.btb-advertise-modal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto; /* the scrollable region */
    min-height: 0;
}

.btb-register-modal .modal-header,
.btb-advertise-modal .modal-header {
    align-items: flex-start;
    padding: 18px 24px 14px;
    background: linear-gradient(135deg, var(--btb-navy) 0%, var(--btb-blue) 100%);
    color: #fff;
    border-bottom: none;
}

.btb-register-modal .modal-header .btn-close,
.btb-advertise-modal .modal-header .btn-close {
    filter: invert(1) brightness(2);
    opacity: 0.85;
    margin-top: 2px;
}

.btb-register-modal .modal-title,
.btb-advertise-modal .modal-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: 0.2px;
    margin: 0 0 4px 0;
    color: #fff;
}

.btb-register-modal .modal-subtitle,
.btb-advertise-modal .modal-subtitle {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.btb-register-modal .modal-body,
.btb-advertise-modal .modal-body {
    padding: 18px 24px;
    background: #fff;
    overflow-x: hidden;   /* the content scrolls vertically only; nothing bleeds off the right */
}

/* Belt-and-braces: no descendant may force the body wider than the viewport
   (the modal-content clips horizontal overflow, which silently cut content off
   the right edge on phones). */
.btb-register-modal .modal-body img,
.btb-register-modal .modal-body input,
.btb-register-modal .modal-body select,
.btb-register-modal .modal-body textarea {
    max-width: 100%;
}

/* Override Bootstrap btn-group's flat inner edges so each pill is fully
   rounded on both sides; full-width pair with a gap between. */
.btb-register-modal .btb-intent-group {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-bottom: 18px;
}

.btb-register-modal .btb-intent-group .btn {
    border-radius: 28px !important;
    padding: 14px 22px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--btb-navy);
    border: 2px solid var(--btb-navy);
    background: #fff;
    margin-left: 0 !important;
    flex: 1 1 0;            /* each button takes equal space */
    /* Flex-center the label text so the single-line "Explore opportunities"
       sits vertically centered when the sibling button wraps to two lines. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btb-register-modal .btb-intent-group .btn-check:checked + .btn,
.btb-register-modal .btb-intent-group .btn:hover {
    background: var(--btb-red);
    border-color: var(--btb-red);
    color: #fff;
}

@media (max-width: 575.98px) {
    .btb-register-modal .btb-intent-group {
        flex-direction: column;
        gap: 10px;
    }
}

.btb-register-modal .btb-advertise-card {
    padding: 14px 12px;
    background: var(--btb-light-blue);
    border: 1px solid #c6d4e8;
    border-radius: 10px;
    color: var(--btb-navy);
}

.btb-register-modal .btb-advertise-card p { margin: 0; line-height: 1.5; }
.btb-register-modal .btb-advertise-card a { color: var(--btb-blue); }

/* Override the global .btn-register inside the advertise card so longer
   labels like "Commercial Property" fit cleanly: drop the uppercase, allow
   wrapping, lighter horizontal padding. The 2x2 grid then gets enough width
   per cell. */
.btb-register-modal .btb-advertise-card .btn-register {
    padding: 12px 12px;
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575.98px) {
    .btb-register-modal .btb-intent { flex-direction: column; align-items: stretch; gap: 8px; }
    .btb-register-modal .btb-intent-group .btn { flex: 1; }
}

.btb-register-modal .form-label {
    font-weight: 600;
    color: var(--btb-navy);
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.btb-register-modal .form-label .req {
    color: var(--btb-red);
    font-weight: 700;
}

.btb-register-modal .form-control,
.btb-register-modal .form-select {
    border: 1px solid var(--btb-border);
    border-radius: 7px;
    padding: 8px 11px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.btb-register-modal .form-control:focus,
.btb-register-modal .form-select:focus {
    border-color: var(--btb-red);
    box-shadow: 0 0 0 0.18rem rgba(234, 21, 16, 0.15);
}

.btb-register-modal .form-check-input:checked {
    background-color: var(--btb-red);
    border-color: var(--btb-red);
}

.btb-register-modal .form-check-label {
    color: var(--btb-text);
    font-size: 0.9rem;
    line-height: 1.4;
}

.btb-register-modal .form-check {
    margin-bottom: 0;
}

.btb-register-modal .modal-footer {
    border-top: 1px solid var(--btb-border);
    padding: 14px 24px;
    background: var(--btb-light-gray);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== Investment Range — dual-handle slider =====
   Two layered <input type="range"> elements share a single visible track.
   pointer-events:none on the input + auto on the thumb lets either thumb
   be grabbed regardless of stacking order. */
.btb-register-modal .btb-range-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;   /* if label + readout don't fit one line, readout drops below — never clipped */
    gap: 2px 10px;
    margin-bottom: 6px;
}

.btb-register-modal .btb-range-readout {
    font-weight: 700;
    color: var(--btb-red);
    font-size: 0.92rem;
    white-space: nowrap;   /* keep "$50,000 – $380,000" intact; it wraps as a unit, not mid-number */
}

.btb-register-modal .btb-range {
    position: relative;
    height: 28px;
    margin: 0 9px;     /* room for thumb half-width to overflow visually */
}

.btb-register-modal .btb-range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--btb-border);
    border-radius: 5px;
    transform: translateY(-50%);
}

.btb-register-modal .btb-range-track-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--btb-red);
    border-radius: 5px;
}

.btb-register-modal .btb-range input[type="range"] {
    position: absolute;
    top: 0;
    left: -9px;        /* extend slightly so thumb at min/max sits on the track ends */
    width: calc(100% + 18px);
    height: 28px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.btb-register-modal .btb-range input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
    border: none;
    height: 28px;
}

.btb-register-modal .btb-range input[type="range"]::-moz-range-track {
    background: transparent;
    border: none;
    height: 28px;
}

.btb-register-modal .btb-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--btb-red);
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    cursor: pointer;
    pointer-events: auto;
    margin-top: -7px;  /* visually centre against the 5px track on Webkit */
}

.btb-register-modal .btb-range input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--btb-red);
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    cursor: pointer;
    pointer-events: auto;
}

.btb-register-modal .btb-range input[type="range"]:focus { outline: none; }
.btb-register-modal .btb-range input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(234, 21, 16, 0.18);
}
.btb-register-modal .btb-range input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(234, 21, 16, 0.18);
}

.btb-register-modal .btb-range-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--btb-text-muted);
    margin-top: 2px;
}

.btb-register-modal .btn-outline-secondary {
    border-radius: 22px;
    padding: 10px 22px;
    font-weight: 600;
    border-color: var(--btb-border);
    color: var(--btb-navy);
}

.btb-register-modal .btn-outline-secondary:hover {
    background: var(--btb-light-blue);
    border-color: var(--btb-blue);
    color: var(--btb-navy);
}

.btb-register-modal .btn-register {
    /* override the global .btn-register sizing for the modal context */
    padding: 10px 28px;
    font-size: 1rem;
    border-radius: 22px;
}

.btb-register-modal .btn-register[disabled] {
    opacity: 0.7;
    cursor: progress;
}

.btb-register-modal .invalid-feedback {
    font-size: 0.82rem;
}

.btb-register-modal .alert {
    border-radius: 10px;
    font-size: 0.95rem;
}

.btb-register-modal .alert-success {
    background: #e8f6ee;
    border-color: #b9e0c8;
    color: #1a5d34;
}

/* Mobile / small-screen: full-screen on phones (via Bootstrap modal-fullscreen-sm-down) */
@media (max-width: 575.98px) {
    /* Pin the fullscreen modal to the *dynamic* viewport height so it tracks the
       keyboard: header + footer stay on-screen, the body scrolls between them.
       (Bootstrap's fullscreen sets height:100% which on iOS == 100vh and ignores
       the keyboard, leaving Submit stranded behind it.) */
    .btb-register-modal .modal-fullscreen-sm-down,
    .btb-register-modal .modal-fullscreen-sm-down .modal-content {
        height: 100dvh;
        max-height: 100dvh;
    }
    .btb-register-modal .modal-header { padding: 18px 18px 12px; }
    .btb-register-modal .modal-title  { font-size: 1.35rem; }
    .btb-register-modal .modal-body   { padding: 18px; }
    .btb-register-modal .modal-footer {
        padding: 14px 18px;
        flex-direction: column-reverse;
    }
    .btb-register-modal .modal-footer .btn { width: 100%; }
}

/* The advertise modal goes fullscreen at a wider breakpoint (md-down, <=991.98px).
   Pin it to the dynamic viewport height there too, for the same keyboard-tracking
   reason as the register modal above. (Base max-height:100dvh already caps it; this
   removes the 1rem gap and keeps Submit on-screen with the keyboard up on tablets.) */
@media (max-width: 991.98px) {
    .btb-advertise-modal .modal-fullscreen-md-down,
    .btb-advertise-modal .modal-fullscreen-md-down .modal-content {
        height: 100dvh;
        max-height: 100dvh;
    }
    .btb-advertise-modal .modal-footer { flex-direction: column-reverse; }
    .btb-advertise-modal .modal-footer .btn { width: 100%; }
}
