/* Shared engagement-flow styles. Each brand sets its own variables; the
   interaction pattern (left progress tracker, one step at a time) is shared. */

:root, [data-brand] {
  --bg: #F5F6F8; --surface: #FFFFFF; --ink: #1B1D24; --muted: #545A66; --line: #D9DDE4;
  --accent: #1D3A5F; --accent-ink: #FFFFFF; --accent-soft: #E3ECF8; --accent-line: #8FB0DA;
  --done: #227A5A; --warn-bg: #FFF4E0; --warn-ink: #6B4500; --err: #B3261E; --err-bg: #FDECEA;
  --header-bg: #0B1B2E; --header-ink: #F2EBDD; --header-accent: #C9A96E;
  --display: system-ui, sans-serif; --body: system-ui, sans-serif;
  --radius: 10px; --btn-radius: 8px;
}
[data-brand="brand1x"] {
  --bg: #FBF8F1; --surface: #FFFFFF; --ink: #23182C; --muted: #5E5368; --line: #E6DCC6;
  --accent: #3D1556; --accent-soft: #F1E9F6; --accent-line: #A98BC0;
  --header-bg: #3D1556; --header-ink: #FBF8F1; --header-accent: #D4A93C;
  --display: 'Cormorant Garamond', Georgia, serif; --body: 'Libre Franklin', system-ui, sans-serif;
  --radius: 4px; --btn-radius: 2px;
}
[data-brand="warlock"] {
  --bg: #F3F5F8; --surface: #FFFFFF; --ink: #121C2B; --muted: #4D5A6B; --line: #D5DCE5;
  --accent: #173A63; --accent-soft: #E1ECF9; --accent-line: #7FA6D6;
  --header-bg: #0A1A2E; --header-ink: #F2EBDD; --header-accent: #C9A96E;
  --display: 'Josefin Sans', system-ui, sans-serif; --body: 'Karla', system-ui, sans-serif;
  --radius: 10px; --btn-radius: 4px;
}
[data-brand="brand2x"] {
  --bg: #F6F3FF; --surface: #FFFFFF; --ink: #1A1033; --muted: #4B4366; --line: #E2DAF5;
  --accent: #5B21B6; --accent-soft: #EFE7FF; --accent-line: #A78BFA;
  --header-bg: #1A1033; --header-ink: #FFFFFF; --header-accent: #FACC15;
  --display: 'Space Grotesk', system-ui, sans-serif; --body: 'IBM Plex Sans', system-ui, sans-serif;
  --radius: 16px; --btn-radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }

