/* =====================================================================
   PolySec app stylesheet
   Shared by the client dashboard (body.page-app) and the sign up /
   log in pages (body.page-auth). Load after the Schibsted Grotesk font.
   ===================================================================== */

:root {
    /* Brand palette (matches the front page) */
    --blue: #1487d1;
    --blue-deep: #0d6aa6;
    --blue-wash: #eaf4fb;
    --ink: #262424;
    --ink-soft: #5b5757;
    --paper: #ffffff;
    --surface: #ffffff;
    --line: #dce6ee;
    --teal: #a0f4d8;
    --teal-ink: #0f5c45;
    --open: #fde4dc;
    --open-ink: #9a2f12;
    --on-blue: #ffffff;
    --shadow: 0 1px 0 rgba(20, 135, 209, .08), 0 18px 40px -24px rgba(13, 106, 166, .35);

    /* Dashboard roles, built from the palette */
    --surface-2: #f4f8fb;
    --ink-2: var(--ink-soft);
    --ink-3: #807b7b;
    --blue-ink: var(--on-blue);
    --blue-soft: var(--blue-wash);
    --high: var(--open-ink);
    --high-soft: var(--open);
    --mod: #8a5a00;
    --mod-soft: #fdf0d6;
    --low: var(--blue-deep);
    --low-soft: var(--blue-wash);
    --ok: var(--teal-ink);
    --ok-soft: var(--teal);
    --ok-fill: #3fd3a3;
    --focus: var(--blue);
    --radius-lg: 14px;
    --radius-sm: 7px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
}

body {
    font-family: "Schibsted Grotesk", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--blue);
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* =====================================================================
   Dashboard  (body.page-app)
   ===================================================================== */
/* ---------- Shell ---------- */
.shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--paper);
    border-right: 1px solid var(--line);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    padding: 0 8px;
    min-height: 32px;
}

.brand img {
    height: 28px;
}

.brand .brand-text {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
}

.side-nav a:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.side-nav a[aria-current="page"] {
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 600;
}

.side-nav svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.side-nav .count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    background: var(--high-soft);
    color: var(--high);
    padding: 1px 8px;
    border-radius: 99px;
}

.side-group {
    font-size: 13px;
    color: var(--ink-3);
    padding: 0 10px 6px;
}

.side-help {
    margin-top: auto;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
}

.side-help p {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--ink-2);
}

.side-help strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
    margin-bottom: 2px;
}

/* ---------- Topbar ---------- */
.main {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 36px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    cursor: pointer;
}

.practice {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.practice b {
    font-size: 15px;
}

.practice span {
    font-size: 13px;
    color: var(--ink-3);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    display: grid;
    place-items: center;
    color: var(--ink-2);
}

.icon-btn .dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--high);
    border: 2px solid var(--surface);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--blue-ink);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
}

/* ---------- Content ---------- */
.content {
    padding: 32px 36px 56px;
    max-width: 1280px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--blue);
    color: var(--blue-ink);
}

.btn-primary:hover {
    background: var(--blue-deep);
}

.btn-ghost {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}

.btn-ghost:hover {
    background: var(--surface-2);
}

.btn-sm {
    padding: 7px 12px;
    font-size: 13px;
}

/* Welcome */
.welcome {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.welcome h1 {
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    font-weight: 700;
}

.welcome p {
    margin: 0;
    color: var(--ink-2);
    max-width: 60ch;
    font-size: 16px;
}

.welcome-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Engagement: the signature element */
.journey {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px 26px 26px;
    margin-bottom: 24px;
}

.journey-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.journey-head h2 {
    margin: 0;
    font-size: 18px;
}

.journey-head p {
    margin: 0;
    color: var(--ink-3);
    font-size: 14px;
}

.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: relative;
}

.step {
    position: relative;
    padding-right: 18px;
}

.step-mark {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    background: var(--surface);
    border: 2px solid var(--line);
    color: var(--ink-3);
    margin-bottom: 14px;
}

.step::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 34px;
    right: 0;
    height: 2px;
    background: var(--line);
}

