

/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Modal overlay */
.pv-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    overflow: auto;
}

/* Active modal */
.pv-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal content */
.pv-modal-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    max-width: 460px;
    width: 90%;
    max-height: 90vh;
    padding: 32px;
    position: relative;
    animation: slideDown 0.4s ease-out forwards;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    text-align: center;
    margin: auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #e5e7eb;
}

/* Scrollbar styles for Webkit browsers */
.pv-modal-content::-webkit-scrollbar {
    width: 8px;
}

.pv-modal-content::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 4px;
}

.pv-modal-content::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

/* Slide-in animation */
@keyframes slideDown {
    from { transform: translateY(-60px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Close button */
.pv-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease, transform 0.2s ease;
}

.pv-close:hover,
.pv-close:focus {
    color: #1f2937;
    transform: scale(1.1);
    outline: none;
}

/* Title */
.pv-modal-content h2 {
    margin: 0 0 20px;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.025em;
}

/* Phone display */
.pv-phone {
    margin: 0 0 20px;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

/* OTP input container */
.pv-otp-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 20px;
    direction: ltr;
}

/* Individual OTP input */
.pv-otp-input {
    width: 48px;
    height: 56px;
    padding: 8px;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pv-otp-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
    outline: none;
}

.pv-otp-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

.pv-otp-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}

/* Buttons */
.pv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    margin: 8px 4px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pv-btn-primary {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    color: #ffffff;
}

.pv-btn-primary:hover,
.pv-btn-primary:focus {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    outline: none;
}

.pv-btn-success {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    color: #ffffff;
}

.pv-btn-success:hover,
.pv-btn-success:focus {
    background: linear-gradient(90deg, #16a34a, #15803d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    outline: none;
}

.pv-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.pv-btn-secondary:hover,
.pv-btn-secondary:focus {
    background: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: none;
}

/* Button loading state */
.pv-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.pv-btn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid #ffffff;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

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

.pv-btn.loading span:not(.spinner) {
    visibility: hidden;
}

/* Global spinner */
.pv-spinner {
    display: none;
    margin: 20px auto;
    width: 36px;
    height: 36px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pv-spinner.active {
    display: block;
}

/* Timer & message */
.pv-timer {
    margin-top: 12px;
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
}

.pv-message {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
}

/* Form message */
.form-message--success,
.jet-form-message--success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.form-message--error,
.jet-form-message--error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

/* Responsive design */
@media (max-width: 480px) {
    .pv-modal {
        padding: 10px;
    }

    .pv-modal-content {
        width: 95%;
        padding: 24px 16px;
        max-height: 85vh;
        border-radius: 16px;
    }

    .pv-btn {
        width: 100%;
        margin: 10px 0;
        padding: 12px;
    }

    .pv-modal-content h2 {
        font-size: 20px;
    }

    .pv-otp-input {
        width: 40px;
        height: 48px;
        font-size: 18px;
    }

    .pv-otp-container {
        gap: 8px;
    }
}

/* Spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pv-modal-content {
        background: linear-gradient(145deg, #1f2937, #111827);
        color: #f3f4f6;
    }
    .pv-close {
        color: #9ca3af;
    }
    .pv-close:hover,
    .pv-close:focus {
        color: #f3f4f6;
    }
    .pv-otp-input {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    .pv-otp-input:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3);
    }
}