/* Client sign-up (Paper: "Sign up 1–5").
   One panel: the form on the left, the client's portal assembling itself on the right. */

:root {
  --su-dim: #8E9094; --su-off: #3A3B3E; --su-ring: #FFFFFF24; --su-dash: #FFFFFF29;
  --su-err-line: #F08A72; --su-err: #F5A08C;
  --su-glass: #0F1011A3; --su-glass-line: #FFFFFF29; --su-glass-shine: #FFFFFF1F; --su-shadow: #00000059;
  --su-side: #0B0B0C66; --su-card: #17181AD9; --su-row: #1F2023D9; --su-nav-on: #FFFFFF1A; --su-open: #DCEBF6;
  --su-photo: grayscale(1) brightness(1.05); --su-wash: transparent;
}
:root[data-theme="light"] {
  --su-dim: #63656A; --su-off: #1C1D1F24; --su-ring: #1C1D1F38; --su-dash: #1C1D1F3D;
  --su-err-line: #C4573F; --su-err: #A83E28;
  --su-glass: #FAFAF7C7; --su-glass-line: #FFFFFFB3; --su-glass-shine: #FFFFFFCC; --su-shadow: #1112132E;
  --su-side: #F1F1EC8C; --su-card: #FFFFFFE0; --su-row: #F1F1ECE6; --su-nav-on: #1C1D1F14; --su-open: #2C4F6E;
  --su-photo: grayscale(1) brightness(1.3) contrast(0.85); --su-wash: #FAFAF780;
}

.su { display: flex; min-height: 100dvh; padding: 20px; }
.su-panel { position: relative; flex: 1; display: flex; min-width: 0; min-height: 860px; border-radius: 20px; background: var(--app); overflow: clip; }
/* Hairlines are overlays so they take no room: the Paper widths add up exactly. */
.su-panel::after, .pv-window::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--line); border-radius: inherit; pointer-events: none; }
.su-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ───────── Form pane ───────── */
.su-form { flex: none; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; width: 560px; padding: 36px 48px 32px; }
.su-top { display: flex; flex-direction: column; gap: 56px; }
/* Step 1 holds the most fields, so Paper tightens its gaps to clear the footer at 900px tall. */
.su-top:has([data-step="account"]:not([hidden])) { gap: 36px; }
.su-step[data-step="account"] { gap: 22px; }
.su-step[data-step="account"] .su-fields { gap: 16px; }
.su-head { display: flex; flex-direction: column; gap: 20px; }
.su-brand { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.su-brand .logo { width: 137px; height: 32px; }
.su-brand-right { display: flex; align-items: center; gap: 14px; }
.su-count { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--muted); }
.su-round { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--su-ring); transition: transform 150ms ease-out; }
.su-round:active { transform: scale(0.96); }
.su-round:focus-visible { border-radius: 999px; }

.su-progress { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.su-progress li { position: relative; flex: 1; height: 3px; border-radius: 2px; background: var(--su-off); overflow: hidden; }
.su-progress i { position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 350ms var(--ease-out); }
.su-progress .is-on i { transform: none; }

.su-step { display: flex; flex-direction: column; gap: 28px; }
.su-step.is-in { animation: su-step 260ms var(--ease-out) both; }
@keyframes su-step { from { opacity: 0; transform: translateY(8px); } }
.su-title { display: flex; flex-direction: column; gap: 6px; }
.su-title h1 { font-size: 40px; line-height: 48px; font-weight: 300; letter-spacing: -0.02em; text-wrap: wrap; outline: none; }
.su-serif { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 26px; color: var(--muted); }

.su-fields { display: flex; flex-direction: column; gap: 22px; }
.su-field { display: flex; flex-direction: column; gap: 8px; }
.su-field > label:not(.su-agree), .su-group > legend:not(.su-sr), .su-sent span { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--label); }
.su-field input:not([type="checkbox"]) { width: 100%; height: 48px; padding: 0 16px; border: 1.5px solid transparent; border-radius: 8px; background: var(--row-2); color: var(--ink); font: 500 16px/20px var(--sans); outline: none; }
/* Focus: the white ring with a gap from the "States" artboard. */
.su-field input:focus-visible, .su-code input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.su-field input[aria-invalid="true"], .su-code.is-bad input { border-color: var(--su-err-line); }
.su-help { font-size: 12px; line-height: 18px; color: var(--su-dim); }
.su-error { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--su-err); }
.su-inline { min-height: 24px; color: var(--ink); font-weight: 500; text-decoration: underline 1px transparent; text-underline-offset: 3px; transition: text-decoration-color 150ms ease; }
.su-inline::after { content: ""; position: absolute; inset: -12px -6px; }
.su-inline { position: relative; }