.step:last-child::before {
    display: none;
}

.step.done .step-mark {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--teal-ink);
}

.step.done::before {
    background: var(--ok-fill);
}

.step.now .step-mark {
    border-color: var(--blue);
    color: var(--blue);
    box-shadow: 0 0 0 5px var(--blue-soft);
}

.step.now::before {
    background: linear-gradient(90deg, var(--blue) 40%, var(--line) 40%);
}

.step h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.step p {
    margin: 0;
    font-size: 13.5px;
    color: var(--ink-2);
    max-width: 28ch;
}

.step .when {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ink-3);
}

.step.now .when {
    color: var(--blue);
    font-weight: 600;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 0;
    flex-wrap: wrap;
}

.panel-head h2 {
    margin: 0;
    font-size: 17px;
}

.panel-head a {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.panel-body {
    padding: 16px 22px 22px;
}

/* Roadmap */
.progress-line {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px 0;
}

.bar {
    flex: 1;
    height: 8px;
    border-radius: 99px;
    background: var(--surface-2);
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--ok-fill);
    border-radius: inherit;
    transition: width .5s ease;
}

.progress-line output {
    font-size: 14px;
    color: var(--ink-2);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.filters {
    display: flex;
    gap: 6px;
    padding: 16px 22px 4px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--ink-2);
}

.chip[aria-pressed="true"] {
    background: var(--blue);
    color: var(--on-blue);
    border-color: var(--blue);
}

.findings {
    list-style: none;
    margin: 0;
    padding: 6px 12px 12px;
}

.finding {
    border-radius: 10px;
}

.finding+.finding {
    border-top: 1px solid var(--line);
}

.finding-row {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 10px;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.finding-row:hover {
    background: var(--surface-2);
    border-radius: 10px;
}

.sev {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.sev.high {
    background: var(--high);
}

.sev.mod {
    background: var(--mod);
}

.sev.low {
    background: var(--low);
}

.f-title {
    font-weight: 600;
    display: block;
}

.f-area {
    font-size: 13px;
    color: var(--ink-3);
    display: block;
}

.tag {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 99px;
    white-space: nowrap;
}

.tag.high {
    background: var(--high-soft);
    color: var(--high);
}

.tag.mod {
    background: var(--mod-soft);
    color: var(--mod);
}

.tag.low {
    background: var(--low-soft);
    color: var(--low);
}

.tag.fixed {
    background: var(--ok-soft);
    color: var(--ok);
}

.chev {
    width: 16px;
    height: 16px;
    color: var(--ink-3);
    transition: transform .2s ease;
}

.finding.open .chev {
    transform: rotate(180deg);
}

.finding.fixed .f-title {
    color: var(--ink-3);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.finding-detail {
    display: none;
    padding: 2px 10px 18px 34px;
}

.finding.open .finding-detail {
    display: block;
}

.finding-detail p {
    margin: 0 0 10px;
    color: var(--ink-2);
    font-size: 14px;
    max-width: 70ch;
}

.finding-detail ol {
    margin: 0 0 14px;
    padding-left: 20px;
    font-size: 14px;
    color: var(--ink-2);
}

.finding-detail ol li {
    margin-bottom: 4px;
}

.detail-meta {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-3);
    margin-bottom: 14px;
}

.detail-meta b {
    color: var(--ink);
    font-weight: 600;
}

.detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.empty {
    padding: 28px 22px;
    text-align: center;
    color: var(--ink-2);
}

/* Safeguards */
.safeguards {
    display: grid;
    gap: 16px;
}

.sg {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 14px;
    align-items: center;
}

.sg-name {
    font-weight: 600;
    font-size: 14px;
}

.sg-track {
    height: 8px;
    border-radius: 99px;
    background: var(--surface-2);
    overflow: hidden;
    display: flex;
}

.sg-track i {
    display: block;
    height: 100%;
}

.sg-track .met {
    background: var(--ok-fill);
}

.sg-track .gap {
    background: #e9805f;
}

.sg-num {
    font-size: 13px;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.legend {
    display: flex;
    gap: 18px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--ink-3);
}

.legend span::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: 0;
}

.legend .l-met::before {
    background: var(--ok-fill);
}

.legend .l-gap::before {
    background: #e9805f;
}

.legend .l-rev::before {
    background: var(--surface-2);
    border: 1px solid var(--line);
}

/* Tasks */
.tasks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.task {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
}

.task+.task {
    border-top: 1px solid var(--line);
}

.task input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--teal-ink);
    flex: none;
    cursor: pointer;
}

