/* =============================================================
   StackPick Recommender — recommender.css
   Class prefix: spr-
   Colours match the StackPick design system (see brief §2)
   Custom properties scoped to widget root, not :root
   ============================================================= */

.spr-quiz,
.spr-result {
    --navy:       #1A1A2E;
    --blue:       #1A6BFF;
    --blue-dark:  #1558d6;
    --blue-light: #eef4ff;
    --green:      #15803d;
    --green-bg:   #f0fdf4;
    --amber-bg:   #fffbeb;
    --amber-text: #92400e;
    --text-dark:  #333333;
    --text-mid:   #666666;
    --text-light: #AAAAAA;
    --bg:         #FAFAF8;
    --bg2:        #F0F0EE;
    --border:     #E2E2DE;
    --white:      #ffffff;
    --radius:     6px;
    --radius-lg:  10px;
    --shadow-sm:  0 1px 2px rgb(0 0 0 / 0.07);
    --shadow:     0 2px 8px rgb(0 0 0 / 0.09);

    box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-dark);
    line-height: 1.5;
    max-width: 680px;
    margin: 0 auto;
}

.spr-quiz *,
.spr-quiz *::before,
.spr-quiz *::after,
.spr-result *,
.spr-result *::before,
.spr-result *::after {
    box-sizing: inherit;
}

/* --- Noscript notice ----------------------------------------- */

.spr-notice {
    padding: 1rem 1.25rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--text-dark);
}

/* --- Progress bar -------------------------------------------- */

.spr-progress {
    position: relative;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 2.5rem;
    overflow: visible;
}

.spr-progress__fill {
    display: block;
    height: 100%;
    background: var(--blue);
    border-radius: 2px;
    transition: width 0.35s ease;
    min-width: 0;
}

.spr-progress__label {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-light);
    text-align: right;
    line-height: 1;
}

/* --- Question ------------------------------------------------- */

.spr-question {
    animation: spr-fadein 0.2s ease;
}

.spr-question[hidden] {
    display: none;
}

@keyframes spr-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.spr-question__label {
    font-family: 'DM Serif Display', serif;
    font-size: 1.375rem;
    font-weight: 400;
    color: var(--navy);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.spr-question__helper {
    font-size: 0.9375rem;
    color: var(--text-mid);
    margin: 0 0 1.25rem;
}

/* --- Options -------------------------------------------------- */

.spr-options {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spr-options__item {
    margin: 0;
    padding: 0;
}

.spr-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--white);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    width: 100%;
    min-height: 48px;
}

.spr-option:hover {
    border-color: var(--blue);
    background: var(--blue-light);
}

.spr-option--selected {
    border-color: var(--navy);
    background: var(--navy);
    color: var(--white);
}

/* Visually hidden radio input — still keyboard/screen-reader accessible */
.spr-option__input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Custom radio indicator */
.spr-option::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    background: var(--white);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.spr-option:hover::before {
    border-color: var(--blue);
}

.spr-option--selected::before {
    border-color: var(--white);
    background: var(--white);
    box-shadow: inset 0 0 0 4px var(--navy);
}

.spr-option:focus-within {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.spr-option__text {
    font-size: 0.9375rem;
    line-height: 1.4;
    color: inherit;
}

/* --- Buttons -------------------------------------------------- */

.spr-question__footer {
    margin-top: 1.5rem;
}

.spr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
    line-height: 1.25;
}

.spr-btn--next {
    background: var(--navy);
    color: var(--white);
    width: 100%;
}

.spr-btn--next:hover:not(:disabled) {
    background: #0f0f1e;
}

.spr-btn--next:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* --- Result header -------------------------------------------- */

.spr-result__header {
    margin-bottom: 2rem;
}

.spr-result__headline {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--navy);
    margin: 0 0 0.625rem;
    line-height: 1.3;
}

.spr-result__body {
    font-size: 1rem;
    color: var(--text-mid);
    margin: 0;
    line-height: 1.6;
}

/* --- Cards layout -------------------------------------------- */

.spr-result__cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .spr-result__cards {
        flex-direction: row;
        align-items: flex-start;
    }

    .spr-card--primary {
        flex: 3;
    }

    .spr-card--alt {
        flex: 2;
    }
}

/* --- Product card --------------------------------------------- */

.spr-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--white);
}

.spr-card--primary {
    border-color: var(--blue);
    box-shadow: var(--shadow);
}

.spr-card__header {
    padding: 1.25rem 1.25rem 1rem;
    background: var(--logo-color, var(--navy));
    color: var(--white);
}

.spr-card__badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: rgb(255 255 255 / 0.2);
    padding: 0.2em 0.6em;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.spr-card__badge--alt {
    background: rgb(255 255 255 / 0.15);
}

.spr-card__name {
    font-family: 'DM Serif Display', serif;
    font-size: 1.375rem;
    font-weight: 400;
    margin: 0 0 0.25rem;
    color: var(--white);
    line-height: 1.2;
}

.spr-card__price {
    font-size: 0.9375rem;
    margin: 0 0 0.125rem;
    color: rgb(255 255 255 / 0.85);
}

.spr-card__trial {
    font-size: 0.8125rem;
    margin: 0;
    color: rgb(255 255 255 / 0.7);
}

.spr-card__body {
    padding: 1.125rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    background: var(--bg);
}

.spr-card__detail {
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.spr-card__detail--why {
    background: var(--green-bg);
}

.spr-card__detail--watch {
    background: var(--amber-bg);
}

.spr-card__detail-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.spr-card__detail--why .spr-card__detail-label {
    color: var(--green);
}

.spr-card__detail--watch .spr-card__detail-label {
    color: var(--amber-text);
}

.spr-card__detail-text {
    margin: 0;
    line-height: 1.5;
    color: var(--text-dark);
}

.spr-card__au-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.5;
}

.spr-card__footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--white);
}

/* --- CTA buttons --------------------------------------------- */

.spr-cta {
    display: block;
    text-align: center;
    padding: 0.6875rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.25;
    transition: background 0.15s ease, color 0.15s ease;
}

.spr-cta--affiliate,
.spr-cta--review {
    background: var(--blue);
    color: var(--white);
}

.spr-cta--affiliate:hover,
.spr-cta--review:hover {
    background: var(--blue-dark);
    color: var(--white);
}

.spr-cta--secondary {
    background: var(--bg2);
    color: var(--text-dark);
    font-weight: 500;
}

.spr-cta--secondary:hover {
    background: var(--border);
    color: var(--text-dark);
}

/* --- Result footer ------------------------------------------- */

.spr-result__footer {
    margin-top: 1.5rem;
    text-align: center;
}

.spr-link {
    color: var(--text-light);
    font-size: 0.875rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.spr-link:hover {
    color: var(--text-mid);
}
