/*
   Self-hosted web fonts (woff2, variable weights) instead of Google Fonts CDN:
   no third-party requests, no IP addresses shared with Google (GDPR/DSGVO).
   Files and @font-face definitions obtained from fonts.google.com (OFL-licensed).
*/
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 300 700;
    font-stretch: 100%;
    font-display: swap;
    src: url("fonts/web/bricolage-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 300 700;
    font-stretch: 100%;
    font-display: swap;
    src: url("fonts/web/bricolage-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 300 700;
    font-stretch: 100%;
    font-display: swap;
    src: url("fonts/web/bricolage-vietnamese.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 600 700;
    font-stretch: 100%;
    font-display: swap;
    src: url("fonts/web/fraunces-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 600 700;
    font-stretch: 100%;
    font-display: swap;
    src: url("fonts/web/fraunces-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 600 700;
    font-stretch: 100%;
    font-display: swap;
    src: url("fonts/web/fraunces-vietnamese.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
    --bg: #f6f1e8;
    --bg-2: #efe6d8;
    --ink: #1f2327;
    --muted: #5c6167;
    --accent: #0f6f6a;
    --accent-2: #e07a3f;
    --card: #ffffff;
    --line: #e4d7c5;
    --shadow: 0 24px 60px rgba(26, 32, 36, 0.18);
    --chat-enter-ease: linear(0, 0.539 19.8%, 0.999 44.6%, 0.925 57.4%, 1 77.4%, 1)
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Bricolage Grotesque", "Avenir Next", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left, #fef7ec 0%, var(--bg) 50%),
        linear-gradient(135deg, #f3e0c8 0%, #f6f1e8 60%, #f0e1cf 100%);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

[hidden],
#lead[hidden],
#result[hidden],
#quiz[hidden] {
    display: none !important;
    visibility: hidden;
}

.bg-orbit {
    position: fixed;
    inset: -20% -10% auto auto;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 111, 106, 0.25), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

.page > section {
    flex: 1;
    min-height: 0;
}

.page > footer {
    flex: none;
}

.quiz {
    margin: 2em;
    margin-bottom: 0;
    height: auto;
    flex: 1;
    min-height: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.quiz-shell {
    height: 100%;
    min-height: 0;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
    align-items: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 16px;
}

h1 {
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: clamp(32px, 4vw, 52px);
    margin: 0 0 18px;
}

h2 {
    font-family: "Fraunces", "Times New Roman", serif;
    margin: 0;
    font-size: clamp(28px, 2.2vw, 40px);
    line-height: 1.1;
}

.lede {
    font-size: 18px;
    color: var(--muted);
    margin-bottom: 28px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.meta {
    font-size: 14px;
    color: var(--muted);
}

.hero-card {
    background: var(--card);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
}

.card-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.hero-list {
    padding: 0 0 0 18px;
    margin: 0;
    display: grid;
    gap: 10px;
}

.hero-illustration {
    height: 140px;
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(15, 111, 106, 0.25), rgba(224, 122, 63, 0.2));
}

.split-layout {
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
    display: grid;
    grid-template-columns: 7fr 5fr;
    height: 100%;
    min-height: 0;
}

.chat-pane {
    background: linear-gradient(160deg, #f9f4eb 0%, #f4eadb 100%);
    border-right: 1px solid var(--line);
    padding: 24px;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.chat-messages {
    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 6px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 92%;
}

.message.enter {
    animation-duration: 520ms;
    animation-timing-function: var(--chat-enter-ease);
    animation-fill-mode: both;
    will-change: transform, opacity;
}

.message.bot.enter {
    animation-name: messageInsertLeft;
}

.message.user.enter {
    animation-name: messageInsertRight;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: var(--accent);
    color: #fff;
}

.message.user .message-avatar {
    background: #c9b49b;
    color: #2a2119;
}

.message-content {
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 15px;
}

.message.bot .message-content {
    background: #fffaf2;
    border: 1px solid #e8d8c2;
    border-bottom-left-radius: 6px;
}

.message.user .message-content {
    background: #eaf5f4;
    border: 1px solid #cfe7e3;
    border-bottom-right-radius: 6px;
}

.message-section {
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-2);
}

.message-media {
    margin-top: 10px;
}

.message-media img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.typing-bubble {
    display: flex;
    gap: 10px;
    align-self: flex-start;
    animation: messageInsertLeft 520ms var(--chat-enter-ease) both;
}

.typing-dots {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 14px 16px;
    background: #fffaf2;
    border: 1px solid #e8d8c2;
    border-radius: 16px;
    border-bottom-left-radius: 6px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    animation: typingBounce 1.1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.18s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.card-pane {
    padding: 4pt;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.card-pane-inner {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    /* border: 1px solid var(--line); */
    border-radius: 24px;
    background: #fffdfa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.progress {
    display: grid;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--line);
}

.question-title {
    padding: 18px 24px 0;
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: clamp(24px, 2vw, 32px);
    line-height: 1.2;
    min-height: 100px
}

.bar {
    height: 8px;
    border-radius: 999px;
    background: #f1e7d8;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #0f8c7f);
    transition: width 0.35s ease;
}

.answers-wrap {
    /* flex: 1; */
    overflow-y: scroll;  /* Always active with stable gutter */
    padding: 18px 24px 24px;
    margin-top: auto;
    scrollbar-gutter: stable;  /* Reserve space, no layout shift */
    scrollbar-width: thin;  /* Firefox thin */
    scrollbar-color: var(--accent) transparent;  /* Firefox colors */
}

.answers-wrap::-webkit-scrollbar {
    width: 8px;  /* Fixed width for consistent spacing */
    background: transparent;
}

.answers-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.answers-wrap::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
    border: 2px solid transparent;  /* Creates effective 4px thumb */
    background-clip: padding-box;  /* Makes border area transparent */
    transition: border-width 0.2s ease, background 0.2s ease;  /* Smooth transitions */
}

.answers-wrap:hover::-webkit-scrollbar-thumb {
    border-width: 0;  /* Expands thumb to full 8px on hover */
    background: var(--accent-hover, var(--accent));
}

.answers-wrap::-webkit-scrollbar-corner {
    background: transparent;
}

.answers {
    display: grid;
    gap: 12px;
}

.answer-btn {
    border: 1px solid var(--line);
    background: #fcfaf7;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.answer-yes.answer-btn:hover {
    background-color: rgba(0, 220, 121, 0.05);
    border-color: rgba(0, 220, 121, 0.3);
}

.answer-no.answer-btn:hover {
    background-color: rgba(229, 0, 0, 0.05);
    border-color: rgba(229, 0, 0, 0.3);
}

.answer-maybe.answer-btn:hover {
    background-color: rgba(10, 189, 180, 0.05);
    border-color: rgba(10, 189, 180, 0.3);
}

.answer-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.answer-btn.selected {
    border-color: var(--accent);
    background: #f1f8f7;
    box-shadow: 0 0 0 2px rgba(15, 111, 106, 0.15);
}

.card-nav {
    position: sticky;
    bottom: 0;
    /* margin-top: auto; */
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 24px 24px;
    border-top: 1px solid var(--line);
    background: #fffdfa;
}

.btn {
    border-radius: 999px;
    padding: 12px 20px;
    border: none;
    font-size: 15px;
    cursor: pointer;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 30px rgba(15, 111, 106, 0.3);
}

.btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--line);
}

.lead {
    margin: 0;
    padding: 2em;
    /* Inner padding doubles as shadow clearance so the card's drop shadow
       isn't clipped by the scroll container on any side. */
    padding-bottom: calc(2em + 48px);
    overflow-y: auto;
    height: auto;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.lead-card,
.result-card {
    background: var(--card);
    border-radius: 32px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
    width: 100%;
    /* max-width: 860px; */
}

/* --- Result header (shown after submit, above form area) --- */
.lead-result-header {
    padding: 32px 36px;
    animation: fadeUp 0.4s ease both;
}

.lead-result-header.tier-good {
    background: linear-gradient(135deg, #0d5f5a 0%, #0f8c7f 100%);
}

.lead-result-header.tier-mid {
    background: linear-gradient(135deg, #a0520a 0%, #d97a2a 100%);
}

.lead-result-header.tier-bad {
    background: linear-gradient(135deg, #7a1c1c 0%, #b33a3a 100%);
}

.lead-score-band {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
}

.lead-score-number {
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: clamp(56px, 6vw, 80px);
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    width: 120px;
    text-align: center;
    padding: 16px 10px;
}

.lead-score-text {
    color: #fff;
}

.lead-score-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    font-weight: 700;
    opacity: 0.7;
    margin: 0 0 6px;
}

.lead-score-desc {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
}

.lead-score-rec {
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
    line-height: 1.5;
}

/* --- Form body --- */
#leadFormPhase {
    padding: 32px 36px;
}

.lead-form-header h2 {
    margin: 0 0 6px;
    font-size: clamp(22px, 2.5vw, 30px);
}

.lead-sub {
    color: var(--muted);
    font-size: 15px;
    margin: 0 0 20px;
}

.optional {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.lead-submit-btn {
    width: fit-content;
    padding: 14px;
    font-size: 16px;
    margin-top: 8px;
}

.lead-form-error {
    color: #b42318;
    background: #fdecec;
    border: 1px solid rgba(180, 35, 24, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 14px;
}

/* --- Pricing body --- */
#leadPricingPhase {
    animation: fadeUp 0.45s 0.1s ease both;
}

.lead-pricing-inner {
    padding: 32px 36px 32px;
}

.lead-divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 0 0 28px;
}

.lead-thankyou {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 36px 32px;
    animation: fadeUp 0.35s ease both;
}

.lead-thankyou-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.lead-thankyou-title {
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: 20px;
    margin: 0 0 4px;
}

.lead-thankyou-sub {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
}

.lead-pricing-heading {
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: clamp(20px, 2vw, 26px);
    margin: 0 0 16px;
}

.lead-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

label {
    margin: 1em 0;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fcfaf7;
    margin-top: 8px;
    font-size: 15px;
}

.consent {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
    margin: 1em 0;
}

.fineprint {
    font-size: 12px;
    color: var(--muted);
}

.consent-note {
    margin-top: 8px;
}

.consent-note a {
    color: var(--muted);
    text-decoration: underline;
}

.consent-note a:hover {
    text-decoration: none;
}

.result {
    display: grid;
    gap: 28px;
    padding: 2em;
    /* Matches .lead: keeps the card shadow inside the scroll container. */
    padding-bottom: calc(2em + 48px);
    height: auto;
    flex: 1;
    align-content: start;
    overflow-y: auto;
}

.result-card {
    grid-template-columns: minmax(140px, 180px) 1fr;
    align-items: center;
}

.score {
    font-size: 52px;
    font-family: "Fraunces", "Times New Roman", serif;
    color: var(--accent-2);
}

.result-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    margin: 0;
    color: var(--muted);
}

.site-footer {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0 2em;
    font-size: 13px;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
    padding: 1.25em;
}

.site-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.result-desc,
.result-rec {
    margin: 6px 0;
}

.pricing h3 {
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: 28px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.price-card {
    background: var(--card);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    display: grid;
    gap: 10px;
    align-content: start;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.price-card.recommended {
    border-color: var(--accent);
    background: #f1f8f7;
    box-shadow: 0 0 0 2px rgba(15, 111, 106, 0.15), var(--shadow);
}

.price-badge {
    justify-self: start;
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 999px;
}

.price-tag {
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: 18px;
    color: var(--accent);
    font-weight: 600;
}

.price-card h4 {
    margin: 0;
}

.price-card p {
    margin: 0;
    color: var(--muted);
}

.price-card a {
    justify-self: start;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 14px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes messageInsertLeft {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes messageInsertRight {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tablet & below: keep the two-pane layout, but stack the panes and give
   the question card the remaining height so answers stay visible. */
@media (max-width: 960px) {
    .page {
        gap: 0;
        padding: 0;
    }

    .split-layout {
        grid-template-columns: 1fr;
        /* chat takes its natural (capped) height, card pane absorbs the rest */
        grid-template-rows: auto minmax(0, 1fr);
        height: 100%;
        min-height: 0;
    }

    .chat-pane {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 16px;
        max-height: 30vh;
    }

    .card-pane {
        padding: 2pt;
        min-height: 0;
    }

    .card-pane-inner {
        min-height: 0;
        overflow-y: auto;
    }

    .result-card {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   v14 – Storytelling Steps
   ============================================================ */

.lead-card-v14 {
    /* max-width: 820px; */
    margin: auto;
}

/* Step row */
.v14-step {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 20px;
    padding: 28px 36px;
    border-bottom: 1px solid var(--line);
    align-items: start;
    animation: fadeUp 0.4s ease both;
}

.v14-step-3 {
    animation-delay: 0.1s;
}

.v14-step-num {
    font-family: "Fraunces", serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--muted);
    padding-top: 4px;
    text-align: right;
    border-right: 2px solid var(--line);
    padding-right: 20px;
    line-height: 1.4;
}

.v14-step-num-light {
    color: rgba(255,255,255,0.5);
    border-right-color: rgba(255,255,255,0.25);
}

.v14-step-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    margin: 0 0 8px;
}

.v14-step-label-light {
    color: rgba(255,255,255,0.6);
}

.v14-step-title {
    font-family: "Fraunces", serif;
    font-size: clamp(16px, 1.8vw, 22px);
    margin: 0 0 8px;
    color: var(--ink);
}

.v14-step-sub {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
    line-height: 1.55;
}

/* Step 1: light background */
.v14-step-1 {
    background: #f9f5ef;
}

/* Step 2: result – colored */
.v14-step-2 {
    padding: 28px 36px;
}

.v14-step-2.tier-good { background: linear-gradient(135deg, #0d5f5a, #0f8c7f); }
.v14-step-2.tier-mid  { background: linear-gradient(135deg, #a0520a, #d97a2a); }
.v14-step-2.tier-bad  { background: linear-gradient(135deg, #7a1c1c, #b33a3a); }

.v14-result-band {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.v14-score-pill {
    font-family: "Fraunces", serif;
    font-size: 42px;
    color: #fff;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    width: 88px;
    text-align: center;
    padding: 10px 8px;
    line-height: 1;
    flex-shrink: 0;
}

.v14-result-cat {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px;
}

.v14-result-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin: 0;
    line-height: 1.4;
}

.v14-result-rec {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    margin: 8px 0 0;
    padding-left: 0;
    line-height: 1.55;
    font-style: italic;
    max-width: 70%;
    white-space: pre-line;
}

/* Step 3: pricing grid */
.v14-step-3 .lead-pricing-grid {
    margin-top: 12px;
}

/* Lead form */
.v14-form-section {
    border-bottom: none;
    animation: fadeUp 0.4s 0.2s ease both;
}

.v14-form-inner {
    padding: 28px 36px 32px;
}

.v14-form-intro {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.v14-form-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.v14-form-title {
    font-family: "Fraunces", serif;
    font-size: clamp(18px, 1.8vw, 22px);
    margin: 0 0 4px;
}

.v14-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ============================================================
   Datenschutz / legal page
   ============================================================ */

.legal-page {
    padding: 2em;
    overflow-y: scroll;
}

.legal-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    /* max-width: 760px; */
    width: 100%;
    margin: 0 auto;
    padding: 40px 48px 48px;
    line-height: 1.65;
}

.legal-card h1 {
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: clamp(28px, 4vw, 38px);
    margin: 1em 0 4px;
}

.legal-card h2 {
    font-family: "Fraunces", "Times New Roman", serif;
    font-size: clamp(20px, 2.4vw, 25px);
    margin: 2em 0 0.6em;
    scroll-margin-top: 24px;
}

.legal-card h3 {
    font-size: 16px;
    margin: 1.6em 0 0.4em;
}

.legal-card p,
.legal-card li {
    font-size: 15px;
    color: var(--ink);
}

.legal-card ul,
.legal-card ol {
    padding-left: 1.4em;
}

.legal-card li {
    margin: 0.35em 0;
}

.legal-updated {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 1.5em;
}

.legal-card a {
    color: var(--accent);
}

.legal-address {
    font-style: normal;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 15px;
    margin: 1em 0;
}

.legal-faq dt {
    font-weight: 600;
    margin-top: 1em;
}

.legal-faq dd {
    margin: 0.3em 0 0 0;
    color: var(--muted);
    font-size: 15px;
}

.legal-toc {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 20px;
    margin: 1.5em 0;
}

.legal-toc h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.legal-toc ol {
    margin: 0;
    padding-left: 1.2em;
    font-size: 14px;
    columns: 2;
}

.legal-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 3em;
    padding-top: 1.5em;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.legal-footer a {
    text-decoration: none;
}

.legal-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .legal-card {
        padding: 24px 20px 32px;
    }

    .legal-toc ol {
        columns: 1;
    }
}

.v14-thankyou {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 36px 32px;
    animation: fadeUp 0.35s ease both;
}

.lead-card-v14 #leadFormPhase {
    padding: 0;
}
/* ============================================================
   Phones – single-column usability on small screens
   ============================================================ */
@media (max-width: 640px) {
    .quiz {
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .split-layout {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .chat-pane {
        max-height: 36vh;
        padding: 12px 14px;
    }

    .chat-messages {
        gap: 10px;
    }

    .message {
        max-width: 100%;
    }

    .message-avatar {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }

    .message-content {
        font-size: 14px;
        padding: 10px 12px;
        line-height: 1.45;
    }

    .card-pane {
        padding: 0;
    }

    .card-pane-inner {
        border-radius: 0;
    }

    .progress {
        padding: 14px 16px 12px;
    }

    .question-title {
        padding: 12px 16px 0;
        font-size: 20px;
        min-height: 0;
    }

    .answers-wrap {
        flex: 1;
        overflow-y: scroll;
        padding: 12px 16px 16px;
    }

    .answer-btn {
        padding: 14px;
        font-size: 15px;
        line-height: 1.35;
        /* keep tap targets comfortable and prevent iOS zoom-on-tap double taps */
        min-height: 48px;
        touch-action: manipulation;
    }

    .card-nav {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: #fffdfa;
    }

    .btn {
        flex: 1;
        padding: 14px 18px;
        font-size: 16px;
        touch-action: manipulation;
    }

    /* Lead / result card */
    .lead {
        padding: 0;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        align-items: stretch;
    }

    .lead-card,
    .result-card {
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .v14-step {
        grid-template-columns: 40px 1fr;
        gap: 14px;
        padding: 18px 16px;
    }

    .v14-step-num {
        padding-right: 12px;
    }

    .v14-step-2 {
        padding: 18px 16px;
    }

    .v14-score-pill {
        width: 72px;
        font-size: 32px;
        padding: 8px 6px;
        border-radius: 12px;
    }

    .v14-result-band {
        gap: 12px;
    }

    .v14-result-cat {
        font-size: 15px;
    }

    .v14-result-desc,
    .v14-result-rec {
        font-size: 13px;
    }

    .v14-form-inner {
        padding: 20px 16px 24px;
    }

    .v14-form-intro {
        gap: 12px;
    }

    .v14-form-icon {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .v14-form-title {
        font-size: 17px;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    input[type="text"],
    input[type="email"] {
        /* 16px prevents iOS Safari from zooming the input on focus */
        font-size: 16px;
        padding: 12px 14px;
    }

    .lead-submit-btn {
        width: 100%;
    }

    .lead-pricing-inner {
        padding: 20px 16px 24px;
    }

    .lead-pricing-grid {
        grid-template-columns: 1fr;
    }

    .price-card {
        padding: 16px;
    }

    .lead-thankyou {
        padding: 20px 16px 24px;
    }

    .site-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .site-footer a {
        padding: 0.9em 1em;
    }

    .legal-page {
        padding: 1em;
    }
}

/* Short viewports (e.g. phones in landscape): keep both panes side by side
   with a tight cap on the chat so the question card stays usable. */
@media (max-width: 960px) and (max-height: 480px) {
    .quiz {
        margin: 0;
        border: none;
        border-radius: 0;
    }

    .split-layout {
        grid-template-columns: minmax(0, 2fr) 3fr;
        grid-template-rows: none;
    }

    .chat-pane {
        max-height: none;
        border-right: 1px solid var(--line);
        border-bottom: none;
        padding: 10px 12px;
    }

    .card-pane {
        padding: 0;
    }

    .card-pane-inner {
        border-radius: 0;
    }

    .question-title {
        font-size: 18px;
        min-height: 0;
        padding: 10px 14px 0;
    }

    .progress {
        padding: 10px 14px 8px;
    }

    .answers-wrap {
        flex: 1;
        overflow-y: scroll;
        padding: 10px 14px 12px;
    }

    .answer-btn {
        padding: 10px 12px;
        min-height: 40px;
    }

    .card-nav {
        padding: 10px 14px;
    }

    .btn {
        padding: 10px 14px;
    }
}
