/* Web sign-up (/signup, /signup/checkout, /signup/welcome; Components/Pages/Signup).
   Built on the sign-in page (css/admin-login.css): every colour is a --cil-* token from .ci-login, so light and dark
   follow it. This file adds the progress strip, the plan cards, the code field, the help list, the checkout summary
   and the welcome checklist.
   A chosen plan is never outlined in colour: it gets a tick and a slightly deeper see-through fill. Badges are a
   hairline with a word in it, not a tinted pill. */

.ci-signup { --cis-radius: 14px; }

.ci-signup-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 540px); align-items: start; }
.ci-signup-intro { padding-top: 12px; }
/* Beside the taller sign-up card the copy column is narrower, so its headline is a size down and keeps to two lines. */
.ci-signup-intro .ci-login-headline { font-size: clamp(32px, 2.9vw, 40px); }
.ci-signup-card { padding-top: 26px; }

/* ---------- Progress strip ---------- */

.ci-signup-steps {
    display: flex;
    gap: 6px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.ci-signup-steps li {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 9px;
    border-top: 2px solid var(--cil-line);
    color: var(--cil-soft);
    font-size: 12.5px;
    font-weight: 500;
    min-width: 0;
}

.ci-signup-steps li.is-done { border-top-color: color-mix(in srgb, var(--cil-text) 42%, transparent); color: var(--cil-muted); }
.ci-signup-steps li.is-current { border-top-color: var(--cil-text); color: var(--cil-text); font-weight: 600; }

.ci-signup-step-dot {
    display: none;
}

.ci-signup-step-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Notices, hints ---------- */

.ci-signup-notice-text { white-space: normal; }
.ci-signup-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--cil-soft); line-height: 1.45; }
.ci-signup-hint.is-expired { color: var(--cil-caution); font-weight: 600; }
.ci-login-label-row .ci-signup-hint { margin-top: 0; }

.ci-signup-confirmed {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px var(--cil-line-strong);
    color: var(--cil-text);
    font-size: 14px;
    font-weight: 600;
}

.ci-signup-confirmed > i { color: var(--cil-green); }

/* ---------- Plan cards ---------- */

.ci-signup-plans {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.ci-signup-plans legend {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cil-text);
}

.ci-signup-plan { position: relative; display: block; cursor: pointer; }
.ci-signup-plan input { position: absolute; opacity: 0; pointer-events: none; }

.ci-signup-plan-body,
.ci-signup-plan-toggle {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    grid-template-areas: "mark top price" "mark sub price";
    align-items: center;
    gap: 2px 14px;
    width: 100%;
    padding: 13px 16px 13px 14px;
    border: 0;
    border-radius: var(--cis-radius);
    background: none;
    box-shadow: inset 0 0 0 1px var(--cil-field-border);
    color: var(--cil-text);
    text-align: left;
    font: inherit;
    transition: background .15s ease, box-shadow .15s ease;
}

.ci-signup-plan:hover .ci-signup-plan-body,
.ci-signup-plan-toggle:hover:not(:disabled) { background: var(--cil-well); box-shadow: inset 0 0 0 1px var(--cil-field-hover); }

/* The mark: an empty ring until the plan is chosen, then the page's ink with a tick in it. */
.ci-signup-plan-body::before,
.ci-signup-plan-toggle::before {
    content: "";
    grid-area: mark;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px var(--cil-line-strong);
    color: var(--cil-page);
    font: 900 10px/1 "Font Awesome 6 Free";
    transition: background-color .15s ease, box-shadow .15s ease;
}

/* Chosen: the fill deepens a little, top to bottom, and the ring fills in with a tick. The edge keeps its hairline. */
.ci-signup-plan input:checked + .ci-signup-plan-body,
.ci-signup-plan-toggle.is-selected {
    background: var(--cil-picked);
    box-shadow: inset 0 0 0 1px var(--cil-line-strong);
}

.ci-signup-plan input:checked + .ci-signup-plan-body::before,
.ci-signup-plan-toggle.is-selected::before {
    content: "\f00c";
    background: var(--cil-text);
    box-shadow: none;
}

.ci-signup-plan input:focus-visible + .ci-signup-plan-body,
.ci-signup-plan-toggle:focus-visible { outline: 2px solid var(--cil-text); outline-offset: 2px; }