/* header */
.fl-header { background: var(--header-bg); color: var(--header-ink); }
.fl-header-in { max-width: 1180px; margin: 0 auto; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.fl-title { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase; display: flex; gap: 14px; align-items: center; }
.fl-title .sep { color: var(--header-accent); }
.fl-header a { color: var(--header-ink); font-size: 14px; }
.fl-header nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* layout */
.fl-main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.fl-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fl-content { padding: clamp(22px, 4vw, 40px); min-height: 420px; }

/* tracker */
.tracker { padding: 22px 18px; }
.tracker h2 { font-family: var(--body); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px 8px; }
.tracker ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tstep { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 8px; border: 1px solid transparent; color: var(--muted); width: 100%; background: none; font: inherit; text-align: left; }
button.tstep { cursor: pointer; }
button.tstep:hover { background: var(--accent-soft); }
.tstep .ic { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 2px solid #A4ADBB; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.tstep .lbl { display: flex; flex-direction: column; }
.tstep .name { font-size: 16px; }
.tstep .sub { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tstep.done { color: var(--ink); }
.tstep.done .ic { background: var(--done); border-color: var(--done); color: #fff; }
.tstep.current { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
.tstep.current .name { font-weight: 700; }
.tstep.current .ic { border-color: var(--accent); }
.tstep.current .ic::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tstep.upcoming { opacity: 0.75; }
.tstep.declined .ic { background: var(--err); border-color: var(--err); color: #fff; }

.tracker-mobile { display: none; }
.tracker-mobile summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.tracker-mobile summary::-webkit-details-marker { display: none; }
.tracker-mobile .tm-now { font-weight: 700; }
.tracker-mobile .tm-next { font-size: 13px; color: var(--muted); }
.tracker-mobile .tm-toggle { font-size: 13px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.tracker-mobile[open] .tm-toggle::after { content: ' ▲'; }
.tracker-mobile:not([open]) .tm-toggle::after { content: ' ▼'; }
.tracker-mobile ol { list-style: none; margin: 0; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.bar { height: 4px; background: var(--line); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* fee summary */
.fees { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.fees h2 { font-family: var(--body); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.fees .row { display: flex; justify-content: space-between; gap: 12px; }
.fees .total { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); padding-top: 10px; }
.fees .uspto { color: var(--muted); font-size: 13px; }
.nopay { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 600; color: var(--done); }
.fees-mobile { display: none; }

/* step content */
.step-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.step-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.step-head h1 { font-size: clamp(28px, 4vw, 38px); }
.step-head p { color: var(--muted); max-width: 46em; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label, .field .label { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field textarea {
  font: inherit; padding: 12px 14px; border: 1.5px solid #C3CAD6; border-radius: calc(var(--btn-radius) + 2px); background: #fff; color: var(--ink); width: 100%;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.field .err { color: var(--err); font-size: 13px; font-weight: 600; }
.why { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 22px; }
.why strong { font-size: 14px; }
.mark-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 2px; margin-bottom: 16px; }
.mark-group h3 { font-family: var(--body); font-size: 15px; margin-bottom: 12px; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.choice { position: relative; border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.choice .c-name { font-family: var(--display); font-weight: 700; font-size: 21px; }
.choice .c-price { font-weight: 700; font-size: 22px; }
.choice .c-price small { font-size: 13px; font-weight: 400; color: var(--muted); }
.choice ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.choice .badge { align-self: flex-start; background: var(--header-accent); color: #1a1a1a; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-width: 56px; min-height: 46px; padding: 0 16px; border: 2px solid var(--line); border-radius: var(--btn-radius); font-weight: 700; background: #fff; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.addon { border: 1px dashed var(--accent-line); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.addon input { width: 20px; height: 20px; margin-top: 3px; flex: 0 0 auto; }
.stepper { align-self: flex-start; display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--btn-radius); overflow: hidden; }
.stepper button { width: 46px; height: 46px; border: 0; background: #fff; font-size: 20px; cursor: pointer; color: var(--accent); }
.stepper output { min-width: 44px; text-align: center; font-weight: 700; }
.inline-note { font-size: 14px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.btn { font: inherit; font-weight: 700; border-radius: var(--btn-radius); padding: 0 22px; min-height: 48px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.link { background: none; border: 0; color: var(--accent); padding: 0 4px; text-decoration: underline; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.danger { background: var(--err); border-color: var(--err); }

.notice { border-radius: var(--radius); padding: 12px 16px; font-size: 14px; margin-bottom: 18px; }
.notice.error { background: var(--err-bg); color: var(--err); font-weight: 600; }
.notice.info { background: var(--accent-soft); }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice.ok { background: #E6F4EE; color: #155C42; font-weight: 600; }

.verify { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.verify .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.verify input { font: inherit; font-size: 20px; letter-spacing: 0.3em; width: 170px; padding: 10px 12px; border: 1.5px solid #C3CAD6; border-radius: var(--btn-radius); }
.verified { color: var(--done); font-weight: 700; }

.summary-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-list > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.summary-list strong { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.agreement-box { border: 1px solid var(--line); border-radius: var(--radius); max-height: 480px; overflow: auto; padding: 22px 24px; background: #FCFCFD; font-size: 14.5px; }
.agreement h2 { font-family: var(--body); font-size: 20px; }
.agreement h3 { font-family: var(--body); font-size: 15.5px; margin: 18px 0 6px; }
.agreement p { margin: 0 0 8px; }
.agreement .ag-sub { color: var(--muted); }
.agreement .ag-meta { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.agreement mark { background: #FFE7A3; padding: 0 2px; }
.ag-table { overflow-x: auto; margin: 6px 0 10px; }
.agreement table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.agreement th, .agreement td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.agreement tr.foot td { font-weight: 700; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; font-size: 15px; }
.check input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }
.fingerprint { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; color: var(--muted); }

.sigtabs { display: flex; gap: 6px; margin-bottom: 12px; }
.sigtabs button { font: inherit; font-weight: 700; padding: 10px 18px; min-height: 44px; border: 2px solid var(--line); border-radius: var(--btn-radius); background: #fff; cursor: pointer; color: var(--ink); }
.sigtabs button[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); }
.sigpreview { font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: 36px; color: #1a1f4a; border-bottom: 2px solid var(--ink); min-height: 64px; padding: 6px 4px; margin-bottom: 8px; }
.sigpad { width: 100%; max-width: 560px; height: 170px; border: 1.5px dashed #9AA3B2; border-radius: var(--btn-radius); background: #fff; touch-action: none; display: block; }

.pending { border: 2px solid #B86B00; border-left-width: 8px; background: #FFF3D1; color: #3A2400; border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; margin: 0 0 18px; font-size: 15px; }
.pending strong { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: #8A4B00; }
.accepted { border: 2px solid #1F7A55; border-left-width: 8px; background: #E3F3EB; color: #0E3B28; border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; margin: 0 0 18px; font-size: 15px; }
.accepted strong { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: #155C42; }
.status-list { list-style: none; margin: 18px 0 24px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-width: 560px; }

/* responsive */
@media (max-width: 860px) {
  .fl-main { grid-template-columns: minmax(0, 1fr); padding-top: 16px; gap: 14px; }
  .fl-side { position: static; }
  .fl-side .tracker, .fl-side .fees { display: none; }
  .tracker-mobile { display: block; }
  .fees-mobile { display: flex; margin-top: 22px; }
  .fl-title { font-size: 14px; letter-spacing: 0.04em; gap: 8px; flex-wrap: wrap; }
  .fl-header nav { gap: 6px 14px; }
}
@media (min-width: 861px) { .fl-side:empty { display: none; } }

/* Multi-trademark step */
.role-chip { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; font-family: var(--body); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; vertical-align: middle; background: var(--accent-soft); color: var(--accent); }
.role-chip.role-alternative { background: #FFF1C2; color: #6B4500; }
.role-chip.role-separate { background: #E3F3EB; color: #155C42; }
.add-mark { width: 100%; border-style: dashed; min-height: 56px; font-size: 16px; }
.add-panel { border: 2px solid var(--accent); }
.add-panel .seg { flex-direction: column; align-items: stretch; }
.opt { font: inherit; font-weight: 700; text-align: left; padding: 12px 16px; min-height: 48px; border: 2px solid var(--line); border-radius: var(--btn-radius); background: #fff; color: var(--ink); cursor: pointer; }
.opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.opt small { font-weight: 400; color: var(--muted); }
.mark-group .seg span { text-align: center; }

/* Classes and the optional class estimator (step 2) */
.classes { border: 1px dashed var(--accent-line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; background: color-mix(in srgb, var(--accent-soft) 45%, #fff); }
.cls-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cls-row .label { font-weight: 700; }
.cls-n { min-width: 40px; text-align: center; font-weight: 700; font-size: 17px; }
.stepper button[disabled] { opacity: 0.4; cursor: default; }
.cls-src { font-size: 13px; color: var(--muted); }
.est-btn { min-height: 44px; }
.est { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.est p { margin: 0; }
.est-notice { font-size: 13px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border-radius: 6px; padding: 6px 10px; }
.est-stale { font-size: 14px; color: var(--err); }
.est-classes, .est-unc { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.est-classes span { font-size: 14px; color: var(--muted); }
.est-unc { font-size: 14px; color: var(--muted); }
.est-src { font-size: 12px; color: var(--muted); }
.fees small.cls { font-size: 12px; color: var(--muted); font-weight: 400; }
/* Attorney class review */
.cr-item { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cr-item h4 { margin: 0; font-size: 16px; }
.cr-item .inert { white-space: pre-wrap; word-break: break-word; }
.cr-inputs { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.cr-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.cr-preview { font-size: 14px; font-weight: 600; color: var(--accent); margin: 0; }
.est-box { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.est-box ul { margin: 6px 0; padding-left: 18px; }

/* Logo upload (design mark applications) */
.logo-up .err { color: var(--err); font-size: 13px; font-weight: 600; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; }
.logo-up input[type=file] { max-width: 100%; font-size: 14px; }
