/* ============================================================
   Elementor OTP Verification Styles
   FIX: !important on OTP inputs to beat theme CSS overrides
   ============================================================ */

/* Overlay */
.eov-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    animation: eov-fadeIn 0.3s ease;
}

.eov-overlay.active {
    display: flex;
}

/* Modal */
.eov-modal {
    background: #fff !important;
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    animation: eov-slideUp 0.4s ease;
}

.eov-modal * {
    box-sizing: border-box;
}

.eov-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.eov-modal__close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Icon */
.eov-modal__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eov-modal__icon svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.eov-modal__title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e !important;
    margin: 0 0 8px;
}

.eov-modal__subtitle {
    font-size: 14px;
    color: #666 !important;
    margin: 0 0 28px;
    line-height: 1.5;
}

/* ============================================================
   OTP Input Group — CRITICAL FIX
   Your theme overrides input colors to white/transparent.
   Using maximum specificity + !important + -webkit-text-fill-color
   to guarantee digits are visible.
   ============================================================ */
.eov-otp-inputs {
    display: flex !important;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.eov-modal .eov-otp-inputs input[type="text"].eov-otp-input,
.eov-overlay .eov-otp-inputs input[type="text"].eov-otp-input,
input[type="text"].eov-otp-input {
    width: 48px !important;
    height: 56px !important;
    min-height: 56px !important;
    max-width: 48px !important;
    text-align: center !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    font-family: 'Arial', 'Helvetica', sans-serif !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 12px !important;
    outline: none !important;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s !important;
    background-color: #fafafa !important;
    background-image: none !important;

    /* THE FIX — force text color visible */
    color: #1a1a2e !important;
    -webkit-text-fill-color: #1a1a2e !important;
    -moz-text-fill-color: #1a1a2e !important;
    opacity: 1 !important;
    caret-color: #667eea !important;

    /* Reset everything a theme might set */
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    line-height: 56px !important;
    letter-spacing: 0 !important;
    text-indent: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    vertical-align: middle !important;
    float: none !important;
    position: static !important;
}

.eov-modal .eov-otp-inputs input[type="text"].eov-otp-input:focus,
.eov-overlay .eov-otp-inputs input[type="text"].eov-otp-input:focus,
input[type="text"].eov-otp-input:focus {
    border-color: #667eea !important;
    background-color: #ffffff !important;
    color: #1a1a2e !important;
    -webkit-text-fill-color: #1a1a2e !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
}

.eov-modal .eov-otp-inputs input[type="text"].eov-otp-input::placeholder {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

.eov-modal .eov-otp-inputs input[type="text"].eov-otp-input:-webkit-autofill {
    -webkit-text-fill-color: #1a1a2e !important;
    background-color: #fafafa !important;
    box-shadow: 0 0 0px 1000px #fafafa inset !important;
}

input[type="text"].eov-otp-input.error {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
    -webkit-text-fill-color: #e74c3c !important;
    animation: eov-shake 0.4s ease;
}

input[type="text"].eov-otp-input.success {
    border-color: #27ae60 !important;
    background-color: #f0fdf4 !important;
    color: #27ae60 !important;
    -webkit-text-fill-color: #27ae60 !important;
}

/* Verify Button */
.eov-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    gap: 8px;
}

.eov-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.eov-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.eov-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: eov-spin 0.6s linear infinite;
}

.eov-btn.loading .eov-spinner {
    display: inline-block;
}

.eov-btn.loading .eov-btn__text {
    display: none;
}

/* Timer & Resend */
.eov-timer-row {
    margin-top: 20px;
    font-size: 14px;
    color: #888 !important;
}

.eov-timer-row .eov-timer {
    font-weight: 700;
    color: #667eea !important;
}

.eov-resend-btn {
    background: none;
    border: none;
    color: #667eea !important;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.eov-resend-btn:disabled {
    color: #ccc !important;
    cursor: not-allowed;
    text-decoration: none;
}

/* Messages */
.eov-message {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.eov-message.error {
    display: block;
    background: #fef2f2 !important;
    color: #dc2626 !important;
    -webkit-text-fill-color: #dc2626 !important;
    border: 1px solid #fecaca;
}

.eov-message.success {
    display: block;
    background: #f0fdf4 !important;
    color: #16a34a !important;
    -webkit-text-fill-color: #16a34a !important;
    border: 1px solid #bbf7d0;
}

/* Phone validation error on Elementor form */
.eov-phone-error {
    color: #e74c3c !important;
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

.eov-phone-error.visible {
    display: block;
}

/* Sending OTP overlay on form */
.eov-form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.eov-form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: eov-spin 0.6s linear infinite;
}

/* Success check animation */
.eov-success-icon {
    display: none;
    margin: 0 auto 20px;
}

.eov-success-icon svg {
    width: 72px;
    height: 72px;
}

.eov-success-icon .eov-check-circle {
    stroke: #27ae60;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: eov-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.eov-success-icon .eov-check {
    stroke: #27ae60;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: eov-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

/* Animations */
@keyframes eov-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes eov-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes eov-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

@keyframes eov-spin {
    to { transform: rotate(360deg); }
}

@keyframes eov-stroke {
    100% { stroke-dashoffset: 0; }
}

/* Responsive */
@media (max-width: 480px) {
    .eov-modal {
        padding: 28px 20px;
    }

    .eov-modal .eov-otp-inputs input[type="text"].eov-otp-input,
    input[type="text"].eov-otp-input {
        width: 40px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-width: 40px !important;
        font-size: 20px !important;
        line-height: 48px !important;
    }

    .eov-otp-inputs {
        gap: 6px;
    }
}