.ci-signup-plan-top { grid-area: top; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.ci-signup-plan-top b, .ci-signup-plan-toggle b { font-weight: 600; }
.ci-signup-plan-toggle > span:first-child { grid-area: top; display: flex; align-items: center; gap: 8px; }
.ci-signup-plan-price { grid-area: price; font-size: 20px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ci-signup-plan-price small { margin-left: 2px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--cil-muted); }
.ci-signup-plan-sub { grid-area: sub; font-size: 12.5px; color: var(--cil-muted); }
.ci-signup-plan--free .ci-signup-plan-price { color: var(--cil-muted); }

.ci-signup-plan-note {
    display: flex;
    gap: 8px;
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--cil-soft);
}

.ci-signup-plan-note i { margin-top: 3px; }
.ci-signup-plan-note a { color: var(--cil-muted); font-weight: 600; }
.ci-signup-plan-note a:hover { color: var(--cil-text); }
.ci-signup-plan-note--pro b { font-weight: 600; color: var(--cil-muted); }

/* A word in a hairline. The saving is the one that carries a colour (the text, never the fill). */
.ci-signup-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--cil-line-strong);
    color: var(--cil-green);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
}

.ci-signup-badge--quiet { color: var(--cil-muted); }
.ci-signup-badge--caution { margin-left: 6px; color: var(--cil-caution); }

/* ---------- Code + password ---------- */

.ci-signup-code input {
    font-family: "SF Mono", ui-monospace, Consolas, Menlo, monospace;
    font-size: 22px !important;
    font-weight: 600;
    letter-spacing: .4em;
}

.ci-signup-code input::placeholder { letter-spacing: .4em; font-weight: 500; }

.ci-signup-strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.ci-signup-strength span { height: 3px; border-radius: 3px; background: var(--cil-line); transition: background-color .2s ease; }
.ci-signup-strength[data-level="1"] span:nth-child(-n+1) { background: var(--cil-danger); }
.ci-signup-strength[data-level="2"] span:nth-child(-n+2) { background: var(--cil-caution); }
.ci-signup-strength[data-level="3"] span:nth-child(-n+3) { background: var(--cil-green); }
.ci-signup-strength[data-level="4"] span { background: var(--cil-green); }

.ci-signup-check { align-items: flex-start; width: auto; line-height: 1.5; }
.ci-signup-check .ci-login-remember-box { flex: 0 0 20px; margin-top: 1px; }
.ci-signup-check a { color: var(--cil-text); font-weight: 600; }
.ci-signup-check b { color: var(--cil-text); font-weight: 600; }

.ci-signup-subactions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 16px;
}

.ci-signup-inline-form { margin: 0; }
.ci-signup-subactions .ci-login-link { display: inline-flex; align-items: center; gap: 7px; }
.ci-signup-subactions .ci-login-link i { font-size: 12px; }

/* ---------- Buttons, links ---------- */

.ci-signup-actions { display: grid; gap: 10px; }

/* The second button: the same pill with only its hairline. */
.ci-signup-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: none;
    box-shadow: inset 0 0 0 1px var(--cil-line-strong);
    color: var(--cil-text);
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: box-shadow .15s ease, background-color .15s ease;
}

.ci-signup-secondary:hover { background: var(--cil-well); box-shadow: inset 0 0 0 1px var(--cil-field-hover); color: var(--cil-text); }
.ci-signup-secondary:focus-visible { outline: 2px solid var(--cil-text); outline-offset: 2px; }
.ci-signup-secondary i { font-size: 13px; opacity: .8; }

.ci-signup-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 13.5px; color: var(--cil-muted); }
.ci-signup-foot b { color: var(--cil-text); font-weight: 600; }
/* A link on these pages is the ink at weight 600, never underlined and never coloured. */
.ci-signup-link { color: var(--cil-text); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: opacity .15s ease; }
.ci-signup-link:hover { color: var(--cil-text); opacity: .7; }
.ci-signup-link i { font-size: 12px; opacity: .75; }

.ci-signup-lede { margin: 0 0 16px; color: var(--cil-muted); font-size: 14.5px; line-height: 1.6; }
.ci-signup-lede b { color: var(--cil-text); font-weight: 600; }
.ci-signup-lede--tight { margin-bottom: 10px; }

.ci-signup-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0;
    color: var(--cil-muted);
    font-size: 14px;
}

.ci-signup-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid color-mix(in srgb, var(--cil-text) 20%, transparent);
    border-top-color: var(--cil-text);
    border-radius: 50%;
    animation: ci-signup-spin .8s linear infinite;
}

@keyframes ci-signup-spin { to { transform: rotate(360deg); } }

/* ---------- Help list ---------- */

