
/* Modal Overlay */
.viper-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.61);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.viper-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.viper-modal {
    background: #f7f9fe;
    border-radius: 20px;
    width: 950px;
    max-width: 95vw;
    max-height: 86vh;
    overflow: hidden;
    box-shadow: 0px -6px 104px 0px rgba(0, 0, 0, 0.05);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s ease;
    position: relative;
}

.viper-modal-overlay.active .viper-modal {
    transform: translateY(0) scale(1);
}

/* Close Button */
.viper-modal-close {
    position: absolute;
    top: 24px;
    right: 30px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.viper-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* .viper-modal-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
} */

/* Header Section */
.viper-modal-header {
    background: #155bff;
    height: 160px;
    position: relative;
    overflow: hidden;
    background-image: url('../images/form-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viper-modal-title {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-bold);
    font-size: 32px;
    color: white;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -0.64px;
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Content Section */
.viper-modal-content {
    padding: 2rem 60px 4rem;
    overflow-y: auto;
    max-height: calc(95vh - 160px);
}

.viper-modal-subtitle {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    font-size: 18px;
    color: var(--color-text-primary);
    text-align: center;
    line-height: 1.4;
    letter-spacing: -0.18px;
    margin-bottom: 20px;
}

/* Form Layout */
.viper-form-grid {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.viper-form-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.viper-form-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Form Fields */
.viper-field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
}

.viper-field-label {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-semibold);
    font-size: 14px;
    color: #000000;
    letter-spacing: -0.28px;
}

.viper-field-required {
    color: #ff4444;
}

.viper-field-wrapper {
    background: #ffffff;
    border: 1px solid #e0eaf8;
    border-radius: 10px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    transition: all 0.2s ease;
    position: relative;
}

.viper-field-wrapper:focus-within {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(21, 91, 255, 0.1);
}

.viper-field-wrapper.textarea-wrapper {
    height: auto;
    min-height: 240px;
    align-items: flex-start;
    padding: 15px;
}

/* Error States */
.viper-field-wrapper:has(.viper-field-input.error) {
    border-color: #ff4444;
}

.viper-field-input.error {
    color: #ff4444;
}

.viper-field-error {
    font-family: var(--font-family-primary);
    font-size: 12px;
    color: #ff4444;
    margin-top: 4px;
    min-height: 16px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.viper-field-error:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

.viper-field-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.viper-field-input {
    border: none;
    outline: none;
    background: none;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    font-size: 16px;
    color: var(--color-text-primary);
    letter-spacing: -0.16px;
    flex: 1;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.viper-field-input::placeholder {
    opacity: 0.5;
    color: var(--color-text-primary);
}

.viper-field-textarea {
    border: none;
    outline: none;
    background: none;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    font-size: 16px;
    color: var(--color-text-primary);
    letter-spacing: -0.16px;
    flex: 1;
    resize: none;
    line-height: 1.4;
    min-height: 200px;
}

.viper-field-textarea::placeholder {
    opacity: 0.5;
    color: var(--color-text-primary);
}

/* Submit Button - Use EXACT Hero Banner Style */
.viper-submit-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* Override the hero banner button styles for modal context */
.viper-modal .btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0;
    background: transparent;
    border: none;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: var(--transition-normal);
    gap: 0;
    cursor: pointer;
    position: relative;
    z-index: 13;
}

.viper-modal .btn-primary:hover {
    transform: translateY(-2px);
    color: var(--color-text-primary);
}

/* .viper-modal .btn-primary:focus {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
} */

.viper-modal .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.viper-modal .btn-primary:disabled:hover {
    transform: none;
}

.viper-modal .btn-primary .btn-text {
    background: var(--color-viper-green);
    color: var(--color-dark-navy);
    padding: var(--spacing-md) var(--spacing-2xl);
    border-radius: var(--border-radius-full);
    font-weight: var(--font-weight-semibold);
    transition: var(--transition-normal);
}

.viper-modal .btn-primary .btn-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--color-viper-green);
    border-radius: 50%;
    font-size: var(--font-size-lg);
    color: var(--color-dark-navy);
    transition: var(--transition-normal);
}

.viper-modal .btn-primary:hover .btn-text {
    background: #9FE63A;
}

.viper-modal .btn-primary:hover .btn-arrow {
    background: #9FE63A;
    transform: translateX(4px);
}

/* Terms Text */
.viper-terms-text {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    font-size: 14px;
    color: rgba(9, 16, 38, 0.7);
    text-align: center;
    line-height: 1.4;
    letter-spacing: -0.28px;
}

.viper-terms-link {
    font-weight: var(--font-weight-medium);
    color: var(--color-brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

.viper-terms-link:hover {
    text-decoration: underline;
    color: var(--color-brand-dark);
}

/* Separator Line */
.viper-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e0eaf8, transparent);
    margin: 30px 0 20px;
}

/* Loading State */
.viper-modal .btn-primary.loading {
    position: relative;
    background: transparent !important;
    border: none !important;
}

/* Hide the entire button content during loading */
.viper-modal .btn-primary.loading .btn-text,
.viper-modal .btn-primary.loading .btn-arrow {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Show loading spinner in button's place */
.viper-modal .btn-primary.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid #e0eaf8;
    border-top: 3px solid var(--color-brand);
    border-radius: 50%;
    animation: viperSpin 1s linear infinite;
}

