/* ==========================================================
   WooCommerce Mobile OTP Login — Styles
   ========================================================== */

#wc-otp-wrapper {
    max-width: 440px;
    margin: 2rem auto 2rem;
    font-family: inherit;
}

/* --- Tabs --- */
.otp-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.otp-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.otp-tab.active,
.otp-tab:hover {
    color: #96588a; /* WooCommerce purple */
    border-bottom-color: #96588a;
    color: #ffe9fb;
}

/* --- Panels --- */
.otp-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    color: #333;
}

.otp-panel.hidden,
.otp-step.hidden {
    display: none !important;
}

/* --- Labels & Inputs --- */
.otp-panel label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.3rem;
    margin-top: 0.9rem;
}

.otp-panel input[type="text"],
.otp-panel input[type="tel"],
.otp-panel input[type="email"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.otp-panel input:focus {
    outline: none;
    border-color: #96588a;
    box-shadow: 0 0 0 3px rgba(150, 88, 138, 0.12);
}

/* --- Mobile input with prefix --- */
.otp-input-row {
    display: flex;
    align-items: center;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.otp-input-row:focus-within {
    border-color: #96588a;
    box-shadow: 0 0 0 3px rgba(150, 88, 138, 0.12);
}

.otp-prefix {
    background: #f5f5f5;
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
    color: #555;
    border-right: 1.5px solid #ccc;
    white-space: nowrap;
    user-select: none;
}

.otp-input-row input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    flex: 1;
}

/* --- Buttons --- */
.otp-btn {
    display: block;
    width: 100%;
    margin-top: 1.1rem;
    padding: 0.8rem 1rem;
    background: #96588a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.otp-btn:hover:not(:disabled) {
    background: #7a4570;
}

.otp-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* --- OTP digit boxes --- */
.otp-boxes {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.otp-box {
    width: 3rem;
    height: 3.4rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid #ccc;
    border-radius: 8px;
    transition: border-color 0.2s;
    caret-color: #96588a;
}

.otp-box:focus {
    outline: none;
    border-color: #96588a;
    box-shadow: 0 0 0 3px rgba(150, 88, 138, 0.12);
}

.otp-box.filled {
    border-color: #96588a;
    background: rgba(150, 88, 138, 0.06);
}

/* --- Hint text --- */
.otp-hint {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
    margin-bottom: 0.25rem;
}

/* --- Resend row --- */
.otp-resend-row {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #666;
}

.otp-resend-btn {
    background: none !important;
    color: #96588a !important;
    border: none !important;
    font-size: 0.875rem !important;
    padding: 0 !important;
    cursor: pointer;
    text-decoration: underline;
    width: auto !important;
    margin-top: 0 !important;
    display: inline !important;
}

/* --- Back button --- */
.otp-back-btn {
    display: block;
    background: none;
    border: none;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    margin: 0.75rem auto 0;
    text-decoration: underline;
}

.otp-back-btn:hover {
    color: #444;
}

/* --- Notice / alert --- */
.otp-notice {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.otp-notice.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.otp-notice.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .otp-box {
        width: 2.4rem;
        height: 2.8rem;
        font-size: 1.2rem;
    }
}

/* ==========================================================
   Checkout Page — Blocks checkout mobile field
   ========================================================== */

/* Hide the email field row in Blocks checkout for guests */
.wc-block-checkout__contact-fields .wc-block-components-text-input:has(input[autocomplete="email"]) {
    display: none !important;
}

/* Style the mobile number field to match theme */
.wc-block-checkout__contact-fields input[id*="billing-mobile"],
.wc-block-checkout__contact-fields input[name*="billing-mobile"] {
    width: 100%;
}

/* Hint text below mobile field */
#wc-otp-mobile-hint {
    font-size: 12px;
    color: #666;
    margin: 4px 0 0;
}

/* ==========================================================
   Step 3 — New user name form (Improvement 2)
   ========================================================== */

.otp-new-user-banner {
    background: #eaf7ee;
    border: 1px solid #b2dfbb;
    color: #2e6b3e;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.1rem;
    line-height: 1.5;
}