/* "Questions?": a heading and a plain list of answers with a rule between them. No box. */
.ci-signup-help { margin-top: 34px; }

.ci-signup-help h2 {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: -.02em;
    color: var(--cil-text);
}

.ci-signup-help details { border-top: 1px solid var(--cil-line); }

.ci-signup-help summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    color: var(--cil-text);
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.ci-signup-help summary::-webkit-details-marker { display: none; }
.ci-signup-help summary::after { content: "+"; color: var(--cil-soft); font-weight: 400; font-size: 18px; line-height: 1; }
.ci-signup-help details[open] summary::after { content: "\2212"; }
.ci-signup-help summary:focus-visible { outline: 2px solid var(--cil-text); outline-offset: 2px; border-radius: 4px; }
.ci-signup-help p { margin: 0 0 14px; color: var(--cil-muted); font-size: 13.5px; line-height: 1.6; }
.ci-signup-help a { color: var(--cil-text); font-weight: 600; }
.ci-signup-help-foot { padding-top: 12px; border-top: 1px solid var(--cil-line); }
.ci-signup-help--mobile { display: none; }

/* ---------- Checkout ---------- */

.ci-signup-summary {
    padding-top: 12px;
    animation: ci-login-rise .6s cubic-bezier(.2, .8, .2, 1) both;
}

.ci-signup-summary-title { margin: 14px 0 22px; font-size: clamp(36px, 3.9vw, 54px); line-height: 1.08; letter-spacing: -.035em; color: var(--cil-text); }
.ci-signup-plans--compact { grid-template-columns: 1fr 1fr; gap: 10px; }
/* The two billing periods side by side: the mark moves to the top right corner. */
.ci-signup-plan-toggle { cursor: pointer; grid-template-areas: "top mark" "price price" "sub sub"; grid-template-columns: minmax(0, 1fr) 20px; gap: 4px 10px; padding: 14px 14px 14px 16px; }
.ci-signup-plan-toggle:disabled { cursor: default; opacity: .7; }

.ci-signup-terms { display: grid; margin: 22px 0; border-block: 1px solid var(--cil-line); }
.ci-signup-terms div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 11px 0; font-size: 13.5px; line-height: 1.5; }
.ci-signup-terms div + div { border-top: 1px solid var(--cil-line); }
.ci-signup-terms dt { color: var(--cil-muted); font-weight: 500; }
.ci-signup-terms dd { margin: 0; color: var(--cil-text); }

.ci-signup-included { display: grid; gap: 14px; margin: 0 0 16px; padding: 0; list-style: none; }
.ci-signup-included li { display: flex; gap: 12px; align-items: flex-start; }
.ci-signup-included li span:last-child { display: grid; gap: 2px; }
.ci-signup-included b { font-size: 14px; font-weight: 600; color: var(--cil-text); }
.ci-signup-included small { font-size: 13px; color: var(--cil-muted); line-height: 1.45; }

.ci-signup-included-glyph {
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    box-shadow: inset 0 0 0 1px var(--cil-line-strong);
    color: var(--cil-text);
    font-size: 13px;
}

.ci-signup-fineprint { margin: 0; font-size: 12.5px; color: var(--cil-soft); line-height: 1.5; }

.ci-signup-checkout-mount { display: none; }
.ci-signup-checkout-mount.is-open {
    display: block;
    min-height: 320px;
    margin: 4px 0 12px;
    border-radius: 14px;
    overflow: hidden;
}

.ci-signup-pay-marks {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 16px 0 4px;
    color: var(--cil-soft);
    font-size: 24px;
}

.ci-signup-stores { display: flex; gap: 10px; margin-top: 12px; }
.ci-signup-stores a { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--cil-line-strong); color: var(--cil-text); font-weight: 600; font-size: 14px; }
.ci-signup-stores a:hover { background: var(--cil-well); box-shadow: inset 0 0 0 1px var(--cil-field-hover); color: var(--cil-text); }

/* ---------- Welcome ---------- */

.ci-signup-welcome-shell { position: relative; max-width: 640px; }
.ci-signup-welcome-card { padding-bottom: 22px; }
.ci-signup-welcome-head { display: grid; justify-items: center; gap: 8px; margin-bottom: 24px; text-align: center; }
.ci-signup-welcome-head h1 { margin: 0; font-size: clamp(30px, 3.6vw, 38px); line-height: 1.12; letter-spacing: -.032em; color: var(--cil-text); }
.ci-signup-welcome-head .ci-signup-lede { margin: 0; max-width: 460px; }
.ci-signup-plan-line { display: block; margin-top: 6px; color: var(--cil-text); font-weight: 600; }

