@font-face {
    font-family: Karla;
    src: url('./fonts/karla-variable.ttf') format('truetype');
    font-weight: 200 800;
    font-display: swap;
}
* {
    box-sizing: border-box;
}
:root {
    --background: #fff;
    --text: #292663;
    --button: #e95656;
}
body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Karla, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
    font: inherit;
}
button,
label,
a {
    -webkit-tap-highlight-color: transparent;
}
.stage {
    width: 100%;
    min-height: 100svh;
    padding: 72px 52px 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.form-content {
    width: 100%;
    max-width: 720px;
    position: relative;
}
.form-content.question-group-content {
    padding-block: 48px;
}
.form-content.enter {
    animation: question-enter 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.form-content.enter-back {
    animation-name: question-enter-back;
}
.question-heading {
    position: relative;
    margin-bottom: 32px;
}
.question-number {
    position: absolute;
    right: calc(100% + 10px);
    top: 8px;
    min-width: 16px;
    height: 19px;
    padding: 0 4px;
    border-radius: 5px 3px;
    background: var(--text);
    color: var(--background);
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}
h1 {
    font-size: 26px;
    font-weight: 600;
    line-height: 34px;
    margin: 0;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}
.required {
    margin-left: 2px;
}
.description {
    color: color-mix(in srgb, var(--text) 70%, transparent);
    font-size: 20px;
    line-height: 28px;
    white-space: pre-wrap;
    margin: 12px 0 0;
}
.answer {
    margin: 0 0 30px;
}
.question-group > .question-item + .question-item {
    margin-top: 38px;
}
.question-group .question-heading {
    margin-bottom: 18px;
}
.answer input:not([type='checkbox']):not([type='radio']),
.answer textarea,
.answer select {
    width: 100%;
    padding: 8px 0;
    font-size: 26px;
    font-weight: 400;
    line-height: 34px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 35%, transparent);
    border-radius: 0;
    outline: none;
    transition:
        border-color 150ms,
        box-shadow 150ms;
}
.answer input::placeholder,
.answer textarea::placeholder {
    color: color-mix(in srgb, var(--text) 30%, transparent);
    opacity: 1;
}
.answer input:focus,
.answer textarea:focus,
.answer select:focus {
    border-color: var(--text);
    box-shadow: 0 1px 0 var(--text);
}
.answer textarea {
    min-height: 84px;
    resize: none;
}
.answer select option {
    color: var(--text);
    background: var(--background);
}
.choice-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.choice {
    min-width: 210px;
    max-width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    color: var(--text);
    background: color-mix(in srgb, var(--text) 5%, var(--background));
    border: 1px solid color-mix(in srgb, var(--text) 35%, transparent);
    border-radius: 4px;
    font-size: 20px;
    line-height: 28px;
    cursor: pointer;
    transition:
        background 130ms,
        box-shadow 130ms;
}
.choice:hover {
    background: color-mix(in srgb, var(--text) 12%, var(--background));
}
.choice input,
.scale input,
.rating input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.choice:has(input:checked) {
    border-color: var(--text);
    box-shadow: inset 0 0 0 1px var(--text);
}
.choice:focus-within,
.scale label:focus-within,
.rating label:focus-within {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}
.choice-key {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 1px solid color-mix(in srgb, var(--text) 55%, transparent);
    border-radius: 3px;
    background: var(--background);
    text-align: center;
    font-size: 12px;
    line-height: 22px;
    font-weight: 700;
}
.choice:has(input:checked) .choice-key {
    color: var(--background);
    background: var(--text);
    border-color: var(--text);
}
.choice-text {
    flex: 1;
    overflow-wrap: anywhere;
}
.choice-capacity {
    display: block;
    margin-top: 2px;
    color: color-mix(in srgb, var(--text) 68%, transparent);
    font-size: 12px;
    line-height: 16px;
}
.choice-check {
    width: 16px;
    opacity: 0;
    font-size: 18px;
    line-height: 20px;
}
.choice:has(input:checked) .choice-check {
    opacity: 1;
}
.multiselect-hint {
    font-size: 14px;
    margin: -16px 0 12px;
    color: color-mix(in srgb, var(--text) 70%, transparent);
}
.scale {
    display: flex;
    gap: 8px;
    width: 100%;
}
.scale label {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    height: 62px;
    color: var(--text);
    background: color-mix(in srgb, var(--text) 5%, var(--background));
    border: 1px solid color-mix(in srgb, var(--text) 40%, transparent);
    border-radius: 4px;
    font-size: 26px;
    cursor: pointer;
    transition: background 130ms;
}
.scale label:hover {
    background: color-mix(in srgb, var(--text) 15%, var(--background));
}
.scale label:has(input:checked) {
    background: var(--text);
    color: var(--background);
    border-color: var(--text);
}
.scale-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    gap: 20px;
    font-size: 14px;
    color: color-mix(in srgb, var(--text) 70%, transparent);
}
.rating {
    display: flex;
    gap: 22px;
}
.rating label {
    position: relative;
    cursor: pointer;
    text-align: center;
    color: var(--text);
}
.rating .star {
    display: block;
    font-size: 52px;
    line-height: 60px;
    opacity: 0.35;
    transition:
        opacity 120ms,
        transform 120ms;
}
.rating .rated .star,
.rating label:hover .star {
    opacity: 1;
}
.rating .star-number {
    display: block;
    font-size: 13px;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 40px;
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--button);
    color: var(--button-text, #fff);
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
    box-shadow: 0 1px 2px #00000012;
    cursor: pointer;
    transition:
        filter 150ms,
        transform 100ms;
}
.button:hover {
    filter: brightness(1.08);
}
.button:active {
    transform: translateY(1px);
}
.button:focus-visible,
.step-button:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 4px;
}
.button:disabled {
    opacity: 0.55;
    cursor: wait;
}
.button svg {
    width: 14px;
    height: 14px;
}
.navigation {
    display: flex;
    align-items: center;
    gap: 16px;
}
.hint {
    font-size: 12px;
    line-height: 16px;
    color: var(--text);
}
.hint strong {
    font-weight: 700;
}
.error {
    display: none;
    width: fit-content;
    border-radius: 3px;
    background: #ffe5e5;
    color: #af0404;
    padding: 6px 10px;
    margin: -10px 0 16px;
    font-size: 14px;
    line-height: 20px;
}
.error:not(:empty) {
    display: block;
    animation: error-shake 220ms;
}
.welcome {
    text-align: center;
    max-width: 720px;
}
.welcome h1 {
    font-weight: 700;
}
.welcome .description {
    margin: 16px auto 28px;
}
.welcome .navigation {
    justify-content: center;
}
.welcome .error {
    margin: 0 auto 16px;
}
.welcome .time-note {
    margin-top: 16px;
    font-size: 14px;
    color: color-mix(in srgb, var(--text) 60%, transparent);
}
.ending {
    text-align: center;
}
.ending .ending-check {
    margin: 0 auto 24px;
    width: 40px;
    height: 40px;
    border: 2px solid var(--text);
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.ending .description {
    margin-top: 16px;
}
.player-footer {
    position: fixed;
    bottom: 16px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    pointer-events: none;
}
.footer-progress {
    width: 180px;
    font-size: 12px;
    line-height: 16px;
    pointer-events: auto;
}
.progress {
    height: 4px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--text) 15%, transparent);
    margin-top: 6px;
    overflow: hidden;
}
.progress div {
    height: 100%;
    background: var(--text);
    transition: width 350ms;
}
.footer-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}
.step-controls {
    display: flex;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 1px 2px #00000016;
}
.step-button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 32px;
    background: var(--button);
    border: 0;
    color: var(--button-text, #fff);
    cursor: pointer;
}
.step-button + .step-button {
    border-left: 1px solid color-mix(in srgb, var(--button-text, #fff) 25%, transparent);
}
.step-button:disabled {
    opacity: 0.4;
    cursor: default;
}
.step-button svg {
    width: 16px;
    height: 16px;
}
.brand {
    display: flex;
    text-decoration: none;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--button) 70%, #000);
    border-radius: 5px;
    background: var(--button);
    color: var(--button-text, #fff);
    font-size: 10px;
    line-height: 14px;
}
.brand strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.4px;
}
.preview-banner {
    position: fixed;
    top: 12px;
    right: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #20243a;
    color: white;
    font-size: 12px;
    z-index: 2;
}
.honeypot {
    position: absolute;
    left: -9999px;
}
@keyframes question-enter {
    from {
        opacity: 0;
        transform: translateY(42px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes question-enter-back {
    from {
        opacity: 0;
        transform: translateY(-42px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes error-shake {
    0%,
    100% {
        transform: translateX(0);
    }
    30% {
        transform: translateX(-4px);
    }
    70% {
        transform: translateX(4px);
    }
}
@media (max-width: 600px) {
    .stage {
        padding: 64px 24px 104px 42px;
        align-items: center;
    }
    .form-content.question-group-content {
        padding-block: 32px;
    }
    h1 {
        font-size: 24px;
        line-height: 32px;
    }
    .question-number {
        right: calc(100% + 8px);
        top: 7px;
    }
    .description {
        font-size: 18px;
        line-height: 26px;
    }
    .question-heading {
        margin-bottom: 26px;
    }
    .answer input:not([type='checkbox']):not([type='radio']),
    .answer textarea,
    .answer select {
        font-size: 24px;
        line-height: 32px;
    }
    .scale {
        gap: 4px;
    }
    .scale label {
        height: 42px;
        font-size: 17px;
        border-radius: 3px;
    }
    .scale-legend {
        font-size: 12px;
    }
    .choice {
        width: 100%;
        font-size: 18px;
        line-height: 26px;
        min-width: 0;
    }
    .rating {
        justify-content: space-between;
        gap: 8px;
    }
    .rating .star {
        font-size: 44px;
    }
    .player-footer {
        left: 16px;
        right: 16px;
        bottom: 12px;
        gap: 12px;
    }
    .footer-progress {
        width: 100px;
    }
    .footer-actions {
        gap: 8px;
    }
    .hint {
        display: none;
    }
    .welcome,
    .ending {
        padding-right: 18px;
    }
}
@media (max-height: 480px) {
    .stage {
        align-items: flex-start;
        padding-top: 48px;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

[hidden] {
    display: none !important;
}
.ending-check svg {
    width: 22px;
    height: 22px;
}

.form-analysis {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid currentColor;
    text-align: left;
    overflow-wrap: anywhere;
}
.form-analysis h2 {
    font-size: 22px;
}

/* Shared form analysis report */
.ar-result-page {
    background: #f4f6f8;
    color: #20364b;
}
.ar-result-page .stage {
    align-items: flex-start;
    padding: 48px 32px 90px;
}
.ar-report {
    width: 100%;
    max-width: 1180px;
    font-size: 15px;
    line-height: 1.65;
}
.ar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
}
.ar-eyebrow {
    font-size: 12px;
    font-weight: 600;
    color: #697986;
    letter-spacing: 0.3px;
}
.ar-header h1 {
    font-size: clamp(28px, 3.6vw, 44px);
    line-height: 1.12;
    font-weight: 800;
    margin: 9px 0;
    letter-spacing: -1px;
}
.ar-meta {
    color: #697986;
    margin: 0;
    font-size: 14px;
}
.ar-score {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-shrink: 0;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #dfe5ea;
    border-radius: 16px;
}
.ar-score strong {
    font-size: 40px;
    line-height: 1;
    color: #b08a4e;
}
.ar-score.high strong {
    color: #2e9d5b;
}
.ar-score.low strong {
    color: #697986;
}
.ar-score span,
.ar-score b {
    display: block;
}
.ar-score span {
    font-size: 12px;
    color: #697986;
}
.ar-score b {
    font-size: 14px;
}
.ar-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
}
.ar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
.ar-panel,
.ar-complement {
    background: #fff;
    border: 1px solid #dfe5ea;
    border-radius: 16px;
    padding: 24px;
}
.ar-report h2 {
    font-size: 20px;
    line-height: 1.3;
    margin: 0 0 14px;
    font-weight: 750;
}
.ar-report h3 {
    font-size: 15px;
    margin: 20px 0 8px;
}
.ar-report p {
    margin: 0 0 12px;
}
.ar-report p:last-child {
    margin-bottom: 0;
}
.ar-sub {
    color: #697986;
    font-size: 13px;
}
.ar-main {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-radius: 16px;
    background: #173c57;
    color: #fff;
    border-top: 6px solid var(--ar-brand);
}
.ar-main .ar-eyebrow {
    color: #c4d4de;
}
.ar-main h2 {
    font-size: 34px;
    letter-spacing: -0.6px;
    margin: 8px 0;
}
.ar-main p {
    color: #c4d4de;
}
.ar-main ul,
.ar-complement ul {
    padding-left: 20px;
    margin: 14px 0 0;
}
.ar-main li,
.ar-complement li {
    margin-top: 6px;
}
.ar-complements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.ar-complement {
    padding: 18px;
    border-left: 4px solid var(--ar-brand);
    font-size: 13px;
}
.ar-complement h3 {
    margin: 5px 0 8px;
    font-size: 18px;
}
.ar-step {
    padding: 18px 22px;
    background: #f3eadb;
    border: 1px solid #e9dcc6;
    border-radius: 12px;
}
.ar-step .ar-eyebrow {
    color: #967238;
}
.ar-step p {
    margin-top: 5px;
    font-weight: 700;
}
.ar-bars {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ar-bars li {
    display: grid;
    grid-template-columns: minmax(100px, 155px) minmax(50px, 1fr) 38px;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
}
.ar-track {
    height: 9px;
    background: #eef2f5;
    overflow: hidden;
    border-radius: 8px;
}
.ar-track i {
    display: block;
    height: 100%;
    border-radius: 8px;
}
.ar-bars b {
    font-size: 12px;
    color: #697986;
    text-align: right;
}
.ar-ai {
    border-top: 3px solid #b08a4e;
}
.ar-analysis {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.ar-pillars {
    padding: 0;
    margin: 0;
    list-style: none;
}
.ar-pillars li + li {
    border-top: 1px solid #e7edf1;
    padding-top: 14px;
    margin-top: 14px;
}
.ar-pillars p {
    margin: 4px 0 0;
    color: #697986;
    font-size: 14px;
}
.ar-notice {
    padding: 14px 18px;
    background: #fff4df;
    color: #765d32;
    border: 1px solid #eddfc3;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}
.ar-column .ar-notice {
    margin: 0;
}
.ar-answer {
    padding: 12px 0;
    border-bottom: 1px solid #e7edf1;
}
.ar-answer dt {
    color: #697986;
    font-size: 12px;
}
.ar-answer dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
}
.ar-report summary {
    cursor: pointer;
}
.ar-report summary:focus-visible,
.ar-print:focus-visible {
    outline: 2px solid #1679b7;
    outline-offset: 4px;
}
.ar-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 28px;
    color: #697986;
    font-size: 13px;
}
.ar-print {
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #dfe5ea;
    color: #20364b;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
}
@media (max-width: 940px) {
    .ar-grid {
        grid-template-columns: 1fr;
    }
    .ar-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 600px) {
    .ar-result-page .stage {
        padding: 60px 16px 85px;
    }
    .ar-panel {
        padding: 20px;
    }
    .ar-main {
        padding: 24px;
    }
    .ar-main h2 {
        font-size: 28px;
    }
    .ar-bars li {
        grid-template-columns: 120px minmax(40px, 1fr) 34px;
        gap: 8px;
    }
    .ar-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
    .ar-score {
        width: 100%;
    }
}
@media print {
    .ar-result-page {
        background: #fff;
    }
    .ar-result-page .stage {
        padding: 0;
        display: block;
    }
    .ar-result-page .player-footer,
    .ar-result-page .preview-banner,
    .ar-print {
        display: none;
    }
    .ar-header {
        flex-direction: row;
    }
    .ar-grid {
        display: block;
    }
    .ar-column {
        display: block;
    }
    .ar-column > section,
    .ar-complements {
        margin-bottom: 16px;
        break-inside: avoid;
    }
    .ar-main {
        background: #fff;
        color: #20364b;
        border: 1px solid #dfe5ea;
        border-top: 6px solid var(--ar-brand);
    }
    .ar-main p,
    .ar-main .ar-eyebrow {
        color: #697986;
    }
}

.choice:has(input:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
}

.phone-field { display: flex; align-items: center; gap: 16px; position: relative; }
.phone-field > .select2-container { flex: 0 0 105px; width: 105px !important; }
.phone-field input { min-width: 0; }
.phone-field .select2-container .select2-selection--single {
    height: 51px;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 35%, transparent);
    border-radius: 0;
    background: transparent;
}
.phone-field .select2-container .select2-selection--single .select2-selection__rendered {
    padding: 8px 24px 8px 0;
    line-height: 34px;
    font-size: 26px;
    color: var(--text);
}
.phone-field .select2-container .select2-selection--single .select2-selection__arrow { height: 50px; }
.phone-field .select2-container--focus .select2-selection--single,
.phone-field .select2-container--open .select2-selection--single { border-color: var(--text); }
.phone-field .select2-dropdown { min-width: 105px; color: #202020; background: #fff; }
.phone-field .select2-search input.select2-search__field {
    padding: 6px;
    font-size: 16px;
    line-height: 24px;
    color: #202020;
    border: 1px solid #aaa;
    background: #fff;
}
@media (max-width: 480px) {
    .phone-field { gap: 10px; }
    .phone-field .select2-container .select2-selection--single { height: 49px; }
    .phone-field .select2-container .select2-selection--single .select2-selection__rendered {
        font-size: 24px;
        line-height: 32px;
    }
    .phone-field .select2-container .select2-selection--single .select2-selection__arrow { height: 48px; }
    .phone-field > .select2-container { flex-basis: 90px; width: 90px !important; }
}