.task label {
    cursor: pointer;
}

.task b {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.task span {
    font-size: 13px;
    color: var(--ink-3);
}

.task input:checked+label b {
    color: var(--ink-3);
    text-decoration: line-through;
}

/* Dates */
.dates {
    list-style: none;
    margin: 0;
    padding: 0;
}

.date {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 14px;
    align-items: center;
    padding: 10px 0;
}

.date+.date {
    border-top: 1px solid var(--line);
}

.cal {
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
}

.cal small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    background: var(--blue-wash);
    color: var(--blue-deep);
    padding: 2px 0;
}

.cal b {
    display: block;
    font-size: 18px;
    padding: 2px 0 3px;
}

.date strong {
    display: block;
    font-size: 14px;
}

.date span {
    font-size: 13px;
    color: var(--ink-3);
}

/* Documents */
.docs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
}

.doc+.doc {
    border-top: 1px solid var(--line);
}

.doc-icon {
    width: 34px;
    height: 40px;
    border-radius: 5px;
    background: var(--blue-soft);
    color: var(--blue);
    display: grid;
    place-items: center;
    flex: none;
    font-size: 10px;
    font-weight: 700;
}

.doc-text {
    flex: 1;
    min-width: 0;
}

.doc-text strong {
    display: block;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-text span {
    font-size: 13px;
    color: var(--ink-3);
}

.doc.pending .doc-icon {
    background: var(--surface-2);
    color: var(--ink-3);
}

.privacy-note {
    margin-top: 28px;
    font-size: 13px;
    color: var(--ink-3);
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 80ch;
}

.privacy-note svg {
    flex: none;
    margin-top: 2px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: var(--ink);
    color: var(--surface);
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    display: flex;
    gap: 14px;
    align-items: center;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.toast button {
    background: none;
    border: 0;
    color: var(--surface);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 26px;
    }

    .step:nth-child(2)::before {
        display: none;
    }
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 270px;
        z-index: 20;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 0 0 0 100vmax transparent;
    }

    .sidebar.open {
        transform: none;
        box-shadow: 0 0 0 100vmax rgba(38, 36, 36, .4);
    }

    .menu-btn {
        display: inline-grid;
        place-items: center;
    }

    .topbar {
        padding: 12px 18px;
    }

    .content {
        padding: 24px 18px 48px;
    }

    .welcome h1 {
        font-size: 25px;
    }
}

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

    .step::before {
        display: none;
    }

    .finding-row {
        grid-template-columns: auto 1fr auto;
    }

    .finding-row .tag {
        display: none;
    }

    .finding-detail {
        padding-left: 10px;
    }

    .sg {
        grid-template-columns: 1fr auto;
    }

    .sg-track {
        grid-column: 1 / -1;
        order: 3;
    }

    .topbar-right .btn {
        display: none;
    }
}

/* =====================================================================
   Sign up and log in pages  (body.page-auth)
   ===================================================================== */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 5fr) 7fr;
}

/* Left: context panel */
.auth-aside {
    background: var(--blue-wash);
    border-right: 1px solid var(--line);
    padding: 44px 56px;
    display: flex;
    flex-direction: column;
}

.auth-aside .brand {
    padding: 0;
}

.auth-aside .brand img {
    height: 32px;
}