.ci-signup-welcome-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: var(--cil-text);
    color: var(--cil-page);
    font-size: 17px;
}

/* The three things to do next: one list, a rule between the lines. */
.ci-signup-next { display: grid; margin: 0 0 22px; padding: 0; list-style: none; border-block: 1px solid var(--cil-line); }

.ci-signup-next li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
}

.ci-signup-next li + li { border-top: 1px solid var(--cil-line); }
.ci-signup-next li div { display: grid; gap: 2px; }
.ci-signup-next b { font-size: 14.5px; font-weight: 600; color: var(--cil-text); }
.ci-signup-next small { font-size: 13px; color: var(--cil-muted); line-height: 1.45; }

.ci-signup-next-glyph { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--cil-line-strong); color: var(--cil-text); font-size: 14px; }

.ci-signup-next-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--cil-line-strong);
    color: var(--cil-text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: box-shadow .15s ease, background-color .15s ease;
}

.ci-signup-next-action:hover { background: var(--cil-well); box-shadow: inset 0 0 0 1px var(--cil-field-hover); color: var(--cil-text); }
.ci-signup-next-action i { font-size: 11px; opacity: .75; }

.ci-signup-next-stores { display: flex; gap: 6px; }
.ci-signup-next-stores a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--cil-line-strong); color: var(--cil-text); font-size: 16px; transition: box-shadow .15s ease, background-color .15s ease; }
.ci-signup-next-stores a:hover { background: var(--cil-well); box-shadow: inset 0 0 0 1px var(--cil-field-hover); color: var(--cil-text); }

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .ci-signup-shell { grid-template-columns: minmax(0, 1fr); }
    .ci-signup-card { max-width: 540px; }
    .ci-signup-help--side { display: none; }
    .ci-signup-help--mobile { display: block; width: 100%; max-width: 540px; justify-self: center; }
    .ci-signup--checkout .ci-signup-summary { order: 2; max-width: 540px; width: 100%; justify-self: center; }
    .ci-signup--checkout .ci-signup-help--mobile { order: 3; }
    .ci-signup--welcome .ci-signup-help--mobile { margin-inline: auto; }
}

@media (min-width: 992px) {
    .ci-signup--checkout .ci-signup-help--mobile,
    .ci-signup--welcome .ci-signup-help--mobile { display: block; grid-column: 1 / -1; max-width: 540px; }
    .ci-signup--welcome .ci-signup-help--mobile { margin-inline: auto; }
}