@keyframes viperSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Success/Error Messages */
.viper-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-family: var(--font-family-primary);
    font-size: 14px;
    text-align: center;
    border: 1px solid;
    position: relative;
    opacity: 0;
    transform: translateY(-10px);
    animation: viperMessageSlideIn 0.3s ease forwards;
}

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

.viper-message.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #c3e6cb;
    color: #155724;
}

.viper-message.success::before {
    content: '✓';
    position: absolute;
    left: 15px;
    font-weight: bold;
    font-size: 16px;
}

.viper-message.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #f5c6cb;
    color: #721c24;
}

.viper-message.error::before {
    content: '⚠';
    position: absolute;
    left: 15px;
    font-weight: bold;
    font-size: 16px;
}

/* Form Animation */
.viper-form-grid {
    opacity: 0;
    transform: translateY(20px);
    animation: viperFormSlideIn 0.5s ease 0.2s forwards;
}

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

/* Focus Indicators */
.viper-field-input:focus,
.viper-field-textarea:focus {
    box-shadow: none;
    /* Remove default browser focus */
}

/* Success state - hide form and show clean message */
.viper-modal.success-state #viperForm {
    display: none !important;
}

.viper-modal.success-state .viper-form-grid {
    display: none !important;
}

.viper-modal.success-state .viper-separator {
    display: none !important;
}

.viper-modal.success-state .viper-submit-wrapper {
    display: none !important;
}

.viper-modal.success-state .viper-terms-text {
    display: none !important;
}

.viper-modal.success-state .viper-modal-subtitle {
    margin-bottom: 0;
}

/* Error icon next to submit button */
.viper-submit-error {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viper-error-icon {
    position: absolute;
    right: 235px;
    /* Position to the right of the button */
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #ff4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: help;
    z-index: 10;
}

/* Error tooltip */
.viper-error-tooltip {
    position: absolute;
    bottom: 164%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-bottom: 5px;
}

.viper-error-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.viper-error-icon:hover .viper-error-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Success message styling */
.viper-success-content {
    text-align: center;
    padding: 40px 20px;
}

.viper-success-content h3 {
    color: #00a32a;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.viper-success-content p {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {

    .viper-modal-overlay,
    .viper-modal,
    .viper-modal .btn-primary,
    .viper-message,
    .viper-form-grid {
        animation: none;
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .viper-field-wrapper {
        border-width: 2px;
    }

    .viper-field-wrapper:focus-within {
        border-width: 3px;
    }

    .viper-modal .btn-primary {
        border: 2px solid var(--color-dark-navy);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .viper-modal {
        width: 90vw;
        margin: 20px;
    }

    .viper-form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .viper-modal-content {
        padding: 30px 40px 40px;
    }
}

@media (max-width: 768px) {
    .viper-modal {
        width: 95vw;
        margin: 10px;
        max-height: 90vh;
    }

    .viper-modal-content {
        padding: 20px 30px 30px;
    }

    .viper-modal-title {
        font-size: 24px;
    }

    .viper-modal-subtitle {
        font-size: 16px;
    }

    .viper-field-wrapper.textarea-wrapper {
        min-height: 150px;
    }

    .viper-field-textarea {
        min-height: 160px;
    }

    .viper-modal .btn-primary {
        font-size: 14px;
    }

    .viper-modal .btn-primary .btn-text {
        padding: 14px 30px;
        font-size: 14px;
    }

    .viper-modal .btn-primary .btn-arrow {
        width: 48px;
        height: 48px;
    }

    .viper-form-left {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .viper-modal-header {
        height: 120px;
    }

    .viper-modal-title {
        font-size: 20px;
        padding: 0 20px;
    }

    .viper-modal-content {
        padding: 20px;
    }

    .viper-modal .btn-primary .btn-text {
        padding: 14px 30px;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .viper-modal-overlay {
        display: none !important;
    }
}

.viper-demo-question {
    margin: 30px 0 20px;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.viper-demo-question .viper-field-label {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-semibold);
    font-size: 14px;
    color: #000000;
    letter-spacing: -0.28px;
    display: block;
    text-align: center;
}

.viper-radio-group {
    display: flex;
    justify-content: center;
    gap: 30px;
    align-items: center;
}

.viper-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    font-size: 16px;
    color: var(--color-text-primary);
    transition: all 0.2s ease;
}

.viper-radio-label:hover {
    opacity: 0.8;
}

.viper-radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-brand);
}

.viper-radio-text {
    user-select: none;
}

/* Radio button custom styling for better appearance */
.viper-radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e0eaf8;
    border-radius: 50%;
    background: white;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.viper-radio-label input[type="radio"]:hover {
    border-color: var(--color-brand);
}

.viper-radio-label input[type="radio"]:checked {
    border-color: var(--color-brand);
    background: var(--color-brand);
}

.viper-radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

@media (max-width: 768px) {
    .viper-demo-question {
        margin: 20px 0 15px;
    }

    .viper-radio-group {
        gap: 20px;
    }

    .viper-radio-label {
        font-size: 14px;
    }
}
