/* ==========================================================================
   /quiz-stroitelstvo/ — Step-by-step diagnostic quiz for construction companies
   Mobile-first, brand: #c495ff, font: Inter, prefix: qstr-
   ========================================================================== */

/* --- Hero --- */
.qstr-hero {
    background: #c495ff;
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    text-align: center;
}

.qstr-hero__inner {
    max-width: 640px;
    margin: 0 auto;
}

.qstr-hero__title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.qstr-hero__subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.5;
}

/* --- Pains: Probative "Знакомо?" + cost of inaction --- */
.qstr-pains {
    padding: 2.5rem 0 1.5rem;
}

.qstr-pains__title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin: 0 0 1.5rem;
}

.qstr-pains__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto;
}

.qstr-pains__card {
    background: #fff;
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 24px rgba(196, 149, 255, 0.12);
}

.qstr-pains__icon {
    margin-bottom: 0.5rem;
}

.qstr-pains__text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.5;
    margin: 0 0 0.5rem;
}

.qstr-pains__cost {
    font-size: 0.85rem;
    color: #92400e;
    background: #fff7ed;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin: 0;
    line-height: 1.4;
}

.qstr-pains__cta {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #c495ff;
    margin: 1.5rem 0 0;
}

@media (min-width: 768px) {
    .qstr-pains {
        padding: 3rem 0 2rem;
    }
    .qstr-pains__grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }
}

/* --- Quiz container --- */
.qstr-quiz {
    background: #fff;
    padding: 2rem 0 3rem;
}

.qstr-quiz__inner {
    max-width: 640px;
    margin: 0 auto;
}

/* --- Progress bar --- */
.qstr-progress {
    margin-bottom: 1.5rem;
}

.qstr-progress__text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
    text-align: center;
}

.qstr-progress__bar {
    height: 4px;
    background: #e9d5ff;
    border-radius: 999px;
    overflow: hidden;
}

.qstr-progress__fill {
    height: 100%;
    background: #c495ff;
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* --- Question: step-by-step --- */
.qstr-question {
    display: none;
}

.qstr-question--active {
    display: block;
    animation: qstrFadeIn 0.3s ease;
}

@keyframes qstrFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.qstr-question h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.75rem;
}

.qstr-hint {
    font-weight: 400;
    color: #64748b;
    font-size: 0.85rem;
}

.qstr-question__options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- Radio/checkbox option as card --- */
.qstr-option {
    display: block;
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
    overflow: hidden;
}

.qstr-option:hover {
    border-color: #c495ff;
    transform: translateY(-2px);
}

.qstr-option input[type="radio"],
.qstr-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.qstr-option--selected {
    border-color: #c495ff;
    background: #f8efff;
}

/* Timer bar on selected radio (auto-advance indicator) */
.qstr-option--selected::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #c495ff;
    border-radius: 0 0 12px 12px;
    animation: qstrTimerBar 0.8s linear forwards;
}

/* No timer bar for multi-choice checkboxes */
.qstr-option--multi.qstr-option--selected::after {
    display: none;
}

@keyframes qstrTimerBar {
    from { width: 0; }
    to { width: 100%; }
}

/* --- Navigation buttons --- */
.qstr-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    min-height: 2.5rem;
}

.qstr-nav__back {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.qstr-nav__back:hover {
    color: #c495ff;
}

.qstr-nav__next {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: #c495ff;
    border: 2px solid #c495ff;
    border-radius: 12px;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    margin-left: auto;
}

.qstr-nav__next:hover:not(:disabled) {
    background: #fff;
    color: #c495ff;
}

.qstr-nav__next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Outcome container --- */
.qstr-outcome {
    animation: qstrFadeIn 0.4s ease;
}

.qstr-outcome__back {
    margin-bottom: 1rem;
}

/* --- Submit button --- */
.qstr-btn {
    display: block;
    width: 100%;
    background: #c495ff;
    color: #fff;
    border: 2px solid #c495ff;
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    margin-top: 1.5rem;
}

.qstr-btn:hover {
    background: #fff;
    color: #c495ff;
}

.qstr-btn:active {
    transform: scale(0.98);
}

.qstr-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qstr-btn:disabled:hover {
    background: #c495ff;
    color: #fff;
    transform: none;
}

/* --- Result: diagnostic card --- */
.qstr-result {
    margin-top: 1rem;
}

.qstr-result__card {
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(196, 149, 255, 0.12);
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.qstr-result__badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #c495ff;
    margin: 0 0 1rem;
}

.qstr-result__level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.qstr-result__level-label {
    font-size: 0.9rem;
    color: #64748b;
}

.qstr-result__level-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.qstr-result__level--1 {
    background: #fee2e2;
    color: #991b1b;
}

.qstr-result__level--2 {
    background: #fef9c3;
    color: #854d0e;
}

.qstr-result__level--3 {
    background: #dcfce7;
    color: #166534;
}

.qstr-result__profile {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e9d5ff;
}

.qstr-result__section {
    margin-bottom: 1.25rem;
}

.qstr-result__section:last-child {
    margin-bottom: 0;
}

.qstr-result__section-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #c495ff;
    margin: 0 0 0.5rem;
}

.qstr-result__hours {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem;
}

.qstr-result__hours-note {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.qstr-result__issues {
    list-style: none;
    padding: 0;
    margin: 0;
}

.qstr-result__issues li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}

.qstr-result__issues li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
}

.qstr-result__step {
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.5;
    margin: 0;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid #c495ff;
}

/* --- Contact form --- */
.qstr-contact {
    margin-top: 2rem;
}

.qstr-contact__title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem;
    text-align: center;
}

.qstr-contact__fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qstr-contact__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.qstr-contact__field-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
}

.qstr-contact__input {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.qstr-contact__input::placeholder {
    color: #94a3b8;
}

.qstr-contact__input:focus {
    border-color: #c495ff;
    box-shadow: 0 0 0 3px rgba(196, 149, 255, 0.15);
}

.qstr-contact__agree {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
    margin-top: 0.5rem;
}

.qstr-contact__agree input[type="checkbox"] {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.qstr-contact__agree a {
    color: #c495ff;
    text-decoration: none;
}

.qstr-contact__agree a:hover {
    text-decoration: underline;
}

/* --- Success message --- */
.qstr-success {
    display: none;
    background: #dcfce7;
    color: #166534;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 1.5rem;
}

.qstr-success--visible {
    display: block;
}

/* --- Trust line --- */
.qstr-trust {
    text-align: center;
    font-size: 0.95rem;
    color: #64748b;
    margin-top: 2rem;
}

/* --- Skrepysh fallback --- */
.qstr-fallback {
    text-align: center;
    margin-top: 1.25rem;
}

.qstr-fallback__link {
    color: #64748b;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.qstr-fallback__link:hover {
    color: #c495ff;
}

/* --- Honeypot (same as global) --- */
.gg--form-field-url {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* --- Responsive --- */
@media (min-width: 768px) {
    .qstr-quiz {
        padding: 2.5rem 0 4rem;
    }

    .qstr-contact__fields {
        flex-direction: row;
        gap: 1rem;
    }

    .qstr-contact__field {
        flex: 1;
    }
}
