/* Breaking Borders Legal intake: calm, roomy, one step at a time. Her navy, gold and paper. */
:root {
  color-scheme: light;
  --paper: #FFFCF5;
  --cream: #FFF5D9;
  --cream-line: #F0DFAF;
  --card: #FFFFFF;
  --ink: #1B2233;
  --navy: #182241;
  --navy-2: #233261;
  --muted: #4B5165;
  --line: #E7DDC3;
  --line-strong: #D6C9A6;
  --gold: #C39A3E;
  --gold-ink: #7E6020;
  --ok: #1F6F4A;
  --danger: #9B2C2C;
  --focus: rgba(195, 154, 62, 0.55);
  --radius: 14px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 252, 245, 0.94);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-in {
  max-width: 720px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 34px; height: 34px; flex: none; }
.brand strong { display: block; font: 600 17px/1.2 var(--serif); color: var(--navy); white-space: nowrap; }
.brand span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 12px; flex: none; }
.save { font-size: 13px; color: var(--muted); white-space: nowrap; }
.save.ok::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.lang { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 6px 11px; font-weight: 800; font-size: 13px; letter-spacing: .04em; color: var(--muted); min-height: 34px; }
.lang button[aria-pressed="true"] { background: var(--navy); color: var(--cream); }
.bar { height: 4px; background: #F1E8D2; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; transition: width .35s ease; }

/* ---------- page ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 28px 20px 140px; }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
h1.title { margin: 0; font: 500 34px/1.15 var(--serif); color: var(--navy); letter-spacing: -.01em; }
h1.title:focus { outline: none; }
.lead { margin: 10px 0 0; font-size: 17px; color: var(--muted); }
.notice { margin: 20px 0 0; padding: 12px 16px; border-radius: 12px; background: #EEF4EF; border: 1px solid #CFE2D5; color: #1D4B35; font-size: 15px; }

/* ---------- welcome ---------- */
.welcome { text-align: center; padding-top: 18px; }
.welcome .crest { width: 88px; height: 88px; }
.welcome h1.title { margin-top: 18px; font-size: 38px; }
.welcome .lead { max-width: 540px; margin: 14px auto 0; font-size: 18px; }
.points { list-style: none; padding: 0; margin: 26px auto 0; max-width: 460px; text-align: left; display: grid; gap: 12px; }
.points li { position: relative; padding-left: 26px; font-size: 16.5px; }
.points li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.privacy { max-width: 460px; margin: 26px auto 0; padding: 12px 16px; background: var(--cream); border: 1px solid var(--cream-line); border-radius: 12px; font-size: 14.5px; text-align: left; }
.welcome .actions { margin-top: 28px; display: grid; gap: 12px; justify-items: center; }
.welcome .actions .btn.primary { margin: 0; flex: none; max-width: none; }
.switch-lang { background: none; border: 0; color: var(--gold-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.byline { margin-top: 40px; font-size: 13px; color: var(--muted); }

/* ---------- questions ---------- */
.qs { margin-top: 26px; }
.q { margin: 0; padding: 24px 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.q:first-child { border-top: 0; padding-top: 6px; }
.q > legend, .q > label.qlabel { display: block; padding: 0; margin: 0 0 4px; font-weight: 800; font-size: 17.5px; line-height: 1.35; color: var(--ink); }
.q > legend { float: left; width: 100%; }
.q > legend + * { clear: both; }
.help { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.hint { margin: 0 0 12px; font-size: 14px; color: var(--muted); transition: color .2s; }
.hint.flash { color: var(--danger); font-weight: 700; }
.q > legend + .opts, .q > legend + .grid, .q > legend + .rows, .q > legend + .matrix { margin-top: 12px; }

.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opts.stack { flex-direction: column; align-items: stretch; }
.opt {
  min-height: 48px; padding: 10px 18px;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-size: 16px; line-height: 1.3; text-align: left;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background .15s, border-color .15s, color .15s;
}
.opts.stack .opt { border-radius: 12px; width: 100%; padding: 12px 16px; }
.opt::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: #fff;
}
.opt[role="checkbox"]::before { border-radius: 5px; }
.opt:hover { border-color: var(--gold); }
.opt[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.opt[aria-checked="true"]::before {
  border-color: var(--cream); background: var(--cream);
  box-shadow: inset 0 0 0 3.5px var(--navy);
}
.opt[role="checkbox"][aria-checked="true"]::before {
  box-shadow: none;
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23182241' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}

input.field, textarea.field, select.field {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 12px;
  background: var(--card); font-size: 16px; color: var(--ink);
}
textarea.field { min-height: 110px; resize: vertical; line-height: 1.5; }
input.field:focus, textarea.field:focus, select.field:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(195, 154, 62, .22); }
::placeholder { color: #8B8F9C; }
.other { margin-top: 10px; }

/* team rows */
.rows { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1.2fr 1fr 1.3fr auto; gap: 8px; align-items: center; }
.row .del { width: 44px; height: 50px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--card); color: var(--muted); font-size: 20px; line-height: 1; }
.add { margin-top: 12px; }

/* availability grid */
.grid { display: grid; grid-template-columns: 58px repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; max-width: 520px; }
.grid .gh { font-size: 13.5px; font-weight: 800; color: var(--muted); text-align: center; }
.grid .gd { font-weight: 800; font-size: 15px; color: var(--ink); }
.cell {
  height: 46px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card);
  color: transparent; font-weight: 800; font-size: 18px;
}
.cell[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: var(--cream); }

/* accounts matrix */
.matrix { display: grid; gap: 14px; }
.mrow { display: grid; gap: 8px; }
.mlabel { font-size: 16px; font-weight: 700; }
.mrow .opt { padding: 8px 16px; min-height: 44px; font-size: 15px; }

.info {
  margin: 0; padding: 16px 18px; border-radius: var(--radius);
  background: var(--cream); border: 1px solid var(--cream-line);
  font-size: 16px; line-height: 1.6; color: var(--ink);
}
.q.info-wrap { border-top: 0; padding-bottom: 4px; }

.later-row { margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; }
.link { background: none; border: 0; padding: 8px 4px; color: var(--gold-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; font-size: 15.5px; }

/* ---------- review ---------- */
.rv { margin-top: 22px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.rv-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rv h2 { margin: 0; font: 600 21px/1.25 var(--serif); color: var(--navy); }
.rv dl { margin: 12px 0 0; display: grid; gap: 10px; }
.rv dt { font-size: 14px; color: var(--muted); }
.rv dd { margin: 2px 0 0; font-size: 16px; white-space: pre-line; }
.rv .empty { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.check { display: flex; gap: 12px; align-items: center; margin-top: 24px; font-size: 16px; font-weight: 700; }
.check input { width: 22px; height: 22px; accent-color: var(--navy); flex: none; }
.error { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: #FBEDEC; border: 1px solid #EFC9C5; color: var(--danger); font-size: 15px; }

/* ---------- done ---------- */
.done { text-align: center; padding-top: 30px; }
.done .tick { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--cream); font-size: 36px; }
.done h1.title { margin-top: 22px; }
.done .lead { max-width: 520px; margin-left: auto; margin-right: auto; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 28px auto 0; max-width: 460px; text-align: left; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; font-size: 16.5px; min-height: 30px; padding-top: 3px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--cream); border: 1px solid var(--cream-line); color: var(--gold-ink); font-weight: 800; display: grid; place-items: center; font-size: 15px; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(255, 252, 245, 0.96);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-in { max-width: 720px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 12px; justify-content: space-between; }
.btn {
  min-height: 52px; padding: 0 24px; border-radius: 12px; border: 0;
  font-weight: 800; font-size: 16.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary { background: var(--navy); color: var(--cream); flex: 1 1 auto; max-width: 320px; margin-left: auto; }
.btn.primary:hover { background: var(--navy-2); }
.btn.primary[disabled] { opacity: .6; cursor: default; }
.btn.ghost { background: var(--card); color: var(--navy); border: 1.5px solid var(--line-strong); }
.btn.big { min-width: 220px; min-height: 56px; font-size: 17.5px; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(24, 34, 65, .45); display: grid; place-items: center; padding: 20px; }
.modal-card { width: 100%; max-width: 460px; background: var(--paper); border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-card h2 { margin: 0; font: 600 26px/1.2 var(--serif); color: var(--navy); }
.modal-card p { margin: 10px 0 0; color: var(--muted); }
.copybox { margin-top: 14px; display: flex; gap: 8px; }
.copybox input { flex: 1; min-width: 0; }
.modal-card .btn.ghost { margin-top: 16px; width: 100%; }

/* ---------- small screens ---------- */
@media (max-width: 560px) {
  h1.title { font-size: 29px; }
  .welcome h1.title { font-size: 31px; }
  .brand span { display: none; }
  .save { display: none; }
  .row { grid-template-columns: 1fr auto; }
  .row .role, .row .email { grid-column: 1 / 2; }
  .row .del { grid-row: 1; grid-column: 2; }
  .btn { padding: 0 18px; }
  .btn.primary { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
