/* ── Wall-Hall Angebotsfinder ── Custom Style Refinements ── */

.wh-quiz {
    width: 100%;
    box-sizing: border-box;
    position: relative;
}
.wh-quiz__inner {
    margin: 0 auto;
    text-align: center;
}

/* ── Typography ── */
.wh-quiz__headline {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 .5em;
    color: #2d3b2a;
    font-family: inherit;
}
.wh-quiz__subline {
    font-style: italic;
    font-size: clamp(.95rem, 2vw, 1.2rem);
    margin: 0 0 2em;
    color: #7c8a74;
    opacity: 0.9;
}
.wh-quiz__footnote {
    font-size: .85rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7c8a74;
    opacity: 0.9;
    margin: 2em 0 0;
}
.wh-quiz__max-hint {
    font-size: .85rem;
    color: #b05a3a;
    margin: -.5em 0 1em;
}

/* ── Pills grid (Step 1) ── */
.wh-quiz__pills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 50px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.wh-quiz .wh-quiz__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border: 1px solid #c2c9bc;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    background: transparent;
    color: #2d3b2a;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    min-height: 42px;
    outline-offset: 4px;
}

/* HOVER state (matching "Selbstzweifel" from the screenshot): slight shadow, dark border */
.wh-quiz .wh-quiz__pill:hover,
.wh-quiz .wh-quiz__pill:focus {
    border-color: #2d3b2a;
    background: rgba(45, 59, 42, 0.02);
    box-shadow: 0 4px 15px rgba(45, 59, 42, 0.08);
    transform: translateY(-1px);
    color: #2d3b2a;
}

/* ACTIVE/SELECTED state (matching "alles zu viel" from the screenshot): olive-green, white checkmark */
.wh-quiz .wh-quiz__pill.is-selected {
    background: #b1b98b;
    border-color: #b1b98b;
    color: #fff;
    box-shadow: 0 4px 15px rgba(177, 185, 139, 0.3);
    transform: translateY(-1px);
}

.wh-quiz .wh-quiz__pill.is-selected::after {
    content: " ✓";
    font-size: .9em;
    margin-left: .25em;
    font-weight: bold;
}

/* ── Cards grid (Step 2): Exact 3x2 Grid ── */
.wh-quiz__cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .wh-quiz__cards-grid { 
        grid-template-columns: repeat(2, minmax(0, 1fr)); 
    }
}
@media (max-width: 480px) {
    .wh-quiz__cards-grid { 
        grid-template-columns: minmax(0, 1fr); 
    }
}

.wh-quiz .wh-quiz__card {
    color: var(--e-global-color-secondary, #526A59);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 30px 20px;
    border: 1px solid #c2c9bc;
    border-radius: 12px;
    cursor: pointer;
    background: #ffffff;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    min-height: 140px;
    outline-offset: 4px;
    box-shadow: none;
}

/* HOVER state (card): slight shadow, dark border, light background shift */
.wh-quiz .wh-quiz__card:hover,
.wh-quiz .wh-quiz__card:focus {
    background-color: #f3f1e9;
    color: #2d3b2a;
    border-color: #2d3b2a;
    box-shadow: 0 6px 15px rgba(45, 59, 42, 0.08);
    transform: translateY(-2px);
}

/* SELECTED state (card): olive background, white text and inverted icon */
.wh-quiz .wh-quiz__card.is-selected {
    background: #b1b98b;
    border-color: #b1b98b;
    box-shadow: 0 6px 15px rgba(177, 185, 139, 0.3);
    transform: translateY(-2px);
}

.wh-quiz__card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wh-quiz__card-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.wh-quiz__card-icon svg {
    display: block;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.wh-quiz__card-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3b2a;
    transition: color .16s;
    text-align: center;
}

/* Invert colors when card is selected */
.wh-quiz .wh-quiz__card.is-selected .wh-quiz__card-label { 
    color: #ffffff; 
}
.wh-quiz .wh-quiz__card.is-selected .wh-quiz__card-icon img {
    filter: brightness(0) invert(1);
}
.wh-quiz .wh-quiz__card.is-selected .wh-quiz__card-icon {
    color: #ffffff;
}

/* ── Actions row ── */
.wh-quiz__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: .5em;
}

/* ── Primary button ── */
.wh-quiz .wh-quiz__btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 40px;
    background: #3d422b; /* exact dark background from screen */
    color: #fff;
    border: none;
    border-radius: var(--wh-button-radius, 8px);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s ease;
    min-height: 44px;
    text-decoration: none;
    box-shadow: none;
}
.wh-quiz .wh-quiz__btn-primary:disabled,
.wh-quiz__btn-primary[aria-disabled="true"] {
    background: #e0e0e0;
    color: #999;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
}
.wh-quiz .wh-quiz__btn-primary:not(:disabled):not([aria-disabled="true"]):hover,
.wh-quiz .wh-quiz__btn-primary:not(:disabled):not([aria-disabled="true"]):focus {
    opacity: .9;
    transform: translateY(-1px);
}

/* ── Secondary button ── */
.wh-quiz .wh-quiz__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    background: transparent;
    color: #2d3b2a;
    border: 1px solid #c2c9bc;
    border-radius: var(--wh-button-radius, 8px);
    font-size: 1.1rem;
    cursor: pointer;
    min-height: 44px;
    transition: background-color 0.25s ease;
}
.wh-quiz .wh-quiz__btn-secondary:hover,
.wh-quiz .wh-quiz__btn-secondary:focus {
    color: #2d3b2a; 
    background: rgba(0,0,0,0.02);
    border-color: #2d3b2a;
}

