.ipal-quote {
    --quote-ink: #223021;
    --quote-muted: #505d4c;
    --quote-green: #3d6922;
    --quote-orange: #b84500;
    --quote-leaf: #edf3e7;
    --quote-line: #b8c4b3;
    max-width: 760px;
    margin-inline: auto;
    padding: clamp(16px, 4vw, 32px);
    border: 1px solid #dce2d6;
    border-radius: 18px;
    background: #f4f5ef;
    color: var(--quote-ink);
    text-align: left;
}

.ipal-quote *, .ipal-quote *::before, .ipal-quote *::after { box-sizing: border-box; }
.ipal-quote [hidden] { display: none !important; }
.ipal-quote p { margin: 0; }
.ipal-quote .ipal-quote__intro { margin-bottom: 16px; color: var(--quote-muted); }
.ipal-quote fieldset { border: 0; min-width: 0; padding: 0; margin: 16px 0 0; }
.ipal-quote legend { padding: 0; font-weight: 600; }

.ipal-quote__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    counter-reset: quote-step;
}

.ipal-quote__steps li {
    display: flex;
    align-items: center;
    gap: 7px;
    counter-increment: quote-step;
    color: var(--quote-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.ipal-quote__steps li::before {
    content: counter(quote-step);
    display: grid;
    place-items: center;
    flex: 0 0 25px;
    height: 25px;
    border: 1px solid var(--quote-line);
    border-radius: 50%;
    background: #fff;
}

.ipal-quote__steps [aria-current="step"] { color: var(--quote-green); }
.ipal-quote__steps [aria-current="step"]::before { background: var(--quote-green); border-color: var(--quote-green); color: #fff; }
.ipal-quote__steps [data-complete]::before { color: var(--quote-green); background: var(--quote-leaf); }

.ipal-quote__panel {
    padding: clamp(14px, 4vw, 24px);
    border: 1px solid #dce2d6;
    border-radius: 12px;
    background: #fff;
}

.ipal-quote__panel:not([hidden]) + .ipal-quote__panel { margin-top: 12px; }
.ipal-quote .ipal-quote__panel h2 { margin: 0 0 6px; padding: 0; color: var(--quote-ink); font-size: clamp(1.25rem, 3vw, 1.6rem); }
.ipal-quote .ipal-quote__panel > p { color: var(--quote-muted); }
.ipal-quote .wpcf7-list-item { margin: 0; }
.ipal-quote input:is([type="checkbox"], [type="radio"]) { accent-color: var(--quote-green); flex: 0 0 auto; margin: 0; }
.ipal-quote .wpcf7-list-item label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; }
.ipal-quote .wpcf7-not-valid-tip { color: #a12b1a; }
.ipal-quote .wpcf7-form-control-wrap { display: block; }

.ipal-quote__choices .wpcf7-radio,
.ipal-quote__fields,
.ipal-quote__checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin-top: 7px;
}

.ipal-quote__choices .wpcf7-radio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ipal-quote__choices .wpcf7-list-item label {
    padding: 7px 9px;
    border: 1px solid var(--quote-line);
    border-radius: 8px;
}
.ipal-quote__choices label:has(:checked) { background: var(--quote-leaf); border-color: var(--quote-green); }
.ipal-quote__work-type .wpcf7-checkbox { display: flex; flex-wrap: wrap; gap: 0 18px; }

.ipal-quote__fields { gap: 13px; margin-top: 16px; }
.ipal-quote__wide { grid-column: 1 / -1; }
.ipal-quote .ipal-quote__fields label { display: block; min-width: 0; font-weight: 600; }
.ipal-quote .ipal-quote__fields fieldset { margin: 0; }
.ipal-quote small { color: var(--quote-muted); font-size: 0.8125rem; font-weight: 400; }

.ipal-quote__fields :is(input, select, textarea) {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 5px 0 0;
    padding: 8px 10px;
    border: 1px solid var(--quote-line);
    border-radius: 8px;
    background: #fff;
    color: var(--quote-ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 400;
}
.ipal-quote__consent { margin-top: 15px; }
.ipal-quote__consent p { margin-top: 5px; }
.ipal-quote .wpcf7-turnstile { margin-top: 15px; }

.ipal-quote__review {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 5px 12px;
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f4f5ef;
    overflow-wrap: anywhere;
}
.ipal-quote__review dt { font-weight: 600; }
.ipal-quote__review dd { margin: 0; }

.ipal-quote__actions { margin-top: 14px; }
.ipal-quote .ipal-quote__error { margin-bottom: 10px; color: #a12b1a; }
.ipal-quote__buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ipal-quote [data-quote-submit], .ipal-quote button.ipal-quote__primary { margin-inline-start: auto; }

.ipal-quote .ipal-quote__primary, .ipal-quote .ipal-quote__back {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    background: var(--quote-orange);
    color: #fff;
    font: inherit;
    font-weight: 600;
}
.ipal-quote .ipal-quote__back { background: var(--quote-leaf); color: var(--quote-green); }
.ipal-quote .ipal-quote__primary:hover { background: #963700; }
.ipal-quote :focus-visible { outline: 2px solid var(--quote-green); outline-offset: 3px; }

@media (max-width: 540px) {
    .ipav-form-slot:has([data-ipal-quote]) {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .ipal-quote {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .ipal-quote__choices .wpcf7-radio, .ipal-quote__fields, .ipal-quote__checks {
        grid-template-columns: minmax(0, 1fr);
    }

    .ipal-quote__fields { gap: 16px; }
    .ipal-quote__checks { gap: 2px; }
    .ipal-quote__work-type .wpcf7-checkbox { flex-direction: column; }
    .ipal-quote__steps li { gap: 4px; }
    .ipal-quote__steps li + li { margin-top: 0; }
    .ipal-quote__steps li::before { flex-basis: 21px; height: 21px; }
    .ipal-quote__review { grid-template-columns: 1fr; }
}
