:root {
    --qol-plum: #513a86;
    --qol-plum-dark: #241a3d;
    --qol-rose: #f3e2e7;
    --qol-cream: #faf6ee;
    --qol-green: #9c7326;
    --qol-ink: #2c2438;
    --qol-muted: #5c5468;
}

.qol-hero {
    padding: 164px 20px 78px;
    color: #fff;
    background-image: linear-gradient(100deg, rgba(36,26,61,.94), rgba(36,26,61,.65)), var(--qol-hero-image);
    background-position: center;
    background-size: cover;
}
.qol-container { width: min(1040px, 100%); margin: 0 auto; }
.qol-kicker { display: block; margin-bottom: 12px; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #f2cddd; }
.qol-hero h1 { margin: 0 0 14px; max-width: 700px; color: #fff; font-family: "Fraunces", serif; font-size: clamp(2.15rem, 5vw, 4rem); line-height: 1.04; }
.qol-hero p { max-width: 680px; margin: 0; font-size: 1.1rem; line-height: 1.65; color: #f8eaf1; }
.qol-section { padding: 48px 20px 80px; background: var(--qol-cream); color: var(--qol-ink); }
.qol-form { display: grid; gap: 22px; }
.qol-card { margin: 0; padding: 26px; border: 1px solid #e5dce1; border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(70, 42, 61, .06); }
.qol-card legend { padding: 0 8px; font-weight: 750; font-size: 1.04rem; }
.qol-patient legend { font-size: 1.3rem; color: var(--qol-plum-dark); }
.qol-help { margin: 0 0 22px; color: var(--qol-muted); line-height: 1.55; }
.qol-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.qol-fields label { font-weight: 700; font-size: .92rem; }
.qol-fields label span { font-weight: 400; color: var(--qol-muted); }
.qol-fields input,.qol-fields select { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 12px 13px; border: 1px solid #cfc5cb; border-radius: 10px; background:#fff; font: inherit; }
.qol-fields input:focus,.qol-fields select:focus { outline: 3px solid rgba(111,49,94,.14); border-color: var(--qol-plum); }
.qol-moment-card.has-error { border-color:#c63e54; }
.qol-moment-options { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.qol-moment-options label { position:relative; display:flex; min-height:112px; padding:20px; align-items:center; gap:15px; border:1px solid #dcd2d8; border-radius:15px; cursor:pointer; transition:border-color .2s,background .2s,transform .2s; }
.qol-moment-options label:hover { border-color:var(--qol-plum); transform:translateY(-2px); }
.qol-moment-options input { position:absolute; opacity:0; }
.qol-moment-options label:has(input:checked) { border-color:var(--qol-plum); background:var(--qol-rose); box-shadow:inset 0 0 0 1px var(--qol-plum); }
.qol-moment-options label:has(input:focus-visible) { outline:3px solid rgba(81,58,134,.22); }
.qol-moment-options label > span:last-child { display:grid; gap:4px; }
.qol-moment-options strong { color:var(--qol-plum-dark); }
.qol-moment-options small { color:var(--qol-muted); line-height:1.45; }
.qol-moment-icon { display:grid; width:46px; height:46px; flex:0 0 auto; place-items:center; border-radius:14px; background:#f6e9c9; color:#9c7326; font-family:"Fraunces",serif; font-size:1.1rem; font-weight:700; }
.qol-moment-options input:checked + .qol-moment-icon { background:var(--qol-plum); color:#fff; }
.qol-progress-wrap { position: sticky; top: calc(var(--qol-nav-height, 78px) + 8px); z-index: 20; padding: 15px 18px; border:1px solid rgba(81,58,134,.12); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 5px 24px rgba(45,28,40,.16); backdrop-filter:blur(10px); }
.qol-progress-wrap div { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .9rem; }
.qol-progress-wrap progress { display: block; width: 100%; height: 9px; accent-color: var(--qol-green); }
.qol-scale-legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; font-size: .82rem; color: var(--qol-muted); text-align: center; }
.qol-scale-legend b { color: var(--qol-plum); }
.qol-question legend { display: flex; align-items: center; gap: 10px; line-height: 1.45; }
.qol-question legend > span { display: inline-grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: var(--qol-plum); font-size: .85rem; }
.qol-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 18px; }
.qol-options label { position: relative; display: flex; min-height: 82px; padding: 12px 6px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 1px solid #ded5da; border-radius: 12px; cursor: pointer; text-align: center; font-size: .82rem; transition: .18s ease; }
.qol-options input { position: absolute; opacity: 0; }
.qol-option-number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--qol-rose); color: var(--qol-plum-dark); font-weight: 800; }
.qol-options label:hover { border-color: var(--qol-plum); transform: translateY(-2px); }
.qol-options label:has(input:checked) { border-color: var(--qol-plum); background: var(--qol-rose); box-shadow: inset 0 0 0 1px var(--qol-plum); }
.qol-options label:has(input:focus-visible) { outline: 3px solid rgba(111,49,94,.22); }
.qol-options input:checked + .qol-option-number { color: #fff; background: var(--qol-plum); }
.qol-submit { display: grid; gap: 18px; }
.qol-consent { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; cursor: pointer; }
.qol-consent input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--qol-plum); }
.qol-live-score { padding: 14px 16px; border-radius: 10px; color: var(--qol-plum-dark); background: var(--qol-rose); font-weight: 700; }
.qol-button { justify-self: start; padding: 13px 22px; border: 0; border-radius: 10px; color: #fff; background: var(--qol-plum); font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; }
.qol-button:hover { background: var(--qol-plum-dark); }
.qol-button-secondary { background: #fff; color: var(--qol-plum-dark); }
.qol-error { display: block; margin-top: 10px; color: #a51e35; font-weight: 700; }
.qol-question.has-error { border-color: #c63e54; }
.qol-alert, .qol-notice { margin-bottom: 22px; padding: 16px 18px; border-radius: 12px; line-height: 1.5; }
.qol-alert { color: #83172a; background: #fde7eb; border: 1px solid #efb2bd; }
.qol-notice { color: #365f59; background: #e9f4f1; border: 1px solid #bcdad4; }
.qol-result { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 20px; padding: 30px; border-radius: 18px; color: #fff; background: linear-gradient(130deg, var(--qol-green), #285c55); }
.qol-result h2 { margin: 5px 0 8px; font-size: 2rem; }
.qol-result p { margin: 0; }
.qol-result .qol-result-moment { display:inline-flex; margin-top:12px; padding:6px 10px; border-radius:999px; background:rgba(255,255,255,.15); font-size:.78rem; font-weight:800; }
.qol-result-label { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.qol-table-card { padding: 0; overflow: hidden; }
.qol-table-heading { padding: 22px 24px 17px; border-bottom: 1px solid #e6dde3; }
.qol-table-heading > span { color: var(--qol-green); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.qol-table-heading h2 { margin: 5px 0 0; color: var(--qol-plum-dark); font-size: 1.2rem; }
.qol-table-scroll { overflow-x: auto; }
.qol-question-table { width: 100%; min-width: 790px; border-collapse: collapse; table-layout: fixed; }
.qol-question-table thead { background: #f3edf2; }
.qol-question-table th, .qol-question-table td { padding: 13px 8px; border-bottom: 1px solid #eee7eb; text-align: center; }
.qol-question-table thead th:first-child { width: 42%; text-align: left; padding-left: 24px; }
.qol-question-table thead th:not(:first-child) { width: 11.6%; color: var(--qol-muted); font-size: .7rem; }
.qol-question-table thead b, .qol-question-table thead span { display: block; }.qol-question-table thead b { color: var(--qol-plum); font-size: .9rem; }
.qol-question-table tbody th { padding-left: 24px; color: var(--qol-ink); font-size: .85rem; font-weight: 700; text-align: left; }
.qol-row-number { display: inline-grid; width: 25px; height: 25px; margin-right: 9px; place-items: center; border-radius: 50%; background: var(--qol-rose); color: var(--qol-plum); font-size: .7rem; }
.qol-question-table tbody tr:hover { background: #fdf9fb; }.qol-question-table tr.has-error { background: #fff0f2; }
.qol-question-table td label {
    position: relative;
    display: grid;
    cursor: pointer;
    place-items: center;
}

.qol-question-table td input {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    transform: translate(-50%, -50%);
    opacity: 0;
}
.qol-question-table td label span { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #d5cbd1; border-radius: 50%; background: #fff; color: var(--qol-muted); font-weight: 800; transition: .18s; }
.qol-question-table td label:hover span { border-color: var(--qol-plum); }
.qol-question-table td input:checked + span { border-color: var(--qol-plum); background: var(--qol-plum); color: #fff; box-shadow: 0 0 0 3px rgba(81,58,134,.13); }
.qol-question-table td input:focus-visible + span { outline: 3px solid rgba(81,58,134,.25); }
.qol-criteria { padding: 0; overflow: hidden; }.qol-criteria-grid { display: grid; padding: 24px; grid-template-columns: 1fr 1fr; gap: 25px; }.qol-criteria-grid h3 { margin: 0 0 10px; font-size: 1rem; }.qol-criteria-grid ul { margin: 0; padding-left: 18px; color: var(--qol-muted); font-size: .82rem; line-height: 1.7; }
.qol-score-key { display: flex; padding: 16px 24px; flex-wrap: wrap; gap: 8px 15px; border-top: 1px solid #e6dde3; background: #f3edf2; font-size: .78rem; }.qol-score-key strong { color: var(--qol-plum-dark); }

@media (max-width: 720px) {
    .qol-hero { padding-top: 52px; }
    .qol-fields, .qol-options, .qol-moment-options { grid-template-columns: 1fr; }
    .qol-scale-legend { display: none; }
    .qol-options label { min-height: auto; padding: 10px 14px; flex-direction: row; justify-content: flex-start; }
    .qol-result { align-items: flex-start; flex-direction: column; }
    .qol-card { padding: 20px 16px; }
    .qol-table-card, .qol-criteria { padding: 0; }.qol-criteria-grid { grid-template-columns: 1fr; }
}
