:root {
    /* Brand colours — customise to suit (light theme) */
    --bg-start: #f8fafc; /* slate-50 */
    --bg-end: #ffffff; /* white */
    --card: #ffffffcc; /* translucent panel */
    --text: #111827; /* text */
    --muted: #6b7280; /* secondary text */
    --accent: #7c3aed; /* primary accent */
    --accent-2: #06b6d4; /* secondary accent */
    --danger: #dc2626; /* error */
    --ok: #16a34a; /* success */
    --focus: #2563eb; /* focus ring */
    --border: #e5e7eb; /* borders */
    --choice: #f3f4f6; /* choice chips */
    /* Background image render tweaks (applied when a background image is set) */
    --bg-overlay: rgba(255,255,255,.88); /* keeps content readable */
    --bg-blur: 0px; /* set via THEME.blurPx */
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

/* Optional full-bleed, responsive background image layer */
#bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover; /* responsive fill */
    transform: translateZ(0); /* GPU hint */
    filter: blur(var(--bg-blur));
    opacity: 1;
    transition: opacity .4s ease;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: radial-gradient(1200px 800px at 20% 10%, #ffffff, transparent 60%), radial-gradient(1000px 700px at 80% 0%, #f4f5ff, transparent 60%), linear-gradient(160deg, var(--bg-start), var(--bg-end));
}

.wrap {
    min-height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    position: relative;
}

header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 700;
    letter-spacing: .25px;
    font-size: 1rem;
}

    .brand img {
        display: block;
        height: 28px;
        width: auto;
    }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 16px var(--accent);
}

.progress {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
    border: 1px solid var(--border);
}

    .progress > i {
        display: block;
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--accent), var(--accent-2));
        transition: width .35s ease;
    }

main {
    display: grid;
    place-items: center;
    padding: 1rem;
}

.card {
    width: 100%;
    max-width: 820px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0px; /*24px;*/
    box-shadow: 0 10px 40px rgba(0,0,0,.35);
    overflow: clip;
    backdrop-filter: saturate(1.1);
}

.step {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
    padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 5vw, 2rem) 1.25rem;
}

    .step.active {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

.q {
    font-size: clamp(1.5rem, 3.2vw, 2.2rem);
    line-height: 1.2;
    margin: .5rem 0 1rem;
    font-weight: 700;
}

.desc {
    color: var(--muted);
    margin-bottom: 1.25rem;
}

/* Controls */
.controls {
    display: grid;
    gap: .75rem;
    align-items: start;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

@@media (max-width: 640px) {
    .row {
        grid-template-columns: 1fr;
    }
}

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea, select {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 0px; /*14px;*/
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

    input:focus, textarea:focus, select:focus {
        border-color: var(--focus);
        box-shadow: 0 0 0 4px color-mix(in oklab, var(--focus) 25%, transparent);
    }

/* Choice chips (for radio/checkbox like options) */
.choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
    gap: .6rem;
    margin-top: .25rem;
}

.chip {
    border: 1px solid var(--border);
    border-radius: 0px; /*14px;*/
    padding: .85rem 1rem;
    background: var(--choice);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: .6rem;
    justify-content: space-between;
    transition: transform .06s ease, border-color .2s ease, background .2s ease;
}

    .chip:hover {
        transform: translateY(-1px);
    }

    .chip[aria-pressed="true"], .chip.selected {
        /*border-color: var(--accent);
        background: color-mix(in oklab, var(--choice) 70%, var(--accent) 30%);*/

        border-color:black;
        background: #1976d2;
        color: white;
    }

        .chip[aria-pressed="true"] .tick {
            border-color: black;
            background: white;
            color: black;
        }

        .nav {
            display: flex;
            gap: .5rem;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            padding-top: .75rem;
            border-top: 1px dashed var(--border);
        }

    .nav .left {
        display: flex;
        gap: .5rem;
    }

button {
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 0px; /*14px;*/
    padding: .8rem 1rem;
    background: #fff;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: transform .06s ease, border-color .2s, background .2s;
}

    button:hover {
        transform: translateY(-1px);
    }

.btn-primary {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: white;
}

    .btn-primary[disabled] {
        filter: grayscale(.5) brightness(.7);
        opacity: .7;
        cursor: not-allowed;
    }

.error {
    color: var(--danger);
    font-size: .95rem;
    margin-top: .25rem;
}

.help {
    color: var(--muted);
    font-size: .9rem;
}

footer {
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
    padding: 1rem;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.tick {
    display: none; /*inline-flex;*/
    width: 22px;
    height: 22px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    border: 1px solid var(--border);
}

    .tick.ok {
        background: color-mix(in oklab, var(--ok) 30%, #eef2ff);
        border-color: var(--ok);
    }

/* File upload (drop zone + chips) */
input[type="file"].hidden-input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.dz {
    border: 2px dashed var(--border);
    border-radius: 0px;/*14px;*/
    padding: 1rem;
    background: #eee;
    display: grid;
    gap: .25rem;
    cursor: pointer;
    text-align: center;
}

    .dz .help {
        font-size: .85rem;
    }

    .dz.drag {
        outline: 4px solid color-mix(in oklab, var(--focus) 25%, transparent);
        background: #f8fafc;
    }

.files {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .25rem;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--choice);
}

    .file-chip .meta {
        color: var(--muted);
        font-size: .85rem;
    }

    .file-chip .remove {
        border: none;
        background: transparent;
        font-size: 1rem;
        line-height: 1;
        padding: 0 .25rem;
        cursor: pointer;
    }

.summary pre {
    white-space: pre-wrap;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .75rem;
    max-height: 300px;
    overflow: auto;
}

/* Tiny test panel */
#test-panel {
    max-width: 820px;
    margin: 0 auto 1rem;
    font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #334155;
}

    #test-panel details {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: .5rem .75rem;
    }

    #test-panel .ok {
        color: #15803d;
    }

