/* bm R42 — address & registration overlay styles. Scoped, additive. Rollback: delete bm-r42-address.php. */

/* green tick / red cross next to a validated field */
.bm-r42-tick {
    display: inline-block;
    width: 18px;
    text-align: center;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}
.bm-r42-ok + .bm-r42-tick,
input.bm-r42-ok ~ .bm-r42-tick {
    color: #2e7d32;
}
.bm-r42-bad + .bm-r42-tick,
input.bm-r42-bad ~ .bm-r42-tick {
    color: #c62828;
}
input.bm-r42-ok,
select.bm-r42-ok {
    border-color: #86c08a !important;
}
input.bm-r42-bad,
select.bm-r42-bad {
    border-color: #d98a8a !important;
    background-image: none;
}
.bm-r42-hint {
    display: block;
    width: 100%;
    color: #c62828;
    font-size: 12px;
    margin-top: 4px;
}

/* registration OTP row */
.bm-r42-otp .bm-r42-otp__row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.bm-r42-otp__code {
    width: 130px !important;
    letter-spacing: 3px;
    text-align: center;
}
.bm-r42-otp__send {
    padding: 8px 16px;
    border: 1px solid #ea580c;
    background: #fff;
    color: #ea580c;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.bm-r42-otp__send:hover {
    background: #fff3ec;
}
.bm-r42-otp__send:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.bm-r42-otp__msg {
    display: block;
    width: 100%;
    font-size: 12.5px;
    margin-top: 6px;
    min-height: 1em;
}
.bm-r42-otp__msg.ok {
    color: #2e7d32;
}
.bm-r42-otp__msg.err {
    color: #c62828;
}

/* make datalist-backed inputs obviously editable (no surprise locks) */
.bm-ab__field input[list],
.bm-abq__field input[list] {
    background-position: right 8px center;
}

/* ------------------------------------------------------------------
 * R44 — address-book layout reflow: put Postcode | City | State on
 * one row of three equal-sized cells, with consistent input sizing.
 * The three field wrappers are moved into a .bm-r42-row sub-container
 * by the JS; here we place that row across the parent grid and lay the
 * row itself out as three columns. Mobile falls back to one column.
 * ------------------------------------------------------------------ */
.bm-r42-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.25fr 1.25fr;
    gap: 12px;
    align-items: end;
    width: 100%;
    margin-top: 4px;
}
.bm-r42-row .bm-r42-cell {
    min-width: 0;             /* stop long city names blowing out the track */
}

/* unify control sizes across the address book + checkout address fields so
   inputs and selects sit on the same visual line-height */
.bm-ab__fields input[type="text"],
.bm-ab__fields input[type="tel"],
.bm-ab__fields select,
.woocommerce .form-row input.input-text,
.woocommerce .form-row select {
    height: 40px;
    line-height: 1.4;
    font-size: 14px;
    padding: 6px 10px;
    box-sizing: border-box;
    width: 100%;
}

/* compact labels in the reflowed trio so a tick does not force a wrap */
.bm-r42-row .bm-ab__field label {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.bm-r42-row .bm-ab__field .bm-r42-tick {
    margin-left: 4px;
    width: 14px;
}

/* keep the hint text inside its cell rather than the row */
.bm-r42-row .bm-r42-hint {
    font-size: 11.5px;
    line-height: 1.2;
    margin-top: 3px;
}

@media (max-width: 600px) {
    .bm-r42-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