@media (max-width: 479.98px) {
    .ci-signup-welcome-shell { padding-inline: 16px; }
    .ci-signup-steps li { font-size: 11.5px; }
    .ci-signup-plans--compact { grid-template-columns: 1fr; }
    .ci-signup-plan-body { gap: 2px 10px; padding-inline: 12px 14px; }
    .ci-signup-plan-price { font-size: 18px; }
    .ci-signup-next li { grid-template-columns: 36px minmax(0, 1fr); }
    .ci-signup-next-action, .ci-signup-next-stores { grid-column: 2; justify-self: start; }
    .ci-signup-terms div { grid-template-columns: 1fr; gap: 2px; }
    .ci-signup-summary-title { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .ci-signup-spinner { animation: none; }
    .ci-signup-summary { animation: none; }
}

/* ---------- Entry points elsewhere on the site ---------- */

/* PublicCta (Home, Features, Reports, Investments, About): "Or start on the web" under the store badges. */
.mw-cta .mw-cta-web { display: inline-flex; align-items: center; margin: 22px 0 10px; }
.mw-cta .mw-cta-web + .mw-text-link { display: block; width: fit-content; margin-inline: auto; }
/* The web account first, then the stores as the other way in (PublicCta.razor). */
.mw-cta > .mw-cta-apps { margin: 8px 0 0; font-size: 13.5px; }
.mw-cta > .mw-cta-apps + .mw-store-links { margin-top: 12px; }
.mw-cta > .mw-cta-compare { display: block; width: fit-content; margin: 20px auto 0; }

/* Sign-in card footer: "New to Chip In? Create an account". */
.ci-login-create { margin-left: 4px; color: var(--cil-text); font-weight: 600; transition: opacity .15s ease; }
.ci-login-create:hover { color: var(--cil-text); opacity: .7; }

/* ---- Terms & Privacy bottom sheet (LegalSheet.razor, opened by signup.js) ---- */
/* Own tokens, light and dark: the layout-hosted sheets (MainLayout, AdminLayout) sit outside .ci-login, so the --cil-*
   tokens don't exist there. The --mw-* overrides keep the .mw document (summary card, TOC, rules) on the sheet's palette.
   The sheet's own chrome is neutral like the sign-up pages: no colour edge, the chosen tab is underlined in the ink,
   and its button is the same see-through pill. */
.ci-legal-sheet {
    --sheet-bg: #ffffff;
    --sheet-text: #0b0f19;
    --sheet-muted: #565973;
    --sheet-line: rgba(11, 15, 25, .1);
    --sheet-line-strong: rgba(11, 15, 25, .2);
    --sheet-sheer: linear-gradient(180deg, rgba(11, 15, 25, .075), rgba(11, 15, 25, .04));
    --sheet-sheer-hover: linear-gradient(180deg, rgba(11, 15, 25, .12), rgba(11, 15, 25, .07));
    --sheet-highlight: rgba(255, 255, 255, .6);
    --sheet-shadow: 0 -24px 80px -20px rgba(11, 15, 25, .34);
    --sheet-backdrop: rgba(9, 8, 22, .52);
    --sheet-ease: cubic-bezier(.22, 1, .36, 1);
    position: fixed;
    inset: auto 0 0 0;
    width: min(820px, 100vw);
    max-width: 100vw;
    height: min(90dvh, 980px);
    max-height: 100dvh;
    margin: auto auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sheet-text);
    font-family: "Manrope Soft", "Manrope", system-ui, sans-serif;
    overflow: visible;
}
[data-bs-theme="dark"] .ci-legal-sheet {
    --sheet-bg: #141725;
    --sheet-text: #f1f2f8;
    --sheet-muted: #b4b7c9;
    --sheet-line: rgba(255, 255, 255, .1);
    --sheet-line-strong: rgba(255, 255, 255, .22);
    --sheet-sheer: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .06));
    --sheet-sheer-hover: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .09));
    --sheet-highlight: rgba(255, 255, 255, .07);
    --sheet-shadow: 0 -24px 80px -18px rgba(0, 0, 0, .75);
    --sheet-backdrop: rgba(3, 4, 10, .66);
}
.ci-legal-sheet .ci-legal-sheet-doc {
    --mw-text: var(--sheet-text);
    --mw-muted: var(--sheet-muted);
    --mw-border: var(--sheet-line);
    --mw-soft: color-mix(in srgb, var(--sheet-text) 4%, var(--sheet-bg));
    --ci-dashboard-card-border: var(--sheet-line-strong);
    color: var(--sheet-text);
}
.ci-legal-sheet .ci-legal-body strong, .ci-legal-sheet .ci-legal-body b { color: var(--sheet-text); }
.ci-legal-sheet:not([open]) { display: none; }
.ci-legal-sheet::backdrop {
    background: rgba(9, 8, 22, 0);
    backdrop-filter: blur(0);
    transition: background .35s ease, backdrop-filter .35s ease;
}
.ci-legal-sheet.is-open::backdrop { background: var(--sheet-backdrop, rgba(9, 8, 22, .52)); backdrop-filter: blur(6px) saturate(120%); }

.ci-legal-sheet-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 28px 28px 0 0;
    background: var(--sheet-bg);
    box-shadow: var(--sheet-shadow), 0 1px 0 var(--sheet-highlight) inset;
    overflow: hidden;
    transform: translateY(104%);
    transition: transform .52s var(--sheet-ease);
    will-change: transform;
}
.ci-legal-sheet.is-open .ci-legal-sheet-panel { transform: translateY(var(--sheet-drag, 0px)); }
.ci-legal-sheet.is-dragging .ci-legal-sheet-panel { transition: none; }
.ci-legal-sheet-head {
    position: relative;
    flex: none;
    padding: 10px 20px 0;
    background: var(--sheet-bg);
    border-bottom: 1px solid var(--sheet-line);
    touch-action: none;
    cursor: grab;
}
.ci-legal-sheet.is-dragging .ci-legal-sheet-head { cursor: grabbing; }
.ci-legal-sheet-grip {
    display: block;
    width: 44px;
    height: 5px;
    margin: 4px auto 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--sheet-muted) 35%, transparent);
}
.ci-legal-sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.ci-legal-sheet-logo { display: inline-flex; align-items: center; }
.ci-legal-sheet-logo img { height: 54px; width: auto; display: block; }
.ci-legal-sheet-logo .is-dark { display: none; }
[data-bs-theme="dark"] .ci-legal-sheet-logo .is-light { display: none; }
[data-bs-theme="dark"] .ci-legal-sheet-logo .is-dark { display: block; }

