/* J. Brantley Law — client portal
   ------------------------------------------------------------------ */

:root {
  --ink: #16263c;
  --ink-soft: #47586e;
  --ink-faint: #7b8798;
  --gold: #9d7a37;
  --gold-soft: #f3ecdd;
  --paper: #faf9f6;
  --card: #ffffff;
  --line: #e2ddd3;
  --line-strong: #cec7b8;
  --danger: #a4382f;
  --danger-bg: #fdf1ef;
  --ok: #2c6b4f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 38, 60, 0.05), 0 8px 24px -12px rgba(22, 38, 60, 0.16);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 .4em; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin: 0 0 .5em; }
h3 { font-size: 1.05rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--gold); }

.wrap { max-width: 780px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------- masthead ---------- */
.masthead {
  background: var(--ink);
  color: #fff;
  padding: 22px 0;
  border-bottom: 3px solid var(--gold);
}
.masthead .wrap-wide, .masthead .wrap { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.masthead-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; letter-spacing: .01em; }
.masthead-tag {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--gold-soft); opacity: .85;
}
.masthead a { color: #fff; text-decoration: none; }

/* ---------- landing ---------- */
.hero { padding: 56px 0 8px; }
.hero p.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 60ch; }

.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
  padding: 24px 0 56px;
}
.area-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.area-card:hover, .area-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 2px 4px rgba(22,38,60,.06), 0 16px 32px -16px rgba(22,38,60,.28);
}
.area-card .glyph {
  font-family: var(--serif);
  font-size: 1.5rem; color: var(--gold);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold-soft);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.area-card h3 { margin-bottom: .3em; }
.area-card p { color: var(--ink-soft); font-size: .93rem; margin: 0 0 16px; flex: 1; }
.area-card .go { font-size: .85rem; font-weight: 600; color: var(--gold); letter-spacing: .02em; }

.consult-note {
  border-top: 1px solid var(--line); padding: 26px 0 4px;
}
.consult-note h3 { margin: 0 0 .4em; }
.consult-note p { color: var(--ink-soft); font-size: .93rem; max-width: 72ch; margin: 0; }

.steps-explainer {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px; padding: 28px 0 60px; border-top: 1px solid var(--line);
}
.steps-explainer .n {
  font-family: var(--serif); color: var(--gold); font-size: 1.2rem; font-weight: 600;
}
.steps-explainer h4 { margin: .2em 0 .3em; }
.steps-explainer p { font-size: .9rem; color: var(--ink-soft); margin: 0; }

/* ---------- progress ---------- */
.progress { padding: 26px 0 0; }
.progress ol { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; }
.progress li {
  flex: 1; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); padding-top: 9px; border-top: 3px solid var(--line);
  transition: color .2s, border-color .2s;
}
.progress li.done { color: var(--ink-soft); border-top-color: var(--gold); }
.progress li.current { color: var(--ink); font-weight: 600; border-top-color: var(--gold); }
@media (max-width: 620px) {
  .progress li { font-size: 0; padding-top: 6px; }
  .progress li.current { font-size: .76rem; }
}

/* ---------- panels ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  margin: 22px 0 40px;
}
@media (max-width: 560px) { .panel { padding: 22px 18px; } }
.panel > .intro { color: var(--ink-soft); max-width: 62ch; }
.eyebrow {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--gold); font-weight: 600; margin-bottom: 8px;
}

/* ---------- fields ---------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 26px; }
.field { grid-column: span 2; }
.field.half { grid-column: span 1; }
@media (max-width: 560px) { .field.half { grid-column: span 2; } }

.field > label, .field > .label {
  display: block; font-weight: 600; font-size: .93rem; margin-bottom: 5px;
}
.field .req { color: var(--gold); margin-left: 2px; }
.field .help { font-size: .84rem; color: var(--ink-faint); margin: 0 0 8px; line-height: 1.5; }
.field .label + .help { margin-top: -2px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="number"], select, textarea {
  width: 100%; font: inherit; font-size: .97rem; color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 11px 12px;
  transition: border-color .14s, box-shadow .14s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(157, 122, 55, .16);
}
.field.invalid input, .field.invalid select, .field.invalid textarea,
.field.invalid .choice-list { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .84rem; margin-top: 6px; display: none; }
.field.invalid .field-error { display: block; }

/* radio / checkbox as tappable rows */
.choice-list { display: grid; gap: 8px; border: 1px solid transparent; border-radius: 7px; }
.choice {
  display: flex; align-items: flex-start; gap: 11px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 11px 13px; cursor: pointer; background: #fff;
  transition: border-color .12s, background .12s;
  font-size: .95rem;
}
.choice:hover { border-color: var(--gold); }
.choice input { margin: 3px 0 0; accent-color: var(--gold); flex: none; width: 17px; height: 17px; }
.choice.checked { border-color: var(--gold); background: var(--gold-soft); }

