/* =============================================================================
   WC Mobile Web OTP Modal
   ============================================================================= */

/* Overlay */
#wc-otp-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-otp-overlay {
    position: absolute;
    inset: 0;
    background: rgba( 0, 0, 0, 0.55 );
}

/* Modal box */
.wc-otp-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba( 0, 0, 0, 0.18 );
    padding: 40px 36px 32px;
    max-width: 420px;
    width: calc( 100% - 32px );
    text-align: center;
    font-family: inherit;
}

/* Title */
.wc-otp-title {
    margin: 0 0 8px;
    font-size: 1.3em;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

/* Instruction text */
.wc-otp-instruction {
    margin: 0 0 24px;
    font-size: 0.95em;
    color: #555;
}

/* OTP input */
.wc-otp-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 12px;
    font-size: 2em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 18px;
    text-align: center;
    border: 2px solid #d0d0e0;
    border-radius: 8px;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 16px;
}

.wc-otp-input:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba( 74, 108, 247, 0.15 );
}

/* Error / info message */
.wc-otp-error {
    font-size: 0.88em;
    color: #c0392b;
    margin: 0 0 14px;
    min-height: 1.2em;
}

.wc-otp-error--info {
    color: #27ae60 !important;
}

/* Submit button */
.wc-otp-submit-btn {
    display: block;
    width: 100%;
    padding: 13px;
    font-size: 1em;
    font-weight: 600;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    margin-bottom: 18px;
}

.wc-otp-submit-btn:hover {
    background: #2d2d5a;
}

.wc-otp-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Resend area */
.wc-otp-resend-wrap {
    margin: 0;
    font-size: 0.9em;
    color: #777;
}

.wc-otp-resend-link {
    color: #4a6cf7;
    text-decoration: none;
    font-weight: 500;
}

.wc-otp-resend-link:hover {
    text-decoration: underline;
}

.wc-otp-timer {
    color: #999;
}

/* Logout button */
.wc-otp-logout-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.wc-otp-logout-btn {
    display: inline-block;
    font-size: 0.85em;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.wc-otp-logout-btn:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Customer phone field label fix (WC form-row) */
.wc-otp-customer-phone small {
    display: block;
    color: #888;
    font-size: 0.8em;
    margin-top: 4px;
}

/* =============================================================================
   Phone picker — country select + national number side-by-side
   ============================================================================= */

.wc-otp-phone-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

/* Country code select */
.wc-otp-country-select {
    /* Reset native browser appearance */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Sizing — must match the input exactly */
    flex: 0 0 auto;
    width: 160px;
    max-width: 48%;
    height: 42px;
    box-sizing: border-box;

    /* Spacing & typography */
    padding: 0 28px 0 10px;
    font-size: 0.88em;
    font-family: inherit;
    line-height: 42px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* Background + custom dropdown arrow */
    background-color: #f9f9f9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;

    /* Border — right side removed so it merges with input */
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;

    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wc-otp-country-select:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 2px rgba( 74, 108, 247, 0.15 );
    z-index: 1;
    position: relative;
}

/* National number input — override WooCommerce defaults */
.wc-otp-national-input,
.wc-otp-phone-row input.input-text,
.wc-otp-phone-row input.form-control {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;

    /* Match select height & font exactly */
    height: 42px !important;
    box-sizing: border-box !important;
    padding: 0 10px !important;
    font-size: 0.88em !important;
    font-family: inherit !important;
    line-height: 42px !important;
    color: #333 !important;

    background-color: #fff !important;

    /* Border — left removed, merged with select */
    border: 1px solid #ccc !important;
    border-left: 1px solid #e0e0e0 !important; /* subtle inner divider */
    border-radius: 0 4px 4px 0 !important;

    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    margin: 0 !important;
}

.wc-otp-national-input:focus,
.wc-otp-phone-row input.input-text:focus,
.wc-otp-phone-row input.form-control:focus {
    border-color: #4a6cf7 !important;
    box-shadow: 0 0 0 2px rgba( 74, 108, 247, 0.15 ) !important;
    z-index: 1;
    position: relative;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media ( max-width: 480px ) {
    .wc-otp-box {
        padding: 32px 20px 24px;
    }

    .wc-otp-input {
        font-size: 1.6em;
        letter-spacing: 12px;
    }

    .wc-otp-phone-row {
        flex-direction: column;
        gap: 6px;
    }

    .wc-otp-country-select {
        width: 100% !important;
        max-width: 100% !important;
        height: 42px;
        border-right: 1px solid #ccc; /* restore right border when stacked */
        border-bottom: none;
        border-radius: 4px 4px 0 0;
    }

    .wc-otp-national-input,
    .wc-otp-phone-row input.input-text,
    .wc-otp-phone-row input.form-control {
        width: 100% !important;
        border-left: 1px solid #ccc !important;
        border-top: none !important;
        border-radius: 0 0 4px 4px !important;
    }
}