.su-sso { display: flex; flex-direction: column; gap: 16px; }
.su-sso-top { display: flex; flex-direction: column; gap: 10px; }
.su-google { width: 100%; }
.su-or { display: flex; align-items: center; gap: 12px; font-size: 12px; line-height: 16px; color: var(--muted); }
.su-or::before, .su-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.su-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.su-group > legend { float: left; width: 100%; padding: 0; }
.su-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.su-chip { position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 15px; border-radius: 8px; background: var(--row-2); color: var(--chip-ink); font-size: 14px; line-height: 18px; font-weight: 500; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; transition: transform 150ms ease-out; }
/* The label reserves its semibold width, so choosing a chip never nudges its neighbours
   (Paper pads 16px; 15px here pays for that reserve so six regions still fit one row). */
.su-chip span { display: inline-grid; }
.su-chip span::after { content: attr(data-t); height: 0; overflow: hidden; visibility: hidden; font-weight: 600; }
.su-chip:has(input:checked) { background: var(--teal); color: var(--teal-ink); font-weight: 600; }
.su-chip:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.su-chip:active { transform: scale(0.97); }

.su-chip input, .su-role input, .su-agree input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* The terms row is one line tall; its checkbox reaches 12px above and below for a 44px target. */
.su-agree input { inset: -12px 0; height: auto; }

