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

/* ── Tab Toggle ─────────────────────────────────────────────────── */
.woo-otp-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

/* Password panel visible by default; OTP panel hidden by default (set via inline style in PHP) */
#woo-otp-login-panel {
    display: block;
}

#woo-otp-phone-panel {
    display: none;
}

.woo-otp-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: all 0.2s ease;
}

.woo-otp-tab:hover {
    color: #333;
}

.woo-otp-tab.active {
    color: var(--wc-primary, #96588a);
    border-bottom-color: var(--wc-primary, #96588a);
}

/* ── OTP Block ──────────────────────────────────────────────────── */
.woo-otp-block {
    margin: 0 0 16px;
}

/* ── Phone Wrap ─────────────────────────────────────────────────── */
.woo-otp-phone-wrap,
.woo-otp-code-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.woo-otp-country-code {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    height: 42px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: #444;
}

.woo-otp-phone-input,
.woo-otp-code-input {
    flex: 1;
    min-width: 0;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.woo-otp-send-btn,
.woo-otp-verify-btn {
    white-space: nowrap;
    padding: 0 16px;
    height: 42px;
    font-size: 13px;
    font-weight: 600;
    background: var(--wc-primary, #96588a);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.woo-otp-send-btn:hover,
.woo-otp-verify-btn:hover {
    background: var(--wc-primary-dark, #7a4570);
    color: #fff;
}

.woo-otp-send-btn:disabled,
.woo-otp-verify-btn:disabled,
.woo-otp-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Verified state */
.woo-otp-block.is-verified .woo-otp-verify-btn {
    background: #4caf50;
}

/* ── Hint / Resend ──────────────────────────────────────────────── */
.woo-otp-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

.woo-otp-resend-btn {
    background: none;
    border: none;
    color: var(--wc-primary, #96588a);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.woo-otp-resend-btn:disabled {
    color: #aaa;
    cursor: default;
    text-decoration: none;
}

/* ── Status Message ─────────────────────────────────────────────── */
.woo-otp-status {
    margin: 6px 0 0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
}

.woo-otp-status.is-success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 3px solid #4caf50;
}

.woo-otp-status.is-error {
    display: block;
    background: #ffebee;
    color: #c62828;
    border-left: 3px solid #ef5350;
}

.woo-otp-status.is-info {
    display: block;
    background: #e3f2fd;
    color: #1565c0;
    border-left: 3px solid #2196f3;
}

/* ── Verified Tick ──────────────────────────────────────────────── */
.woo-otp-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
    margin-top: 4px;
}

.woo-otp-verified-badge svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ── Checkout Box ───────────────────────────────────────────────── */
.woo-otp-checkout-box {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px 24px 16px;
    margin-bottom: 24px;
}

.woo-otp-checkout-box h3 {
    margin-top: 0;
}

.woo-otp-checkout-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}

/* ── Submit Login Button ────────────────────────────────────────── */
.woo-otp-submit-btn {
    margin-top: 8px;
    background: var(--wc-primary, #96588a);
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.woo-otp-submit-btn:hover:not(:disabled) {
    background: var(--wc-primary-dark, #7a4570);
    color: #fff;
}

/* ── Loading Spinner ────────────────────────────────────────────── */
@keyframes woo-otp-spin {
    to { transform: rotate(360deg); }
}

.woo-otp-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: woo-otp-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