/* Results keep template styling independent of the centred selection steps. */
.wh-quiz__results { margin:1.4em 0; display:flex; flex-direction:column; gap:1.5rem; width:100%; text-align:left; }
.wh-quiz__result-card { width:100%; min-width:0; margin:0; padding:0; }
.wh-quiz__result-card--template { container-type:inline-size; container-name:wh-result; }
.wh-quiz__result-card--template > .elementor { width:100%; min-width:0; }
.wh-quiz__result-card--fallback { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,3fr); background:#eee9dd; border-radius:20px; overflow:hidden; }
.wh-quiz__result-card--fallback > img { width:100%; height:100%; object-fit:cover; }
.wh-quiz__result-card--fallback:not(:has(> img)) { grid-template-columns:1fr; }
.wh-quiz__result-content { padding:1.5rem; min-width:0; }
.wh-quiz__result-content h3 { margin:0 0 1rem; }
.wh-quiz__result-needs { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.75rem; }
.wh-quiz__result-card--fallback .wh-quiz__result-needs { grid-column:1 / -1; padding:0 1.5rem 1.5rem; }
.wh-quiz__result-needs-tag { padding:.3rem .65rem; border:1px solid #c2c9bc; border-radius:20px; font-size:.8rem; color:#686b5b; }
.wh-quiz__pill-icon { width:24px; height:24px; object-fit:contain; margin-right:.5rem; }
.wh-quiz button:focus-visible, .wh-quiz a:focus-visible { outline:2px solid #86906b; outline-offset:4px; }

/* Compact rendering of the image/text Wizard-Card structure. Native V4
   template styles supply colours, fonts and decoration; no fixed element IDs. */
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base {
    display:flex; flex-direction:row; align-items:stretch; gap:0; width:100%; max-width:100%; margin:0;
    min-height:320px; overflow:hidden; text-align:left;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :first-child {
    width:40%; flex:0 0 40%; padding:0; position:relative; min-width:0;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :first-child .e-image-base {
    position:absolute; inset:0; width:100%; height:100%; aspect-ratio:auto; object-fit:cover; border-radius:0;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :last-child {
    display:flex; flex-direction:column; justify-content:center; gap:0; width:60%; flex:0 0 60%;
    min-width:0; padding:clamp(1rem,3cqw,2rem); box-sizing:border-box;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template .e-heading-base {
    font-size:clamp(1.6rem,4cqw,2.4rem); line-height:1.15; margin:0 0 1rem; overflow-wrap:normal; hyphens:none;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :last-child > .e-paragraph-base {
    width:100%; font-size:clamp(1rem,2.1cqw,1.25rem); line-height:1.5; margin:0;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :last-child > .e-paragraph-base:first-child {
    font-size:.9rem; letter-spacing:0; margin-bottom:.5rem;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template .e-divider-base { width:100%; margin:1.5rem 0 0; }
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :last-child > .e-flexbox-base {
    display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:.75rem .75rem; margin:1.25rem 0 0; width:100%;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :last-child > .e-flexbox-base > .e-flexbox-base {
    display:flex; flex-direction:row; align-items:center; width:auto; flex:0 0 auto; gap:.4rem;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template .e-flexbox-base > .e-flexbox-base > .e-flexbox-base > .e-flexbox-base > .e-paragraph-base {
    margin:0; font-size:.85rem; letter-spacing:0; white-space:nowrap;
}
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template .elementor-widget-icon { width:1rem; flex:0 0 1rem; }
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template .elementor-icon { font-size:1rem; }
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template .elementor-icon :is(svg,i) { width:1em; height:1em; font-size:1em; fill:currentColor; }
.wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template .e-button-base {
    width:auto; min-height:44px; height:auto; flex:0 0 auto; font-size:.85rem; padding:.7rem 1rem; white-space:nowrap;
}
@container wh-result (max-width:640px) {
    .wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base { flex-direction:column; }
    .wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :first-child { width:100%; flex:auto; min-height:220px; }
    .wh-quiz[data-wh-layout="wizard-card"] .wh-quiz__result-card--template > .elementor > .e-flexbox-base > :last-child { width:100%; flex:auto; padding:1.25rem; }
}
@media (max-width:640px) {
    .wh-quiz__result-card--fallback { grid-template-columns:1fr; }
    .wh-quiz__result-card--fallback > img { max-height:260px; }
}

/* ── Loader ── */
.wh-quiz__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.6);
    border-radius: inherit;
    z-index: 10;
}
.wh-quiz__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(61,61,32,.2);
    border-top-color: #3d3d20;
    border-radius: 50%;
    animation: wh-spin .7s linear infinite;
}
@keyframes wh-spin { to { transform: rotate(360deg); } }

/* ── Step fade-in ── */
.wh-quiz__step { animation: wh-fadein .22s ease; }
@keyframes wh-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion:reduce) { .wh-quiz__step, .wh-quiz__spinner { animation:none; } .wh-quiz button { transition:none; } }

/* Let long audience labels and actions wrap inside small phone screens. */
.wh-quiz button { white-space: normal; min-width: 0; max-width: 100%; box-sizing: border-box; }
.wh-quiz__card-label { max-width: 100%; overflow-wrap: anywhere; }