/* ---------- buttons ---------- */
.actions { display: flex; gap: 12px; align-items: center; margin-top: 30px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.btn {
  font: inherit; font-weight: 600; font-size: .97rem;
  border-radius: 7px; padding: 12px 24px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; display: inline-block;
  transition: background .14s, border-color .14s, opacity .14s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #21374f; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover:not(:disabled) { background: #b08c46; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 15px 32px; font-size: 1.03rem; }

/* ---------- the letter ---------- */
.letter-scroll {
  max-height: 62vh; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; padding: 34px 38px; margin-top: 22px;
}
@media (max-width: 560px) { .letter-scroll { padding: 22px 18px; max-height: 56vh; } }
.letter { font-family: var(--serif); font-size: 1rem; line-height: 1.68; color: #1d2b3d; }
.letter .lt-firm { text-align: center; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 24px; }
.letter .lt-firm .nm { font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; }
.letter .lt-firm .meta { font-family: var(--sans); font-size: .78rem; color: var(--ink-faint); letter-spacing: .04em; margin-top: 4px; }
.letter .lt-date { margin-bottom: 18px; }
.letter .lt-to { margin-bottom: 18px; white-space: pre-line; }
.letter .lt-re { font-weight: 600; margin-bottom: 18px; }
.letter h4 { font-size: 1rem; margin: 26px 0 8px; }
.letter p { margin: 0 0 13px; text-align: left; }
.letter ul { margin: 0 0 13px; padding-left: 22px; }
.letter li { margin-bottom: 6px; }
.letter .lt-close { margin-top: 30px; }

/* checkboxes the client ticks inside the letter */
.letter-check {
  display: flex; gap: 11px; align-items: flex-start;
  margin: 0 0 11px; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; cursor: pointer;
  font-family: var(--sans); font-size: .93rem; line-height: 1.55;
  transition: border-color .12s, background .12s;
}
.letter-check:hover { border-color: var(--gold); }
.letter-check input { margin: 3px 0 0; accent-color: var(--gold); flex: none; width: 17px; height: 17px; }
.letter-check:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.letter-check.required { border-left: 4px solid var(--gold); }
.letter-check.unticked { border-color: var(--danger); background: var(--danger-bg); }
.letter-check .req-mark { color: var(--gold); font-weight: 700; }

.scroll-nudge {
  font-size: .85rem; color: var(--ink-faint); text-align: center;
  margin-top: 10px; transition: opacity .2s;
}
.scroll-nudge.hidden { opacity: 0; visibility: hidden; }

/* ---------- signature ---------- */
.sign-block { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 26px; transition: opacity .25s; }
.sign-block.locked { opacity: .4; pointer-events: none; user-select: none; }
.sig-wrap {
  position: relative; margin-top: 8px;
  border: 2px dashed var(--line-strong); border-radius: 8px; background: #fff;
  touch-action: none;
}
.sig-wrap.signed { border-style: solid; border-color: var(--gold); }
.sig-wrap.invalid { border-color: var(--danger); }
#sigCanvas { display: block; width: 100%; height: 190px; border-radius: 6px; cursor: crosshair; touch-action: none; }
.sig-baseline {
  position: absolute; left: 26px; right: 26px; bottom: 46px;
  border-bottom: 1px solid var(--line-strong); pointer-events: none;
}
.sig-hint {
  position: absolute; left: 30px; bottom: 20px; font-size: .84rem;
  color: var(--ink-faint); pointer-events: none; transition: opacity .2s;
}
.sig-wrap.signed .sig-hint, .sig-wrap.signed .sig-baseline { opacity: 0; }
.sig-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; gap: 12px; }
.link-btn {
  background: none; border: none; padding: 0; font: inherit; font-size: .88rem;
  color: var(--gold); cursor: pointer; text-decoration: underline;
}
.consent {
  background: var(--gold-soft); border-radius: 8px; padding: 15px 17px;
  margin-top: 22px; font-size: .89rem; line-height: 1.55;
}
.consent .choice { background: transparent; border: none; padding: 0; align-items: flex-start; }
.consent .choice:hover { border: none; }

/* ---------- alerts ---------- */
.alert { border-radius: 8px; padding: 14px 16px; font-size: .92rem; margin-top: 20px; }
.alert-error { background: var(--danger-bg); border: 1px solid #e8c2bc; color: var(--danger); }
.alert-decline {
  background: var(--danger-bg); border: 1px solid #e8c2bc; color: var(--ink);
  padding: 20px 22px;
}
.alert-decline h3 { margin: 0 0 .4em; color: var(--danger); }
.alert-decline p { margin: 0 0 .8em; color: var(--ink-soft); line-height: 1.6; }
.decline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 0 !important; }

.alert-info { background: #eef3f8; border: 1px solid #d2e0ee; color: var(--ink-soft); }

/* ---------- success / payment ---------- */
.done-mark {
  width: 58px; height: 58px; border-radius: 50%; background: var(--gold-soft);
  color: var(--gold); display: grid; place-items: center; font-size: 1.7rem;
  margin-bottom: 18px;
}
.next-list { list-style: none; margin: 24px 0 0; padding: 0; }
.next-list li {
  display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line);
}
.next-list .n {
  font-family: var(--serif); color: var(--gold); font-weight: 600; flex: none;
  width: 27px; height: 27px; border-radius: 50%; background: var(--gold-soft);
  display: grid; place-items: center; font-size: .9rem;
}
.next-list h4 { margin: 0 0 3px; }
.next-list p { margin: 0; font-size: .91rem; color: var(--ink-soft); }
.pay-box {
  border: 1px solid var(--gold); background: var(--gold-soft);
  border-radius: var(--radius); padding: 24px; margin-top: 26px;
}
.pay-box h3 { margin-top: 0; }
.pay-box p { font-size: .93rem; color: var(--ink-soft); }

.pay-single-label {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
  color: var(--ink) !important; margin-bottom: .5em;
}

/* several fees for one practice area */
.pay-options { display: grid; gap: 9px; margin: 18px 0 4px; }
.pay-option {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 13px 15px;
}
.pay-option.suggested { border-color: var(--gold); border-width: 2px; padding: 12px 14px; }
.pay-option-text { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 2px; }
.pay-option-label { font-weight: 600; font-size: .95rem; color: var(--ink); }
.pay-option-note { font-size: .84rem; color: var(--ink-faint); }
.pay-option-flag {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--gold); font-weight: 600; margin-top: 3px;
}
.pay-option-amount {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.pay-option .btn { padding: 9px 20px; font-size: .92rem; }
@media (max-width: 480px) {
  .pay-option { align-items: stretch; }
  .pay-option .btn { width: 100%; text-align: center; }
}

.military-note {
  background: #fff; border: 1px solid var(--line-strong);
  border-left: 4px solid var(--ink);
  border-radius: 8px; padding: 15px 18px; margin: 0 0 20px;
}
.military-note h4 { margin: 0 0 .35em; font-size: 1rem; }
.military-note p { margin: 0; font-size: .9rem; line-height: 1.6; color: var(--ink-soft) !important; }

.copy-note { margin: 12px 2px 0; }
.copy-note strong { color: var(--ink); }

.plan-box { margin-top: 18px; }
.plan-prompt {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
  font-size: .91rem; color: var(--ink-soft);
}
.plan-form {
  margin-top: 14px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.plan-form label { display: block; font-weight: 600; font-size: .9rem; margin: 6px 0 6px; }
.plan-form textarea { min-height: 74px; }
.plan-form .btn { margin-top: 12px; }
.plan-status { font-size: .89rem; margin: 14px 0 0; }
.plan-status.ok { color: var(--ok); }
.plan-status.err { color: var(--danger); }

/* ---------- misc ---------- */
.spinner {
  width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; display: inline-block;
  vertical-align: -3px; margin-right: 9px; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 44px;
  font-size: .83rem; color: var(--ink-faint);
}
.site-footer p { margin: 0 0 .5em; max-width: 70ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
