/* ============================================================
   Elementor OTP Verification — Frontend Styles v2.3
   Responsive status badge, customizable button colors,
   countdown clickability, full mobile support (320px–1920px)
   ============================================================ */

/* --- CSS Custom Properties (overridable via inline style on body) -- */
:root {
    --eov-gen-bg: linear-gradient(135deg, #6c47ff, #9b7bfd);
    --eov-gen-bg-solid: #6c47ff;
    --eov-gen-color: #ffffff;
    --eov-gen-shadow: rgba(108, 71, 255, 0.30);

    --eov-ver-bg: linear-gradient(135deg, #10b981, #059669);
    --eov-ver-bg-solid: #10b981;
    --eov-ver-color: #ffffff;
    --eov-ver-shadow: rgba(16, 185, 129, 0.25);

    --eov-font: inherit;
    --eov-radius: 8px;
}

/* --- Button Wrapper ----------------------------------------- */
.eov-buttons-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    /* ← key for responsiveness */
    gap: 10px;
    margin: 8px 0;
    width: 100%;
}

/* --- OTP Buttons -------------------------------------------- */
.eov-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--eov-radius);
    font-family: var(--eov-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    line-height: 1.3;
}

.eov-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.2s;
}

.eov-btn:hover::before {
    background: rgba(255, 255, 255, 0.12);
}

.eov-btn:active {
    transform: scale(0.97);
}

.eov-btn:focus-visible {
    outline: 3px solid rgba(108, 71, 255, 0.5);
    outline-offset: 2px;
}

/* Generate OTP */
.generate-otp {
    background: var(--eov-gen-bg);
    color: var(--eov-gen-color);
    box-shadow: 0 2px 10px var(--eov-gen-shadow);
}

.generate-otp:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--eov-gen-shadow);
}

.generate-otp:disabled {
    opacity: 0.60;
    cursor: not-allowed;
    transform: none;
}

/* Verify OTP */
.verify-otp {
    background: var(--eov-ver-bg);
    color: var(--eov-ver-color);
    box-shadow: 0 2px 10px var(--eov-ver-shadow);
}

.verify-otp:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--eov-ver-shadow);
}

.verify-otp:disabled {
    opacity: 0.60;
    cursor: not-allowed;
    transform: none;
}

.verify-otp.eov-verified {
    background: linear-gradient(135deg, #059669, #047857);
}

.verify-otp.eov-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25);
}

.eov-btn-icon svg {
    display: block;
    flex-shrink: 0;
}

/* --- Countdown Badge --------------------------------------- */
.eov-countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;

    /* Default: timer running — not clickable */
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    cursor: default;
    pointer-events: none;
}

/* Resend-ready state: becomes a clickable link */
.eov-countdown.eov-resend-ready {
    color: #6c47ff;
    background: #ede9ff;
    border-color: #c4b5fd;
    cursor: pointer;
    pointer-events: all;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.eov-countdown.eov-resend-ready:hover {
    background: #ddd6fe;
    transform: translateY(-1px);
}

.eov-countdown.eov-resend-ready:focus-visible {
    outline: 3px solid rgba(108, 71, 255, 0.4);
    outline-offset: 2px;
}

/* --- Status Badge ------------------------------------------ */
.eov-status-badge {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 100%;
    /* ← responsive: never overflow */
    word-break: break-word;
    animation: eovFadeIn 0.25s ease;
}

.eov-status-badge.visible {
    display: inline-flex;
    flex-shrink: 1;
    min-width: 0;
}

.eov-status-badge span {
    min-width: 0;
    overflow-wrap: break-word;
}

.eov-status-badge svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.eov-status-badge--success {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.eov-status-badge--error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.eov-status-badge--info {
    background: #ede9ff;
    color: #6c47ff;
    border: 1px solid #ddd6fe;
}

@keyframes eovFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive: stack on small screens -------------------- */

/* Tablet ≤ 768px */
@media (max-width: 768px) {
    .eov-buttons-wrap {
        gap: 8px;
    }

    .eov-btn {
        font-size: 13px;
        padding: 9px 15px;
    }

    .eov-status-badge {
        font-size: 12px;
        padding: 5px 12px;
    }

    .eov-countdown {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* Mobile ≤ 480px: full-width buttons, stacked layout */
@media (max-width: 480px) {
    .eov-buttons-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .eov-btn {
        width: 100%;
        justify-content: center;
        font-size: 14px;
        padding: 11px 16px;
    }

    .eov-status-badge {
        width: 100%;
        justify-content: flex-start;
        border-radius: 8px;
        font-size: 13px;
    }

    .eov-countdown {
        width: 100%;
        justify-content: center;
        border-radius: 8px;
    }
}

/* Smallest screens ≤ 320px */
@media (max-width: 320px) {
    .eov-btn {
        font-size: 13px;
        padding: 10px 12px;
    }
}