/* First-party hair-pattern and routine quizzes. */
.afro-quiz-page {
    width: 100%;
    max-width: none;
    padding: 0 0 var(--space-section);
    overflow: clip;
}

.afro-quiz-hero {
    padding: clamp(2.75rem, 8vw, 6rem) 0;
    color: var(--rose-text);
    border-bottom: 0.45rem solid var(--rose-primary);
    background: linear-gradient(135deg, var(--rose-blush), #f7eee8 62%, var(--rose-soft-teal));
}

.afro-quiz-hero--routine {
    background: linear-gradient(135deg, var(--rose-soft-teal), #f7eee8 65%, var(--rose-blush));
}

.afro-quiz-hero__inner { max-width: 56rem; }

.afro-quiz-hero h1 {
    max-width: 17ch;
    margin: 0.35rem 0 1rem;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 7vw, 4.8rem);
    font-variation-settings: "wght" 650, "opsz" 48, "SOFT" 35, "WONK" 0;
    line-height: 1.02;
}

.afro-quiz-intro {
    max-width: 47rem;
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.afro-quiz-layout,
.afro-routine-quiz-shell {
    display: grid;
    gap: clamp(1.25rem, 4vw, 2.5rem);
    padding-top: clamp(2rem, 6vw, 4rem);
}

.afro-quiz-panel,
.afro-pattern-result,
.afro-routine-result,
.afro-quiz-caveat {
    min-width: 0;
    border: 1px solid var(--rose-border);
    border-radius: var(--radius-card);
    background: var(--rose-surface);
    box-shadow: var(--shadow-elevated);
}

.afro-quiz-panel { padding: clamp(1rem, 3vw, 2rem); }

.afro-quiz-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.afro-quiz-fieldset legend {
    max-width: 28ch;
    margin: 0 0 0.5rem;
    color: var(--rose-wine);
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.35rem);
    font-weight: 650;
    font-variation-settings: "wght" 650, "opsz" 32, "SOFT" 35, "WONK" 0;
    line-height: 1.15;
}

.afro-quiz-help {
    max-width: 48rem;
    margin: 0 0 1.5rem;
    color: var(--rose-muted);
}

.afro-pattern-grid,
.afro-choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
}

.afro-pattern-card,
.afro-choice-card {
    position: relative;
    display: grid;
    min-width: 0;
    border: 2px solid var(--rose-border);
    border-radius: var(--radius-card);
    color: var(--rose-text);
    background: var(--rose-surface);
    cursor: pointer;
}

.afro-pattern-card { grid-template-rows: auto 1fr auto; overflow: hidden; }
.afro-choice-card { min-height: 5.25rem; align-content: center; padding: 1rem 3rem 1rem 1rem; }

.afro-pattern-card:hover,
.afro-choice-card:hover { border-color: var(--rose-soft-pink); }

.afro-pattern-card:has(input:checked),
.afro-choice-card:has(input:checked) {
    border-color: var(--rose-primary-hover);
    background: #fff9fa;
    box-shadow: 0 0 0 2px var(--rose-blush);
}

.afro-pattern-card:has(input:focus-visible),
.afro-choice-card:has(input:focus-visible) {
    outline: var(--focus-ring);
    outline-offset: 3px;
}

.afro-pattern-card input,
.afro-choice-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.afro-pattern-visual,
.afro-pattern-mixed-visual {
    display: grid;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    overflow: hidden;
    background: #faf3ee;
}

.afro-pattern-visual img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    color: var(--rose-wine);
    background: #faf3ee;
    font-size: 0.875rem;
}

.afro-pattern-mixed-visual {
    place-content: center;
    gap: 0.35rem;
    padding: 1rem;
    color: var(--rose-wine);
    background: linear-gradient(135deg, var(--rose-blush), var(--rose-soft-teal));
    text-align: center;
}

.afro-pattern-mixed-visual > span {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4.25rem);
    font-weight: 700;
    line-height: 1;
}

.afro-pattern-mixed-visual small { font-weight: 700; }

.afro-pattern-card__copy { display: grid; gap: 0.65rem; padding: 1rem; }
.afro-pattern-card__copy > strong { color: var(--rose-wine); font-size: 1.35rem; }
.afro-pattern-clues { display: grid; gap: 0.25rem; color: var(--rose-muted); font-size: 0.88rem; }
.afro-pattern-clues > span::before { content: "• "; color: var(--rose-primary); font-weight: 900; }

.afro-choice-indicator {
    padding: 0.65rem 1rem;
    color: var(--rose-primary-hover);
    border-top: 1px solid var(--rose-border);
    font-size: 0.85rem;
    font-weight: 800;
}

