/* =============================================
   Quiz Modal Styles
   ============================================= */
.pm-quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 47, 93, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: 'Inter', 'Gilroy', sans-serif;
}

.pm-quiz-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.pm-quiz-dialog {
    position: relative;
    width: 100%;
    max-width: 800px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pm-quiz-overlay.is-open .pm-quiz-dialog {
    transform: translateY(0);
}

.pm-quiz-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
    z-index: 10;
}

.pm-quiz-close:hover {
    background: #f1f5f9;
    color: #002f5d;
}

/* Header */
.pm-quiz-header {
    background: #f4f7fa;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pm-quiz-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #475569;
    font-weight: 500;
}

.pm-quiz-counter {
    font-size: 15px;
    font-weight: 600;
    color: #002f5d;
}

/* Progress */
.pm-quiz-progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e6ed;
}

.pm-quiz-progress-fill {
    height: 100%;
    background: #00a3e0;
    width: 33.33%;
    transition: width 0.4s ease;
}

/* Body */
.pm-quiz-body {
    padding: 40px 32px;
    min-height: 350px;
    position: relative;
}

.pm-quiz-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.pm-quiz-step.is-active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.pm-quiz-step h2 {
    font-size: 28px;
    color: #002f5d;
    margin: 0 0 32px 0;
    font-weight: 600;
}

/* Options */
.pm-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-quiz-radio input,
.pm-quiz-checkbox input {
    display: none;
}

.pm-quiz-option-box {
    display: block;
    padding: 16px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 16px;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pm-quiz-option-box:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.pm-quiz-radio input:checked + .pm-quiz-option-box,
.pm-quiz-checkbox input:checked + .pm-quiz-option-box {
    border-color: #00a3e0;
    background: #f0f9ff;
    color: #002f5d;
    box-shadow: 0 4px 12px rgba(0, 163, 224, 0.15);
}

/* Final Step */
.pm-quiz-step--final p {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 24px;
}

.pm-quiz-input-group {
    max-width: 400px;
}

.pm-quiz-input-group input {
    width: 100%;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

.pm-quiz-input-group input:focus {
    border-color: #00a3e0;
}

/* Success Step */
.pm-quiz-step--success {
    text-align: center;
    padding: 20px 0;
}
.pm-quiz-success-icon {
    margin-bottom: 20px;
}

/* Footer */
.pm-quiz-footer {
    display: flex;
    padding: 24px 32px;
    border-top: 1px solid #e0e6ed;
    background: #fff;
    border-radius: 0 0 16px 16px;
}

.pm-quiz-spacer {
    flex: 1;
}

.pm-quiz-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-family: inherit;
}

.pm-quiz-btn--prev {
    background: transparent;
    color: #475569;
}

.pm-quiz-btn--prev:hover {
    color: #002f5d;
    background: #f1f5f9;
}

.pm-quiz-btn--primary {
    background: #00a3e0;
    color: #fff;
}

.pm-quiz-btn--primary:hover:not(:disabled) {
    background: #0088cc;
}

.pm-quiz-btn--primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Mobile Adaptation */
@media (max-width: 768px) {
    .pm-quiz-overlay {
        align-items: flex-end;
    }
    
    .pm-quiz-dialog {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
    }
    
    .pm-quiz-header {
        padding: 16px 20px;
    }
    
    .pm-quiz-title span {
        display: none; /* Hide long title on mobile */
    }
    .pm-quiz-title::after {
        content: "Подбор системы"; /* Short title */
        font-weight: 600;
        color: #002f5d;
    }
    
    .pm-quiz-body {
        padding: 24px 20px;
        overflow-y: auto;
    }
    
    .pm-quiz-step h2 {
        font-size: 22px;
        margin-bottom: 24px;
    }
    
    .pm-quiz-footer {
        padding: 16px 20px;
    }
    
    .pm-quiz-btn {
        width: 100%;
        padding: 16px;
    }
    
    .pm-quiz-btn--prev {
        display: none !important; /* On mobile, we might rely on the top close or keep it, let's keep it but make it small */
    }
}
