/*
 * SMSGatewayHub SMS — frontend OTP styles.
 *
 * Used in three contexts:
 *   1. wp-login.php (raw login form)
 *   2. WooCommerce My Account login + registration forms
 *   3. Cart page (gate before "proceed to checkout")
 *
 * We avoid imposing a theme — the styles are defensive and inherit type sizing
 * from the surrounding theme/login. Only structure, spacing, and the divider
 * are owned here.
 */

.sghsms-otp-block {
    margin-top: 16px;
    padding-top: 16px;
}

.sghsms-otp-divider {
    position: relative;
    text-align: center;
    margin: 4px 0 14px;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sghsms-otp-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e5e7eb;
    z-index: 0;
}

.sghsms-otp-divider span {
    position: relative;
    background: #fff;
    padding: 0 12px;
    z-index: 1;
}

.sghsms-otp-block label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.sghsms-otp-phone,
.sghsms-otp-code {
    font-size: 15px;
}

.sghsms-otp-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.18em;
}

.sghsms-otp-actions {
    margin-top: 8px;
}

.sghsms-otp-actions .button + .button {
    margin-left: 6px;
}

.sghsms-otp-field {
    margin-top: 10px;
}

.sghsms-otp-field label {
    display: block;
    margin-bottom: 4px;
}

/* Code row: input on its own line — never share a row with a button.
   The previous markup had the verify button inline next to the code field
   which caused overlap on narrow widths (e.g. wp-login default 320px). */
.sghsms-otp-code-row {
    margin-top: 10px;
}

.sghsms-otp-code-row input.sghsms-otp-code {
    width: 100%;
    box-sizing: border-box;
}

/* Verify button gets its own dedicated row below the code field. */
.sghsms-otp-verify-row {
    margin-top: 8px;
}

.sghsms-otp-help {
    color: #555;
    font-size: 13px;
    margin: 0 0 10px;
}

.sghsms-otp-status {
    min-height: 1.4em;
    margin: 8px 0 0;
    font-size: 13px;
}

.sghsms-otp-status.is-ok {
    color: #0f7b3a;
}

.sghsms-otp-status.is-err {
    color: #b32d2e;
}

.sghsms-otp-status.is-info {
    color: #50575e;
}

/* Cart page gate */

.sghsms-cart-gate {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    margin: 0 0 18px;
    background: #fafafa;
}

.sghsms-cart-gate h3 {
    margin-top: 0;
    font-size: 15px;
}

.sghsms-otp-verified-line {
    color: #0f7b3a;
    font-weight: 600;
    margin: 0;
}

.sghsms-otp-verified-line::before {
    content: "✓ ";
    margin-right: 4px;
}

/*
 * Note: hiding the "Proceed to Checkout" button when not verified used to
 * be done with sibling selectors (.sghsms-cart-gate[data-verified="0"] ~ ...),
 * but cart layouts vary too much across themes — Twenty Twenty-Five's block
 * cart wraps the button in a different DOM ancestor than Storefront does.
 * The reliable approach is JS that walks the DOM (assets/js/frontend.js)
 * plus the server-side guard in guard_cart_proceed() which prevents
 * progression even if the JS fails for any reason.
 */

/* Login page (wp-login.php) */

#login .sghsms-otp-block {
    margin-top: 18px;
    padding: 14px 0 0;
    border-top: 1px solid #e5e7eb;
}

#login .sghsms-otp-block label {
    color: #1d2327;
    font-weight: 400;
}

#login .sghsms-otp-block .input {
    width: 100%;
    box-sizing: border-box;
    margin: 2px 0 0;
    padding: 6px 8px;
    font-size: 14px;
}

#login .sghsms-otp-actions {
    margin-top: 12px;
}

#login .sghsms-otp-actions .button {
    width: 100%;
}

/* Defensive: hidden attribute should always hide; some themes
 * normalize away [hidden] visibility. */
.sghsms-otp-block [hidden] {
    display: none !important;
}
