/* House Quiz - Стили */
:root {
    --hq-accent: #c5b08e;
    --hq-accent-dark: #b09a6e;
    --hq-bg: #f5f5f5;
    --hq-card: #ffffff;
    --hq-text: #333333;
    --hq-text-light: #666666;
    --hq-incentive: #4a4a4a;
    --hq-online: #22c55e;
    --hq-radius: 12px;
    --hq-radius-sm: 8px;
    --hq-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.house-quiz {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--hq-bg);
    padding: 30px 20px;
    color: var(--hq-text);
    border-radius: 30px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 901px) {
    html {
        scrollbar-gutter: stable;
    }

    .house-quiz {
        padding: 60px 20px;
        /* Фиксированная минимальная ширина — ширина не зависит от контента шага */
        min-width: 1200px;
    }
}

@media (max-width: 900px) {
    .house-quiz {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .house-quiz {
        padding: 16px 0;
    }
    .hq-main {
        padding: 16px 0;
    }
    .hq-progress-wrap {
        margin-bottom: 16px;
        padding: 0 12px;
    }
    .hq-question-header {
        margin-bottom: 16px;
        padding: 0 12px;
    }
    .hq-options {
        gap: 10px;
        padding: 0 12px;
    }
    .hq-option-card {
        padding: 12px 14px;
    }
    .hq-option-image-wrap {
        border-radius: 6px;
    }
    .hq-option-label {
        margin-top: 6px;
        font-size: 14px;
    }
    .hq-nav {
        margin-top: 20px;
        padding: 0 12px;
    }
    .hq-contact-methods,
    .hq-contact-fields {
        padding: 0 12px;
    }
    /* Первый шаг: картинки на весь блок без отступов */
    .hq-options-grid-4 {
        gap: 0;
        padding: 0;
    }
    .hq-options-grid-4 .hq-option-card {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .hq-options-grid-4 .hq-option-image-wrap {
        border-radius: 0;
    }
    .hq-options-grid-4 .hq-option-label {
        padding: 8px;
        margin-top: 0;
    }
}

.hq-container {
    max-width: 1200px;
    width: 100%;
    min-width: 1200px; /* Совпадает с .house-quiz — постоянная ширина на десктопе */
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    align-items: stretch;
    box-sizing: border-box;
}

/* Поле квиза — фон, скругление 30px, выравнивание по высоте с сайдбаром */
.hq-main {
    background: var(--hq-card);
    padding: 24px;
    border-radius: 30px;
    box-shadow: var(--hq-shadow);
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.hq-form,
.hq-step,
.hq-options {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.hq-form {
    display: flex;
    flex-direction: column;
}

@media (max-width: 900px) {
    .hq-container {
        grid-template-columns: 1fr;
        min-width: 0;
    }
}

/* Прогресс-бар */
.hq-progress-wrap {
    margin-bottom: 24px;
}

.hq-progress-bar {
    position: relative;
    height: 36px;
    background: #e8e4dc;
    border-radius: 18px;
    overflow: hidden;
}

.hq-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: repeating-linear-gradient(
        -45deg,
        var(--hq-accent),
        var(--hq-accent) 6px,
        var(--hq-accent-dark) 6px,
        var(--hq-accent-dark) 12px
    );
    border-radius: 18px;
    transition: width 0.3s ease;
}

.hq-progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--hq-text);
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
    z-index: 2;
}

/* Вопрос */
.hq-question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.hq-question-badge {
    background: var(--hq-accent);
    color: white;
    padding: 6px 14px;
    border-radius: var(--hq-radius-sm);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.hq-question-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

/* Опции */
.hq-step {
    display: none;
}

.hq-step.active {
    display: block;
}

.hq-step-contact .hq-nav {
    display: none;
}

.hq-options {
    display: grid;
    gap: 16px;
    align-items: stretch;
    justify-items: stretch;
}

.hq-options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hq-options-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hq-options-5 .hq-option-full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .hq-options-grid {
        grid-template-columns: 1fr;
    }
    .hq-options-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hq-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 20px;
    background: var(--hq-card);
    border-radius: var(--hq-radius);
    box-shadow: var(--hq-shadow);
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    border: 2px solid transparent;
    box-sizing: border-box;
}

.hq-option-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.hq-option-card input {
    position: absolute;
    opacity: 0;
}

.hq-option-card input:checked + .hq-option-check,
.hq-option-card input:checked ~ .hq-option-text,
.hq-option-card:has(input:checked) {
    border-color: var(--hq-accent);
}

.hq-option-card:has(input:checked) {
    border-color: var(--hq-accent);
    box-shadow: 0 4px 16px rgba(197, 176, 142, 0.25);
}

.hq-option-check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.hq-option-card input:checked + .hq-option-check {
    background: var(--hq-accent);
    border-color: var(--hq-accent);
}

.hq-option-check::after {
    content: '';
    font-size: 14px;
    font-weight: bold;
}

.hq-option-card input:checked + .hq-option-check::after {
    content: '✓';
    color: white;
}

.hq-option-text {
    display: block;
    width: 100%;
    min-width: 0;
    font-size: 16px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* Опции с картинками */
.hq-option-image {
    flex-direction: column;
    text-align: center;
}

.hq-option-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--hq-radius-sm);
    overflow: hidden;
    background: #e8e4dc;
}