/* A field with something inside it: the password's show/hide button, the phone's +1. */
.su-affix { position: relative; display: flex; }
.su-field .su-affix input { padding-right: 52px; }
.su-field .su-affix.has-prefix input { padding: 0 16px 0 46px; }
.su-prefix { position: absolute; left: 16px; top: 0; display: flex; align-items: center; height: 48px; font: 500 16px/20px var(--sans); color: var(--muted); pointer-events: none; }
.su-eye { position: absolute; right: 2px; top: 2px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; color: var(--label); }
.su-eye .slash { opacity: 0; }
.su-eye[aria-pressed="true"] .slash { opacity: 1; }
.su-phone-row { display: flex; gap: 10px; }
.su-phone-row .su-affix { flex: 1; min-width: 0; }
.su-send { flex: none; }
.su-send[hidden] { display: none; }
.su-role:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.su-roles { display: flex; flex-direction: column; gap: 10px; }
.su-role { position: relative; display: flex; align-items: center; gap: 16px; padding: 17px 19px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 150ms ease-out; }
.su-role:active { transform: scale(0.99); }
.su-role-text { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.su-role-num { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.1em; color: var(--muted); }
.su-role-title { font-size: 18px; line-height: 24px; font-weight: 500; letter-spacing: -0.01em; }
.su-role-desc { font-size: 13px; line-height: 20px; color: var(--muted); }
.su-radio { flex: none; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 999px; border: 1.5px solid var(--su-dim); color: var(--app); }
.su-radio svg, .su-box svg { opacity: 0; transform: scale(0.6); transition: opacity 150ms ease-out, transform 200ms var(--ease-out); }
.su-role:has(input:checked) { background: var(--row); box-shadow: inset 0 0 0 1.5px var(--ink); }
.su-role:has(input:checked) :is(.su-role-num, .su-role-desc) { color: var(--label); }
.su-role:has(input:checked) .su-radio, .su-agree:has(input:checked) .su-box { border-color: var(--ink); background: var(--ink); }
.su-role:has(input:checked) .su-radio svg, .su-agree:has(input:checked) .su-box svg { opacity: 1; transform: none; }

.su-sent { display: flex; flex-direction: column; gap: 4px; }
.su-sent strong { font-size: 16px; line-height: 22px; font-weight: 500; overflow-wrap: anywhere; }
.su-code { display: flex; gap: 10px; }
.su-code input { flex: 1; min-width: 0; height: 60px; padding: 0; border: 1.5px solid transparent; border-radius: 8px; background: var(--row-2); color: var(--ink); font: 500 24px/30px var(--sans); font-variant-numeric: tabular-nums; text-align: center; outline: none; }

.su-agree { position: relative; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.su-agree span { flex: 1; font-size: 14px; line-height: 20px; color: var(--chip-ink); }
:is(.su-agree, .su-help) .su-inline { min-height: 0; }
.su-box { flex: none; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--su-dim); color: var(--app); }
.su-agree:has(input:focus-visible) .su-box { outline: 2px solid var(--ink); outline-offset: 2px; }
.su-agree:has(input[aria-invalid="true"]) .su-box { border-color: var(--su-err-line); }

.su-foot { display: flex; flex-direction: column; gap: 18px; }
.su-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.su-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; line-height: 18px; font-weight: 500; text-decoration: underline 1px transparent; text-underline-position: from-font; transition: text-decoration-color 150ms ease; }
/* Text links show their underline only under the pointer or keyboard focus. */
@media (hover: hover) and (pointer: fine) { .su-inline:hover, .su-link:hover { text-decoration-color: currentColor; } }
.su-inline:focus-visible, .su-link:focus-visible { text-decoration-color: currentColor; }
.su-back, .su-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line-3); font-size: 15px; line-height: 18px; font-weight: 600; transition: transform 150ms ease-out, border-color 150ms ease; }
.su-back:active { transform: scale(0.96); }
.su-google:active { transform: scale(0.99); }
.su-google svg { flex: none; }
.su-back:focus-visible, .su-google:focus-visible, .su-next:focus-visible { border-radius: 999px; }
.su-next { flex: none; gap: 10px; width: 184px; height: 48px; padding: 0; font-size: 15px; line-height: 18px; }
.su-next[data-w="open"] { width: 200px; }
@media (hover: hover) and (pointer: fine) { :is(.su-back, .su-google):hover { border-color: var(--ink); } }
.su-demo { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: var(--su-dim); }
.su-demo::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }

/* ───────── Preview pane ───────── */
.su-preview { position: relative; flex: 1; display: flex; min-width: 0; padding: 32px; background: var(--page); overflow: clip; }
.su-preview::before { content: ""; position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
.pv-photo { position: absolute; inset: 0; background: url("assets/coat.jpg") 50% / cover; filter: var(--su-photo); }
.pv-photo::after { content: ""; position: absolute; inset: 0; background: var(--su-wash); }
.pv-window { position: relative; flex: 1; display: flex; min-width: 0; border-radius: 16px; background: var(--su-glass); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: inset 0 1px 0 var(--su-glass-shine), 0 24px 60px var(--su-shadow); overflow: clip; font-size: 13px; line-height: 16px; }
.pv-window::after { border-color: var(--su-glass-line); }

.pv-side { flex: none; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; width: 196px; padding: 24px 14px 18px; background: var(--su-side); border-right: 1px solid var(--line); }
.pv-side-top { display: flex; flex-direction: column; gap: 22px; }
.pv-brand { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; }
.pv-brand .logo { width: 129px; height: 30px; }
.pv-role { font-weight: 500; color: var(--muted); }
.pv-case { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--su-card); border: 1px solid var(--line); }
.pv-case b { font-weight: 700; overflow-wrap: anywhere; }
.pv-case span { color: var(--label); }
.pv-case span + span { color: var(--muted); }
.pv-nav { display: flex; flex-direction: column; gap: 2px; }
.pv-nav span { display: flex; align-items: center; padding: 8px 10px; border-radius: 8px; font-weight: 500; color: var(--label); }
.pv-nav .is-top { justify-content: space-between; font-weight: 600; color: var(--ink); }
.pv-nav .is-on { background: var(--su-nav-on); font-weight: 600; color: var(--ink); }
.pv-nav .is-sub { gap: 10px; padding: 9px 10px 9px 22px; }
.pv-nav .is-sub i { flex: none; width: 14px; height: 11px; border-radius: 2px; background: var(--c); }
.pv-nav .is-sub b { flex: 1; font-weight: 500; }
.pv-nav small { flex: none; font-size: 13px; font-weight: 500; color: var(--su-dim); }
.pv-nav .is-sub small { width: 30px; text-align: right; }
.pv-access { display: flex; align-items: center; gap: 8px; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--muted); }

