/**
 * WPFOK SMS OTP Frontend Styles
 * OTP verification modal popup for checkout pages.
 * Brand colors: #8f00ff (violet), #0b0412 (black)
 *
 * @package WPFOK
 */

/* ═══════════════════════════════════════════════════════════════════════
   OTP MODAL OVERLAY
   ═══════════════════════════════════════════════════════════════════════ */
.wpfok-otp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 4, 18, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wpfok-otp-overlay.wpfok-otp-active {
    opacity: 1;
    visibility: visible;
}

/* ═══════════════════════════════════════════════════════════════════════
   OTP MODAL BOX
   ═══════════════════════════════════════════════════════════════════════ */
.wpfok-otp-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(11, 4, 18, 0.2), 0 0 0 1px rgba(143, 0, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.wpfok-otp-active .wpfok-otp-modal {
    transform: scale(1) translateY(0);
}

/* ── Modal Header ── */
.wpfok-otp-header {
    background: linear-gradient(135deg, #0b0412 0%, #1a0d2e 50%, #7200cc 100%);
    padding: 24px 28px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.wpfok-otp-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(143, 0, 255, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.wpfok-otp-header-icon {
    width: 56px;
    height: 56px;
    background: rgba(143, 0, 255, 0.25);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.wpfok-otp-header-icon svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

.wpfok-otp-header h3 {
    margin: 0 0 6px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.wpfok-otp-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.4;
}

/* ── Modal Body ── */
.wpfok-otp-body {
    padding: 28px;
}

.wpfok-otp-phone-display {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: #f4f1f8;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1225;
    letter-spacing: 0.03em;
}

.wpfok-otp-phone-display span {
    color: #8f00ff;
}

/* ── OTP Input Fields ── */
.wpfok-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.wpfok-otp-inputs input {
    width: 52px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: #1a1225;
    border: 2px solid #e8e2f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s;
    background: #faf8ff;
    caret-color: #8f00ff;
}

.wpfok-otp-inputs input:focus {
    border-color: #8f00ff;
    box-shadow: 0 0 0 4px rgba(143, 0, 255, 0.12);
    background: #ffffff;
}

.wpfok-otp-inputs input.wpfok-otp-filled {
    border-color: #8f00ff;
    background: rgba(143, 0, 255, 0.04);
}

.wpfok-otp-inputs input.wpfok-otp-error {
    border-color: #ef4444;
    animation: wpfok-otp-shake 0.4s;
}

@keyframes wpfok-otp-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ── OTP Buttons ── */
.wpfok-otp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpfok-otp-overlay .wpfok-otp-btn-verify,
.wpfok-otp-overlay button#wpfok-otp-verify.wpfok-otp-btn-verify,
button#wpfok-otp-verify.wpfok-otp-btn-verify {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff !important;
    background: linear-gradient(135deg, #8f00ff, #a733ff) !important;
    border: none !important;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(143, 0, 255, 0.3);
    letter-spacing: 0.02em;
    -webkit-appearance: none;
    appearance: none;
}

.wpfok-otp-overlay .wpfok-otp-btn-verify:hover,
button#wpfok-otp-verify.wpfok-otp-btn-verify:hover {
    color: #ffffff !important;
    background: linear-gradient(135deg, #7200cc, #8f00ff) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(143, 0, 255, 0.4);
}

.wpfok-otp-btn-verify:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wpfok-otp-btn-resend {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #6b5f7a;
    background: transparent;
    border: 1px solid #e8e2f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.wpfok-otp-btn-resend:hover {
    border-color: #8f00ff;
    color: #8f00ff;
    background: rgba(143, 0, 255, 0.04);
}

.wpfok-otp-btn-resend:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── OTP Timer ── */
.wpfok-otp-timer {
    text-align: center;
    font-size: 12px;
    color: #9b92a8;
    margin-top: 8px;
}

.wpfok-otp-timer span {
    color: #8f00ff;
    font-weight: 700;
}

/* ── OTP Message (success/error) ── */
.wpfok-otp-message {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
}

.wpfok-otp-message.wpfok-otp-msg-success {
    display: block;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.wpfok-otp-message.wpfok-otp-msg-error {
    display: block;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.wpfok-otp-message.wpfok-otp-msg-info {
    display: block;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ── VPN Warning ── */
.wpfok-otp-vpn-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #b45309;
}

.wpfok-otp-vpn-alert svg {
    width: 16px;
    height: 16px;
    fill: #f59e0b;
    flex-shrink: 0;
}

.wpfok-otp-close {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 480px) {
    .wpfok-otp-modal {
        width: 95%;
        max-width: none;
        margin: 10px;
    }

    .wpfok-otp-inputs input {
        width: 44px;
        height: 48px;
        font-size: 18px;
    }

    .wpfok-otp-header {
        padding: 20px 20px 16px;
    }

    .wpfok-otp-body {
        padding: 20px;
    }
}