.ci-legal-sheet-close {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: inset 0 0 0 1px var(--sheet-line-strong);
    color: var(--sheet-text);
    font-size: 16px;
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease;
}
.ci-legal-sheet-close:hover { background: var(--sheet-sheer); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sheet-text) 38%, transparent); }
.ci-legal-sheet-close:focus-visible, .ci-legal-sheet-tabs button:focus-visible, .ci-legal-sheet-agree:focus-visible, .ci-legal-sheet-full:focus-visible {
    outline: 2px solid var(--sheet-text);
    outline-offset: 2px;
}

.ci-legal-sheet-tabs { position: relative; display: flex; gap: 4px; margin-top: 6px; }
.ci-legal-sheet-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 14px;
    border: 0;
    background: none;
    color: var(--sheet-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: color .2s ease;
}
.ci-legal-sheet-tabs button[aria-selected="true"] { color: var(--sheet-text); }
.ci-legal-sheet-tabs button i { font-size: 14px; opacity: .8; }
.ci-legal-sheet-tabs button[aria-selected="true"] i { opacity: 1; }
.ci-legal-sheet-tab-ink {
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: var(--ink-w, 0);
    transform: translateX(var(--ink-x, 0));
    background: var(--sheet-text);
    transition: transform .35s var(--sheet-ease), width .35s var(--sheet-ease);
}

.ci-legal-sheet-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.ci-legal-sheet .ci-legal-sheet-doc {
    min-height: 0;
    padding: 22px clamp(18px, 4vw, 40px) 36px;
    background: transparent;
    animation: ci-legal-doc-in .35s var(--sheet-ease);
}
.ci-legal-sheet .ci-legal-sheet-title {
    margin: 0 0 4px;
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: -.032em;
    color: var(--sheet-text);
}
.ci-legal-sheet .ci-legal-body { padding-top: 10px; font-size: 14.5px; }
.ci-legal-sheet .ci-legal-body h2 { font-size: 20px; margin: 30px 0 12px; }
.ci-legal-sheet .ci-legal-body [id] { scroll-margin-top: 16px; }
.ci-legal-sheet .ci-legal-body a { color: var(--sheet-text); font-weight: 600; }
.ci-legal-sheet .ci-legal-toc { position: static; }
@keyframes ci-legal-doc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ci-legal-sheet-foot {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--sheet-line);
    background: color-mix(in srgb, var(--sheet-bg) 92%, transparent);
    backdrop-filter: blur(10px);
}
.ci-legal-sheet-full { display: inline-flex; align-items: center; gap: 8px; color: var(--sheet-muted); font-size: 13px; font-weight: 600; }
.ci-legal-sheet-full:hover { color: var(--sheet-text); }
.ci-legal-sheet-agree {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--sheet-sheer);
    box-shadow: inset 0 0 0 1px var(--sheet-line-strong);
    color: var(--sheet-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease;
}
.ci-legal-sheet-agree:hover { background: var(--sheet-sheer-hover); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sheet-text) 38%, transparent); }
.ci-legal-sheet-agree i { font-size: 13px; }

html.ci-sheet-lock, html.ci-sheet-lock body { overflow: hidden; }

@media (max-width: 575.98px) {
    .ci-legal-sheet { height: 94dvh; }
    .ci-legal-sheet-panel { border-radius: 22px 22px 0 0; }
    .ci-legal-sheet-logo img { height: 44px; }
    .ci-legal-sheet-tabs button { padding: 0 10px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .ci-legal-sheet-panel, .ci-legal-sheet::backdrop, .ci-legal-sheet-tab-ink { transition-duration: .01s; }
    .ci-legal-sheet .ci-legal-sheet-doc { animation: none; }
    .ci-legal-sheet-scroll { scroll-behavior: auto; }
}

/* The sign-up card follows the page on wide screens, so it stays in view while the left column scrolls. Only when
   the viewport is tall enough to show the whole card; shorter screens scroll it normally. */
@media (min-width: 992px) and (min-height: 820px) {
    .ci-login.ci-signup { overflow: clip; } /* overflow: hidden would turn the section into the sticky container */
    .ci-signup-shell > .ci-signup-card {
        position: sticky;
        top: 24px;
        align-self: start;
    }
}