.auth-aside h1 {
    font-size: clamp(30px, 3.2vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.025em;
    font-weight: 700;
    margin: 72px 0 16px;
    max-width: 14em;
}

.auth-lede {
    color: var(--ink-2);
    font-size: 17px;
    max-width: 32em;
    margin: 0 0 36px;
}

/* Example findings card, same language as the dashboard roadmap */
.sample {
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 18px 20px 6px;
}

.sample-head {
    margin-bottom: 4px;
}

.sample-head strong {
    display: block;
    font-size: 15px;
}

.sample-head span {
    font-size: 13px;
    color: var(--ink-3);
}

.sample ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sample li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
}

.sample li+li {
    border-top: 1px solid var(--line);
}

.auth-foot {
    margin-top: auto;
    padding-top: 48px;
    color: var(--ink-3);
    font-size: 14px;
}

/* Right: form */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--paper);
}

.auth-card {
    width: 100%;
    max-width: 560px;
}

.auth-card h2 {
    font-size: 30px;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 8px;
}

.auth-sub {
    margin: 0 0 32px;
    color: var(--ink-2);
}

.auth-sub a {
    font-weight: 600;
    text-underline-offset: 3px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 16px;
}

.full {
    grid-column: 1 / -1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field label,
.field-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.hint {
    font-size: 13px;
    color: var(--ink-3);
    margin: 0;
}

.input,
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"] {
    width: 100%;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    transition: border-color .15s, box-shadow .15s;
}

.field input::placeholder {
    color: var(--ink-3);
    opacity: .8;
}

.field input:hover {
    border-color: #b7c7d4;
}

/* Dropdown */
.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--ink-2);
    border-bottom: 2px solid var(--ink-2);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.field select {
    width: 100%;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 44px 11px 14px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.field select:invalid {
    color: var(--ink-3);
}

.field select option {
    color: var(--ink);
}

.field select:hover {
    border-color: #b7c7d4;
}

.field select:focus-visible {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-wash);
}

.field.invalid select {
    border-color: var(--high);
}

.field input:focus-visible {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-wash);
}

.field.invalid input {
    border-color: var(--high);
}

.error {
    color: var(--high);
    font-size: 13px;
    margin: 0;
}

.error:empty {
    display: none;
}

/* Employee count: segmented radio group */
fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.segments {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.segments input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segments label {
    display: block;
    text-align: center;
    padding: 10px 4px;
    font-weight: 500;
    font-size: 15px;
    color: var(--ink-2);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.segments label:hover {
    border-color: #b7c7d4;
    color: var(--ink);
}

.segments input:checked+label {
    background: var(--blue-wash);
    border-color: var(--blue);
    color: var(--blue-deep);
    font-weight: 600;
}

.segments input:focus-visible+label {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-wash);
}

fieldset.invalid .segments label {
    border-color: var(--high);
}

/* Password */
.pw-wrap {
    position: relative;
}

.pw-wrap input {
    padding-right: 76px;
}

.pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    background: none;
    border: 0;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}

.pw-toggle:hover {
    color: var(--blue-deep);
}

.rules {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    font-size: 13px;
    color: var(--ink-3);
}

.rules li::before {
    content: "\25CB\00a0";
}

.rules li.ok {
    color: var(--teal-ink);
    font-weight: 600;
}

.rules li.ok::before {
    content: "\2713";
    display: inline-block;
    background: var(--teal);
    border-radius: 4px;
    padding: 0 4px;
    margin-right: 5px;
}

/* Submit and messages */
.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 20px;
    font-size: 16px;
}

.btn[disabled] {
    opacity: .7;
    cursor: progress;
}

.auth-card .submit {
    margin-top: 28px;
}

.form-error {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--open);
    color: var(--open-ink);
    font-size: 15px;
}

.form-error:empty {
    display: none;
}

.legal {
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--ink-3);
}

.legal a {
    color: var(--ink-2);
}

/* Success state */
.success {
    display: none;
}

.success.show {
    display: block;
}

.success:focus {
    outline: none;
}

.success-check {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--teal);
    color: var(--teal-ink);
    display: grid;
    place-items: center;
    margin-bottom: 20px;
}

.success h2 {
    margin-bottom: 10px;
}