.afro-pattern-card:has(input:checked) .afro-choice-indicator::before { content: "✓ "; }
.afro-pattern-card:has(input:checked) .afro-choice-indicator { color: #fff; background: var(--rose-primary-hover); }

.afro-choice-card__label { color: var(--rose-wine); font-size: 1.05rem; font-weight: 800; }
.afro-choice-card small { display: block; margin-top: 0.2rem; color: var(--rose-muted); }
.afro-choice-check {
    position: absolute;
    top: 50%;
    right: 1rem;
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border: 2px solid var(--rose-control-border);
    border-radius: 50%;
    color: transparent;
    transform: translateY(-50%);
}
.afro-choice-card:has(input:checked) .afro-choice-check { color: #fff; border-color: var(--rose-primary-hover); background: var(--rose-primary-hover); }

.afro-pattern-sidebar:has([data-hair-type-result][hidden]) { display: none; }

.afro-pattern-result,
.afro-routine-result { padding: clamp(1.25rem, 4vw, 2.5rem); border-top: 0.4rem solid var(--rose-primary); }
.afro-pattern-result h2,
.afro-routine-result > h2 { margin: 0.2rem 0 0.75rem; font-family: var(--font-display); }
.afro-pattern-result .afro-button { margin-top: 0.75rem; }

.afro-quiz-note {
    padding: 0.9rem 1rem;
    color: var(--rose-wine);
    border-left: 4px solid var(--rose-primary);
    background: var(--rose-blush);
}

.afro-quiz-caveat { padding: clamp(1.2rem, 3vw, 2rem); background: var(--rose-soft-teal); }
.afro-quiz-caveat h2 { margin-top: 0; font-family: var(--font-display); font-size: 1.55rem; }
.afro-quiz-caveat ul { margin-bottom: 0; padding-left: 1.25rem; }

.afro-quiz-static {
    max-width: 54rem;
    padding-top: clamp(3rem, 7vw, 5rem);
}
.afro-quiz-static h2 { font-family: var(--font-display); }

.afro-quiz-progress {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    color: var(--rose-wine);
    font-weight: 800;
}
.afro-quiz-progress progress { width: 100%; height: 0.7rem; accent-color: var(--rose-primary); }
.afro-quiz-progress progress::-webkit-progress-bar { border-radius: 999px; background: var(--rose-border); }
.afro-quiz-progress progress::-webkit-progress-value { border-radius: 999px; background: var(--rose-primary); }
.afro-quiz-progress progress::-moz-progress-bar { border-radius: 999px; background: var(--rose-primary); }

.afro-routine-step + .afro-routine-step { margin-top: 2.5rem; }
.is-enhanced .afro-routine-step + .afro-routine-step { margin-top: 0; }

.afro-quiz-actions,
.afro-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-top: 1.5rem;
}
.afro-quiz-actions .afro-button,
.afro-result-actions .afro-button { min-height: 3rem; }
.afro-quiz-error { padding: 0.7rem 0.9rem; color: var(--rose-error); border-left: 4px solid var(--rose-error); background: var(--rose-error-soft); font-weight: 700; }

.afro-profile-summary { padding: 1rem; border-radius: var(--radius-card); background: var(--rose-soft-teal); }
.afro-profile-summary h3 { margin-top: 0; }
.afro-profile-summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem 1rem; margin: 0; }
.afro-profile-summary dl > div { min-width: 0; }
.afro-profile-summary dt { color: var(--rose-muted); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.afro-profile-summary dd { margin: 0; color: var(--rose-wine); font-weight: 800; }
.afro-routine-explanation { max-width: 48rem; margin: 1.5rem 0; }

.afro-recommended-steps { display: grid; gap: 1rem; padding: 0; list-style: none; counter-reset: none; }
.afro-recommended-steps > li { padding: 1.15rem; border: 1px solid var(--rose-border); border-radius: var(--radius-card); background: #fff; }
.afro-recommended-steps h3 { margin: 0.2rem 0 0.35rem; }
.afro-recommended-steps p { margin: 0; }
.afro-step-number { color: var(--rose-primary-hover); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.afro-step-categories { display: flex; flex-wrap: wrap; gap: 0.4rem 0.65rem; align-items: baseline; margin-top: 0.8rem; }
.afro-step-category-label { width: 100%; color: var(--rose-muted); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.afro-step-categories a,
.afro-step-category { padding: 0.3rem 0.6rem; border-radius: 999px; color: var(--rose-wine); background: var(--rose-blush); font-size: 0.9rem; font-weight: 800; }

.afro-routine-notes { margin-top: 1.5rem; padding: 1.1rem 1.25rem; border-left: 4px solid var(--rose-teal); background: var(--rose-soft-teal); }
.afro-routine-notes h3 { margin-top: 0; }
.afro-routine-notes ul { margin-bottom: 0; padding-left: 1.2rem; }

@media (min-width: 42rem) {
    .afro-pattern-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .afro-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .afro-profile-summary dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
    .afro-pattern-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .afro-quiz-layout { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; }
    .afro-quiz-layout .afro-quiz-panel { grid-column: 1; grid-row: 1; }
    .afro-quiz-layout .afro-quiz-caveat { grid-column: 1; grid-row: 2; }
    .afro-pattern-sidebar,
    .afro-pattern-sidebar:has([data-hair-type-result][hidden]) { display: block; grid-column: 2; grid-row: 1 / span 2; align-self: stretch; min-width: 0; }
    .afro-pattern-result {
        position: sticky;
        top: calc(var(--afro-quiz-header-clearance, 5.25rem) + var(--wp-admin--admin-bar--height, 0px));
        block-size: min(36rem, calc(100dvh - var(--afro-quiz-header-clearance, 5.25rem) - var(--wp-admin--admin-bar--height, 0px) - var(--afro-quiz-bottom-clearance, 1rem)));
        overflow: auto;
    }
    .afro-routine-quiz-shell { max-width: 58rem; }
    .afro-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 30rem) {
    .afro-quiz-actions,
    .afro-result-actions { display: grid; grid-template-columns: 1fr; }
    .afro-quiz-actions .afro-button,
    .afro-result-actions .afro-button { width: 100%; text-align: center; }
    .afro-profile-summary dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .afro-pattern-card,
    .afro-choice-card { transition: none; }
}