.pv-main { flex: 1; display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 28px 20px 24px; }
.pv-title { display: flex; flex-direction: column; gap: 4px; }
.pv-title h2 { font-size: 32px; line-height: 40px; font-weight: 300; letter-spacing: -0.02em; text-wrap: wrap; overflow-wrap: anywhere; }
.pv-title .su-serif { font-size: 17px; line-height: 24px; color: var(--label); }
.pv-account, .pv-company { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--su-card); border: 1px solid var(--line); }
/* Three tags do not fit beside the name, so the account's tags take their own row. */
.pv-account { flex-wrap: wrap; row-gap: 10px; }
.pv-account .pv-tags { flex-basis: 100%; flex-wrap: wrap; }
.pv-avatar { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; background: var(--ink); color: var(--page); font-size: 12px; font-weight: 700; }
.pv-avatar:empty { background: none; box-shadow: inset 0 0 0 1.5px var(--su-dash); }
.pv-who { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pv-who b { font-size: 14px; line-height: 18px; font-weight: 600; }
.pv-who span { color: var(--muted); }
.pv-who :is(b, span) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-who .is-ghost { color: var(--su-dim); font-weight: 500; }
.pv-tags { flex: none; display: flex; gap: 8px; }
.pv-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 4px; background: var(--row-2); color: var(--chip-ink); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.pv-tag.is-teal { background: var(--teal); color: var(--teal-ink); }
.pv-tag:has(svg) { padding-left: 7px; }

.pv-body { flex: 1; display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.pv-slot { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 32px; border-radius: 12px; border: 1px dashed var(--su-dash); text-align: center; }
.pv-slot b, .pv-head h3 { font-size: 15px; line-height: 18px; font-weight: 600; }
.pv-slot p { max-width: 300px; line-height: 20px; color: var(--label); }
.pv-block { display: flex; flex-direction: column; gap: 12px; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; }
.pv-head h3 { margin: 0; }
.pv-head > span, .pv-lock-line { font-weight: 500; color: var(--label); }
.pv-lock-line { display: inline-flex; align-items: center; gap: 6px; }
.pv-folders { display: flex; flex-wrap: wrap; gap: 12px 16px; width: 540px; max-width: none; }
.pv-check { gap: 10px; }
.pv-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.pv-checks li { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--chip-ink); }
.pv-checks li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--su-dim); }

