.qwizard-wrap {
    max-width: 1120px;
}

.qwizard-card {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 0;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(20, 22, 35, 0.12);
    overflow: hidden;
    margin-top: 24px;
    width: 100%;
}

.qwizard-side {
    background: #f4f6fb;
    padding: 22px;
    border-right: 1px solid #e0e5ef;
    display: flex;
    flex-direction: column;
}

.qwizard-nav {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: #344054;
    font-weight: 600;
    margin-bottom: 6px;
}

.qwizard-nav.is-active,
.qwizard-nav:hover {
    background: #ffffff;
    color: #544094;
    box-shadow: 0 2px 10px rgba(20, 22, 35, 0.06);
}

.wizard-nav-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #d9e0ec;
}

.quote-link {
    display: block;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    font-weight: 600;
    color: inherit;
}

.quote-link:hover {
    text-decoration: underline;
}

.qwizard-main {
    padding: 28px;
    min-width: 0;
}

.qwizard-section {
    display: none;
    min-width: 0;
}

.qwizard-section.is-active {
    display: block;
}

.qwizard-section h2 {
    margin-top: 0;
    color: #2f2c55;
}

.qwizard-section h3 {
    margin-top: 24px;
    color: #3f3a69;
}

.helper {
    color: #667085;
    font-size: 0.95rem;
    margin-top: -4px;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 8px;
}

.choice-card {
    border: 1px solid #d8deea;
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    background: #fff;
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.choice-card:hover,
.choice-card:has(input:checked) {
    border-color: #873d92;
    box-shadow: 0 5px 18px rgba(135, 61, 146, 0.12);
}

.choice-list {
    display: grid;
    gap: 10px;
    margin: 14px 0 18px;
}

.choice-list label,
.visit-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #d8deea;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    cursor: pointer;
}

.checkbox-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.branch {
    display: none;
    min-width: 0;
}

.branch.is-visible {
    display: block;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field-grid.three {
    grid-template-columns: 1fr 100px 140px;
}

.field-grid > div {
    min-width: 0;
}

.qwizard-buttons,
.qwizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

.qwizard-actions {
    justify-content: flex-start;
}

.qwizard-actions button {
    width: auto;
    min-width: 220px;
}

button.secondary {
    background: #f2f4f7;
    color: #344054;
}

.message.success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

.qwizard-review {
    border: 1px solid #d8deea;
    border-radius: 14px;
    background: #f8f9fc;
    padding: 18px;
}

.review-list {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px 18px;
    margin: 0;
}

.review-list dt {
    font-weight: 700;
    color: #344054;
}

.review-list dd {
    margin: 0;
    color: #101828;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.policy-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 20px 0;
    padding: 14px;
    border: 1px solid #d8deea;
    border-radius: 12px;
    background: #f8f9fc;
    font-size: 0.95rem;
}

.policy-check input {
    margin-top: 3px;
}

@media (max-width: 800px) {
    .policy-check {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .policy-check input[type="checkbox"] {
        flex: 0 0 auto;
        margin-top: 3px;
    }
}

.qwizard-main input[type="text"],
.qwizard-main input[type="email"],
.qwizard-main input[type="tel"],
.qwizard-main input[type="file"],
.qwizard-main textarea,
.qwizard-main select {
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
    font-size: 16px;
}

.qwizard-main textarea {
    min-height: 118px;
    margin: 0 0 24px;
    padding: 14px 16px;
    border: 1px solid #cfd6df;
    border-radius: 12px;
    background: #fff;
    color: #1d2433;
    line-height: 1.45;
    resize: vertical;
    overflow: auto;
}

.qwizard-main input[type="email"],
.qwizard-main input[type="tel"],
.qwizard-main input[type="text"] {
    height: 58px;
    margin: 0 0 24px;
    padding: 14px 16px;
    border: 1px solid #cfd6df;
    border-radius: 12px;
    background: #fff;
    color: #1d2433;
}

.qwizard-main input:focus,
.qwizard-main textarea:focus {
    outline: 3px solid rgba(47, 102, 224, 0.18);
    border-color: #2f66e0;
}

@media (max-width: 800px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-left: 10px;
        padding-right: 10px;
    }

    .page-wrap.qwizard-wrap {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 18px 12px;
        overflow: visible;
    }

    .qwizard-card {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        border-radius: 14px;
    }

    .qwizard-side {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        display: flex;
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-right: 0;
        border-bottom: 1px solid #e0e5ef;
        align-items: stretch;
    }

    .qwizard-nav {
        flex: 0 0 auto;
        width: auto;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .wizard-nav-footer {
        flex: 0 0 auto;
        margin-top: 0;
        margin-left: 10px;
        padding-top: 0;
        border-top: 0;
    }

    .quote-link {
        white-space: nowrap;
    }

    .qwizard-main {
        width: 100%;
        max-width: 100%;
        padding: 18px 14px;
        overflow: visible;
    }

    .qwizard-section,
    .branch,
    .choice-grid,
    .choice-list,
    .field-grid,
    .field-grid.three,
    .qwizard-buttons,
    .qwizard-actions {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .choice-grid,
    .checkbox-list,
    .field-grid,
    .field-grid.three {
        grid-template-columns: 1fr;
    }

    .choice-card,
    .choice-list label,
    .visit-check {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        font-size: 16px;
        line-height: 1.35;
    }

    .qwizard-main textarea {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 120px;
        max-height: 220px;
        resize: none;
        overflow-y: auto;
        font-size: 16px;
        line-height: 1.4;
        -webkit-appearance: none;
        appearance: none;
    }

    .qwizard-buttons,
    .qwizard-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 22px;
        overflow: visible;
    }

    .qwizard-actions button,
    .qwizard-buttons button,
    .qwizard-main button {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 56px;
        white-space: normal;
        overflow: visible;
    }

    .review-list {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .review-list dd {
        margin-bottom: 14px;
    }
}