.success p {
    color: var(--ink-2);
    margin: 0 0 20px;
}

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

    .auth-aside {
        padding: 24px 22px 28px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .auth-aside h1 {
        margin-top: 28px;
        font-size: 28px;
    }

    .auth-lede {
        margin-bottom: 22px;
        font-size: 16px;
    }

    .auth-foot {
        display: none;
    }

    .sample li:nth-child(n+3) {
        display: none;
    }

    .auth-main {
        padding: 28px 18px 44px;
    }
}

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

    .segments {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

/* ---------- Security lead (topbar) ---------- */
.lead {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 14px;
    border-right: 1px solid var(--line);
}

.lead-photo {
    position: relative;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--teal);
    color: var(--teal-ink);
    font-weight: 700;
    font-size: 13px;
}

.lead-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lead-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.lead-label {
    font-size: 12px;
    color: var(--ink-3);
}

.lead-text b {
    font-size: 14px;
    font-weight: 600;
}

.lead-msg svg {
    width: 15px;
    height: 15px;
    flex: none;
}

@media (max-width: 820px) {
    .lead-text {
        display: none;
    }
}

@media (max-width: 560px) {
    .topbar-right .lead-msg {
        display: inline-flex;
        padding: 7px 9px;
    }

    .lead-msg-text {
        display: none;
    }
}

/* ---------- Scoping call prompt ---------- */
.gate {
    display: grid;
}

.gate>* {
    grid-area: 1 / 1;
    min-width: 0;
}

/* Placeholder background */
.gate-ghost {
    display: flex;
    flex-direction: column;
    gap: 24px;
    filter: blur(5px);
    opacity: .8;
    pointer-events: none;
    user-select: none;
    -webkit-mask-image: linear-gradient(#000 35%, transparent 95%);
    mask-image: linear-gradient(#000 35%, transparent 95%);
}

.ghost-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0 4px;
}

.ghost-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 24px;
}

.ghost-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.ghost-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gate-ghost i {
    display: block;
    flex: none;
}

.ghost-line {
    height: 10px;
    border-radius: 99px;
    background: var(--line);
}

.ghost-title {
    height: 22px;
}

.ghost-heading {
    height: 14px;
    background: #c9d6e0;
}

.ghost-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.ghost-pill {
    width: 74px;
    height: 20px;
    margin-left: auto;
    border-radius: 99px;
}

.ghost-dot.high {
    background: var(--high);
}

.ghost-dot.mod {
    background: var(--mod);
}

.ghost-dot.low {
    background: var(--low);
}

.ghost-pill.high {
    background: var(--high-soft);
}

.ghost-pill.mod {
    background: var(--mod-soft);
}

.ghost-pill.low {
    background: var(--low-soft);
}

/* The card */
.gate-card {
    position: relative;
    z-index: 1;
    align-self: start;
    justify-self: center;
    width: 100%;
    max-width: 540px;
    margin-top: 10px;
    padding: 32px 32px 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 rgba(20, 135, 209, .08), 0 30px 60px -30px rgba(13, 106, 166, .45);
}

.gate-card h1 {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.gate-card>p {
    margin: 0 0 22px;
    max-width: 46ch;
    font-size: 16px;
    color: var(--ink-2);
}

.gate-lead {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 22px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.gate-lead[hidden] {
    display: none;
}

.gate-lead .lead-photo {
    width: 44px;
    height: 44px;
    font-size: 15px;
}

.gate-lead-text span {
    display: block;
    font-size: 13px;
    color: var(--ink-3);
}

.gate-lead-text b {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.gate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gate-actions .btn[hidden] {
    display: none;
}

.gate-next {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.gate-next h2 {
    margin: 0 0 12px;
    font-size: 14px;
}

.gate-next ol {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: gate;
}

.gate-next li {
    counter-increment: gate;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    color: var(--ink-2);
}

.gate-next li::before {
    content: counter(gate);
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-3);
}

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

    .gate-card {
        margin-top: 16px;
    }
}

@media (max-width: 560px) {
    .gate-card {
        padding: 24px 20px;
    }

    .gate-card h1 {
        font-size: 24px;
    }

    .gate-actions .btn {
        width: 100%;
    }
}