:root {
    --qp-bg: #f8f4ec;
    --qp-line: #e6dccc;
    --qp-accent: #94662a;
    --qp-muted: #cdbfae;
}

body {
    background: #f8f4ec;
}

.step-wrapper {
    text-align: center
}

.step {
    font-size: 16px;
    line-height: 1;
    background: #A3846D66;
    text-align: center;
    font-weight: 600;
    margin-bottom: 15px;
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
}

.q-title {
    font-family: Georgia, 'Times New Roman', Times, serif;
    line-height: 1.4;
    text-align: center;
    font-size: clamp(20px, 3.2vw, 34px);
    margin: 0 0 15px 0;
}

@media (min-width: 768px) {
    .step {
        font-size: 20px;
        margin-bottom: 20px;
    }
    .q-title {
        margin: 0 0 30px 0;
    }
}

@media (min-width: 1024px) {
    .q-title {
        margin: 0 0 60px 0;
    }
}

.options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 480px) {
    .options {
        gap: 5px;
    }
}

@media (min-width: 768px) {
    .options {
        gap: 10px;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) {
    .options {
        grid-template-columns: repeat(5, 1fr);
    }
}

.card {
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    will-change: transform, opacity, box-shadow;
    animation: card-pop 200ms ease both;
    animation-delay: calc(var(--stagger, 0) * 50ms);
}

.card.is-selected {
    border-color: #9a6b2f;
}

.card:focus-within {
    outline: 3px solid #9a6b2f;
    outline-offset: 2px;
}

.card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 45%;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.70) 0%,
            rgba(0, 0, 0, 0.45) 40%,
            rgba(0, 0, 0, 0.00) 100%);
    pointer-events: none;
}

.card label {
    position: relative;
    display: block;
    padding: 8px;
    color: #000;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    text-wrap: balance;
    background: #d7c9bb;
    height: 100%;
    z-index: 1;
}

@media (min-width: 600px) {
    .card label {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        height: auto;
        font-size: clamp(13px, 3.2vw, 18px);
        color: #FFF;
        line-height: 1.3;
        padding: 10px 15px;
    }
}

.card:hover::after,
.card:focus-within::after {
    background: linear-gradient(to top,
            rgba(0, 0, 0, .85) 0%,
            rgba(0, 0, 0, .55) 45%,
            rgba(0, 0, 0, 0) 100%);
}

.card input {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.card:focus-within,
.card:hover {
    outline: 2px solid #9a6b2f;
    outline-offset: 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.quiz-progress {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    gap: 10px;
    padding: 20px 0 0 0;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .quiz-progress {
        gap: 16px;
        padding: 30px 0 0 0;
    }
}

@media (min-width: 1024px) {
    .quiz-progress {
        gap: 16px;
        padding: 60px 0 0 0;
    }
}

.qp-back,
.qp-next {
    appearance: none;
    border: 0;
    background: none;
    color: #8a7f70;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
    flex: 0 0 80px;
    line-height:1
}

.qp-back {
    text-align: right;
    order: 2;
}

.qp-next {
    text-align: left;
    order: 3;
}

.qp-steps {
    order: 1;
}

@media (min-width: 600px) {
    .qp-back {
        order: 1;
    }

    .qp-next {
        order: 3;
    }

    .qp-steps {
        order: 2;
    }
}

.qp-back:hover,
.qp-next:hover {
    color: #000;
    text-decoration: underline;
    background: transparent;
}

.qp-steps {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: space-between;
    list-style: none;
    margin: 0;
    counter-reset: qpstep;
}

@media (max-width: 600px) {
    .qp-steps {
        flex: 0 0 100%;
    }
}

.qp-steps::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: var(--qp-line);
    border-radius: 4px;
}

.qp-steps::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: var(--qp-accent);
    width: var(--qp-progress, 0%);
    border-radius: 4px;
    transition: width 240ms ease;
}

.qp-step {
    position: relative;
    z-index: 1;
}

.qp-bubble {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--qp-bg);
    border: 2px solid var(--qp-line);
    color: var(--qp-muted);
    font-weight: 700;
    font-size: 14px;
}

@media (min-width: 900px) {
    .qp-bubble {
        width: 50px;
        height: 50px;
    }
}

.qp-step.is-active .qp-bubble {
    border-color: var(--qp-accent);
    color: var(--qp-accent);
}

.qp-step.is-done .qp-bubble {
    background: var(--qp-accent);
    border-color: var(--qp-accent);
    color: #fff;
}

.qp-back .button.disabled,
.button.disabled:hover,
button.disabled,
button[disabled],
button[disabled]:hover {
    background-color: transparent !important;
    border-color: #eee !important;
    color: #bbb !important;
    cursor: default !important;
    pointer-events: none;
}

@keyframes card-pop {
    from {
        opacity: 0;
        transform: translateY(0) scale(0);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}