/**
 * Pilbe OTP Verification Modal
 * Overlay with 6-digit code input, branded #25ADDE
 */

/* ── Overlay ── */
.pilbe-otp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.pilbe-otp-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Card ── */
.pilbe-otp-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 440px;
    padding: 40px 36px 32px;
    text-align: center;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}
.pilbe-otp-overlay.active .pilbe-otp-card {
    transform: translateY(0) scale(1);
}

/* ── Brand header bar ── */
.pilbe-otp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, #25ADDE 0%, #1B8AB5 100%);
    border-radius: 16px 16px 0 0;
}

/* ── Icon ── */
.pilbe-otp-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #25ADDE 0%, #1B8AB5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(37, 173, 222, 0.3);
}
.pilbe-otp-icon .pilbe-otp-icon-emoji {
    font-size: 32px;
    line-height: 1;
    color: #fff;
    font-style: normal;
}

/* ── Typography ── */
.pilbe-otp-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.pilbe-otp-card .pilbe-otp-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 28px;
    line-height: 1.5;
}
.pilbe-otp-card .pilbe-otp-email {
    color: #25ADDE;
    font-weight: 600;
}

/* ── Digit inputs ── */
.pilbe-otp-digits {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}
.pilbe-otp-digits input {
    width: 50px;
    height: 58px;
    border: 2px solid #e0e4e8;
    border-radius: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #f9fafb;
    caret-color: #25ADDE;
    font-family: 'Courier New', monospace;
    appearance: textfield;
    -moz-appearance: textfield;
}
.pilbe-otp-digits input::-webkit-outer-spin-button,
.pilbe-otp-digits input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pilbe-otp-digits input:focus {
    border-color: #25ADDE;
    box-shadow: 0 0 0 3px rgba(37, 173, 222, 0.15);
    background: #fff;
}
.pilbe-otp-digits input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    animation: pilbe-shake 0.4s ease;
}
.pilbe-otp-digits input.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ── Verify button ── */
.pilbe-otp-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #25ADDE 0%, #1B8AB5 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    letter-spacing: 0.3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.pilbe-otp-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 173, 222, 0.35);
}
.pilbe-otp-btn:active:not(:disabled) {
    transform: translateY(0);
}
.pilbe-otp-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.pilbe-otp-btn .pilbe-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pilbe-spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* ── Messages ── */
.pilbe-otp-message {
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    display: none;
}
.pilbe-otp-message.error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.pilbe-otp-message.success {
    display: block;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ── Footer: resend + attempts ── */
.pilbe-otp-footer {
    margin-top: 20px;
    font-size: 13px;
    color: #9ca3af;
}
.pilbe-otp-footer a {
    color: #25ADDE;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.pilbe-otp-footer a:hover {
    text-decoration: underline;
}
.pilbe-otp-footer a.disabled {
    color: #d1d5db;
    cursor: default;
    pointer-events: none;
}
.pilbe-otp-countdown {
    font-variant-numeric: tabular-nums;
}

/* ── Animations ── */
@keyframes pilbe-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}
@keyframes pilbe-spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .pilbe-otp-card {
        margin: 16px;
        padding: 32px 24px 24px;
    }
    .pilbe-otp-digits input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
    .pilbe-otp-digits {
        gap: 6px;
    }
}