.hq-option-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hq-img-placeholder {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8e4dc 0%, #d4cfc4 100%);
    font-size: 14px;
    color: var(--hq-text-light);
    font-weight: 500;
}

.hq-option-label {
    margin-top: 10px;
    width: 100%;
    min-width: 0;
    font-size: 15px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* Контактный шаг */
.hq-contact-methods {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hq-contact-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 16px 24px;
    border-radius: var(--hq-radius);
    border: 2px solid #e0e0e0;
    transition: all 0.2s;
}

@media (max-width: 768px) {
    .hq-contact-methods {
        flex-wrap: nowrap;
    }
    .hq-contact-method {
        flex: 1;
        min-width: 0;
        padding: 12px 8px;
    }
    .hq-contact-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

.hq-contact-method:hover {
    border-color: var(--hq-accent);
}

.hq-contact-method input {
    position: absolute;
    opacity: 0;
}

.hq-contact-method:has(input:checked) {
    border-color: var(--hq-accent);
    background: rgba(197, 176, 142, 0.1);
}

.hq-contact-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #e8e4dc;
    transition: all 0.2s;
}

.hq-icon-phone { background: var(--hq-accent); }
.hq-icon-telegram { background: #0088cc; }
.hq-icon-email { background: var(--hq-accent); }

.hq-contact-method:has(input:checked) .hq-contact-icon {
    box-shadow: 0 0 0 3px rgba(197, 176, 142, 0.4);
}

.hq-contact-label {
    font-size: 14px;
    font-weight: 600;
}

.hq-contact-fields {
    max-width: 400px;
}

.hq-field {
    margin-bottom: 16px;
}

.hq-field input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: var(--hq-radius-sm);
    font-size: 16px;
    transition: border-color 0.2s;
}

.hq-field input:focus {
    outline: none;
    border-color: var(--hq-accent);
}

.hq-privacy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
    font-size: 14px;
    color: var(--hq-text-light);
    cursor: pointer;
}

.hq-privacy input {
    margin-top: 3px;
    flex-shrink: 0;
}

.hq-btn-submit {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
}

/* Навигация */
.hq-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
}

.hq-btn {
    padding: 14px 28px;
    background: var(--hq-accent);
    color: white;
    border: none;
    border-radius: var(--hq-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.hq-btn:hover {
    background: var(--hq-accent-dark);
}

.hq-btn-back {
    background: transparent;
    color: var(--hq-text);
    border: 2px solid #ddd;
}

.hq-btn-back:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

/* Сайдбар */
.hq-sidebar {
    background: #f0ede8;
    border-radius: var(--hq-radius);
    padding: 24px;
    position: sticky;
    top: 24px;
}

.hq-online-badge {
    display: inline-block;
    background: var(--hq-online);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.hq-manager {
    text-align: center;
    margin-bottom: 20px;
}

.hq-manager-photo {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    background: #d4cfc4;
}

.hq-manager-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hq-manager-placeholder {
    display: flex !important;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--hq-accent);
}

.hq-manager-name {
    font-size: 18px;
    font-weight: 700;
}

.hq-manager-role {
    font-size: 14px;
    color: var(--hq-text-light);
}

.hq-sidebar-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--hq-text);
    margin-bottom: 20px;
}

.hq-incentive h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hq-text-light);
    margin: 0 0 12px;
}

.hq-incentive-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--hq-incentive);
    color: white;
    border-radius: var(--hq-radius-sm);
    font-weight: 500;
}

.hq-lock-icon {
    font-size: 16px;
}
