/* NTD eligibility chat.
   Type and target sizes are set for an audience that skews 65 and over: 18px
   base, 1.6 line height, 48px minimum tap targets, and contrast well past AA.
   Brand colours from nationaltaxdebt.com: orange #FF5C00, navy #080C5A. */

:root {
  --navy: #080c5a;
  --orange: #ff5c00;
  --ink: #1a1a2e;
  --muted: #5a5a72;
  --line: #d8d8e4;
  --bg: #f7f7fb;
  --panel: #ffffff;
  --bot: #eef1fa;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--navy); color: #fff; padding: 12px 18px;
}
.skip:focus { left: 12px; top: 12px; z-index: 10; }

.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;
}

/* ------------------------------------------------------------- masthead */

.masthead { background: var(--navy); color: #fff; padding: 14px 0; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-weight: 700; letter-spacing: .2px; }
.phone { color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }
.phone:hover, .phone:focus { text-decoration: underline; }

/* ---------------------------------------------------------------- intro */

h1 { font-size: 30px; line-height: 1.25; margin: 32px 0 12px; color: var(--navy); }
.lede { font-size: 19px; margin: 0 0 20px; }

.reassure {
  list-style: none; margin: 0 0 28px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  font-size: 16px; color: var(--muted);
}
.reassure li::before { content: "✓"; color: var(--orange); font-weight: 700; margin-right: 8px; }

/* ----------------------------------------------------------------- chat */

.chat { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

.msg { max-width: 92%; padding: 14px 18px; border-radius: var(--radius); }
.msg.bot { background: var(--bot); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me {
  background: var(--navy); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end;
}
.msg p { margin: 0 0 10px; }
.msg p:last-child { margin-bottom: 0; }

/* Three dots while the model is thinking. Reduced-motion users get a static
   label instead, since a pulsing dot is the kind of thing that triggers. */
.typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.typing i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--muted);
  animation: blink 1.3s infinite both;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  .typing i { animation: none; opacity: .5; }
}

/* ------------------------------------------------------------- composer */

.composer { margin-bottom: 28px; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.choices button {
  min-height: 52px; padding: 12px 20px;
  background: var(--panel); color: var(--navy);
  border: 2px solid var(--line); border-radius: var(--radius);
  font: inherit; font-weight: 600; cursor: pointer;
}
.choices button:hover { border-color: var(--orange); }
.choices button[aria-pressed="true"] { border-color: var(--orange); background: #fff4ed; }
.choices button.done { min-width: 100%; background: var(--orange); color: #fff; border-color: var(--orange); }

.entry { display: flex; gap: 10px; align-items: flex-end; }
.entry textarea {
  flex: 1; padding: 14px; font: inherit; resize: vertical;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.entry textarea:focus, .choices button:focus-visible, .booking input:focus {
  outline: 3px solid var(--orange); outline-offset: 2px;
}
#send, .primary {
  min-height: 52px; padding: 12px 26px;
  background: var(--orange); color: #fff; border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 700; cursor: pointer;
}
#send[disabled], .primary[disabled] { opacity: .55; cursor: not-allowed; }

.counter { margin: 6px 0 0; font-size: 14px; color: var(--muted); text-align: right; }
.counter.over { color: #b3261e; font-weight: 700; }

.note { font-size: 15px; color: var(--muted); margin: 10px 0 0; }

.turnstile { margin: 12px 0 28px; }

/* -------------------------------------------------------------- booking */

.booking {
  background: var(--panel); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin: 8px 0 28px;
}
.booking h2 { margin: 0 0 14px; font-size: 22px; color: var(--navy); }

.slots { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.slots button {
  min-height: 52px; padding: 12px 18px; font: inherit; font-weight: 600;
  background: var(--panel); color: var(--navy);
  border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.slots button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: 16px; font-weight: 600; }
.fields input {
  padding: 13px; font: inherit; font-weight: 400;
  border: 2px solid var(--line); border-radius: 10px;
}

.consent {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 15px; color: var(--muted); margin-bottom: 18px;
}
/* Deliberately large: this is a legal consent, not a decoration. */
.consent input { width: 24px; height: 24px; margin-top: 2px; flex: none; }

.err { color: #b3261e; font-weight: 600; margin: 12px 0 0; }

/* --------------------------------------------------------------- footer */

.foot { color: var(--muted); font-size: 14px; padding-top: 8px; padding-bottom: 40px; }
.foot p { border-top: 1px solid var(--line); padding-top: 18px; margin: 0; }

/* -------------------------------------------------------------- narrow */

@media (max-width: 560px) {
  h1 { font-size: 25px; }
  .fields { grid-template-columns: 1fr; }
  .msg { max-width: 100%; }
  .choices button { min-width: 100%; }
}

@media (prefers-contrast: more) {
  :root { --line: #333; --muted: #333; }
}