.fail {
    color: #b91c1c;
}

/* Put these AFTER any earlier .q rules */

/* Page title (direct child of the step) */
.step > .q {
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    line-height: 1.2;
    margin: .5rem 0 1rem;
    font-weight: 700;
    padding-bottom: 0.5em;
    border-bottom: solid lightgrey  3px;
}


/* Question titles (inside each .controls block) */
.step .controls > .q {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    line-height: 1.25;
    margin: .35rem 0 .6rem;
    font-weight: 600;
}

/* Companies house cards */
/* Companies House suggestion list (cards) */
.ch-suggestions {
    display: none;
    margin-top: .5rem;
}

.ch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .75rem;
}

.ch-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: .75rem .9rem;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease;
    outline: none;
}

    .ch-card:hover,
    .ch-card[aria-selected="true"] {
        transform: translateY(-1px);
        border-color: var(--accent);
        box-shadow: 0 6px 20px rgba(0,0,0,.08);
    }

    .ch-card .title {
        font-weight: 700;
        line-height: 1.25;
        margin-bottom: .25rem;
    }

    .ch-card .meta {
        color: var(--muted);
        font-size: .9rem;
    }

.ch-empty,
.ch-loading,
.ch-error {
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--choice);
    padding: .6rem .8rem;
    font-size: .95rem;
    color: var(--muted);
}

.ch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .25rem;
}

.ch-count {
    font-size: .85rem;
    color: var(--muted);
}

/* stack each option so the info can live right under it */
.choices--multi .opt {
    margin-bottom: .5rem;
}

    /* the chip stays as-is; tweak margins if needed */
    .choices--multi .opt .chip {
        display: inline-flex;
    }

    /* the info panel shown when that option is selected */
    .choices--multi .opt .opt-info {
        margin-top: .4rem;
        padding: .6rem .75rem;
        background: #fafafa;
        border-left: 3px solid #ddd;
        border-radius: 6px;
        font-size: .95rem;
        line-height: 1.35;
    }

/* layout for multis */
.choices--multi {
    display: block;
}

    .choices--multi .opt {
        display: inline-block;
        margin: 0 .4rem .4rem 0;
    }

.multi-info {
    margin-top: .9rem;
    padding: 1rem 1.1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.multi-info__section + .multi-info__section {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px dashed #e5e7eb;
}

.multi-info__title {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.multi-info__content {
    line-height: 1.4;
}