.pv-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: 12px; background: var(--su-card); border: 1px solid var(--line); }
.pv-rows { display: flex; flex-direction: column; gap: 8px; }
.pv-row { display: flex; align-items: center; gap: 12px; min-height: 24px; }
.pv-row > span:first-child { flex: none; width: 72px; color: var(--su-dim); }
.pv-row > span + span { color: var(--su-dim); }
.pv-matches { display: flex; flex-direction: column; gap: 8px; }
.pv-match { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 8px; background: var(--su-row); }
.pv-match img { flex: none; width: 64px; height: 48px; border-radius: 6px; object-fit: cover; }
.pv-match > span:nth-of-type(1) { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pv-match b { font-size: 14px; line-height: 18px; font-weight: 500; }
.pv-match small { font-size: 13px; color: var(--su-dim); }
.pv-match .pv-lock-line { flex: none; justify-content: flex-end; min-width: 96px; }
.pv-note { font-size: 12px; line-height: 18px; color: var(--su-dim); }

.pv-cases { gap: 14px; padding-bottom: 18px; }
.pv-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 24px; border-radius: 8px; border: 1px dashed var(--su-dash); text-align: center; }
.pv-empty b { font-size: 14px; line-height: 18px; font-weight: 600; }
.pv-empty p { max-width: 340px; line-height: 20px; color: var(--label); }
.pv-perms { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pv-perms li { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 8px; background: var(--su-row); line-height: 18px; font-weight: 500; }
.pv-perms svg { flex: none; }
.pv-perms li > svg:not(.pv-lock-icon) { color: var(--accent); }
.pv-perms .pv-lock-icon { color: var(--label); }
.pv-perms b { flex: 1; font-weight: 500; }
.pv-perms li > span { line-height: 16px; color: var(--label); }

/* The lock: its shackle swings open once the email is verified. */
.pv-lock svg { flex: none; }
.pv-lock .shackle { transform-box: view-box; transform-origin: 8px 11px; transition: transform 350ms var(--ease-out); }
.pv-window.is-open .pv-lock .shackle { transform: translateY(-2px) scaleX(-1); }
.pv-window.is-open :is(.pv-access, .pv-lock-line, .pv-perms .pv-lock-icon, .pv-perms li > span) { color: var(--su-open); font-weight: 600; }

/* New pieces of the portal rise in, a beat apart. */
.rise { animation: su-rise 320ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.pop { animation: su-pop 260ms var(--ease-out) both; }
.fade { animation: su-fade 200ms ease-out both; }
@keyframes su-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes su-pop { from { opacity: 0; transform: scale(0.9); } }
@keyframes su-fade { from { opacity: 0; } }

/* ───────── Below 1000px: the preview becomes a compact summary under the form ───────── */
@media (max-width: 999px) {
  .su { padding: 12px; }
  .su-panel { flex-direction: column; min-height: 0; }
  .su-form { width: auto; gap: 40px; padding: 24px 24px 28px; }
  .su-top { gap: 40px; }
  .su-preview { flex: none; padding: 16px; }
  .su-preview::before { inset: 0 0 auto; width: auto; height: 1px; }
  .pv-window { flex-direction: column; }
  .pv-side { flex-direction: row; align-items: center; flex-wrap: wrap; width: auto; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pv-side-top { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
  .pv-brand { padding: 0; }
  .pv-brand .logo, .pv-nav { display: none; }
  .pv-case { flex-direction: row; flex-wrap: wrap; gap: 3px 8px; padding: 8px 12px; }
  .pv-access { padding: 0; border-top: 0; }
  .pv-main { padding: 20px 16px; }
  .pv-slot { padding: 24px 16px; }
}
@media (max-width: 639px) {
  .su-form { padding: 20px 20px 24px; }
  .su-title h1 { font-size: 32px; line-height: 38px; }
  .su-actions { flex-wrap: wrap; }
  .su-next, .su-next[data-w] { flex: 1; width: auto; min-width: 184px; }
  .su-code { gap: 6px; }
  .pv-title h2 { font-size: 26px; line-height: 32px; }
  .pv-company { flex-wrap: wrap; }
  .pv-company .pv-tags { flex-wrap: wrap; }
  .su-phone-row { flex-wrap: wrap; }
  .pv-head { flex-wrap: wrap; }
  .pv-folders { zoom: 0.78; }
  .pv-match { flex-wrap: wrap; gap: 8px 12px; }
  .pv-match .pv-lock-line { min-width: 0; }
  .pv-perms li { flex-wrap: wrap; }
}
@media (max-width: 509px) { .pv-folders { zoom: 0.62; } }
@media (max-width: 423px) { .pv-folders { zoom: 0.5; } }
@media (max-width: 359px) { .pv-folders { zoom: 0.42; } }
