/* Tiger Adjusters Practice Lines: one stylesheet for the sign-in page, the
   member's page and the admin page. */

@font-face { font-family: "Poppins"; src: url("fonts/poppins-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-700.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Brand colors. These are estimates from the logo described on
     tigeradjusters.com (blue with lime green, turquoise accent). Replace the
     six values below with the official ones and the whole site follows.
     lib/brand.js holds the same values for the PDF briefs. */
  --navy: #0A2E63;
  --blue: #0F4C9A;
  --lime: #B6D82E;
  --turquoise: #19B5B8;
  --ink: #12223F;
  --paper: #F4F7FB;

  --blue-hover: #0C3F80;
  --lime-hover: #C7E552;
  --muted: #55627A;
  --surface: #FFFFFF;
  --rule: #D9E1EC;
  --on-navy-muted: #B9C7DF;
  --danger: #B3261E;
  --danger-tint: #FCEEEC;
  --notice-tint: #E6F6F6;

  --font: "Poppins", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --page: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); }
button, input, textarea, select { font: inherit; color: inherit; }
svg.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 3px solid var(--turquoise); outline-offset: 2px; border-radius: 4px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1.5px solid var(--blue); border-radius: var(--r-sm);
  background: var(--blue); color: #fff;
  font-weight: 500; font-size: 0.9375rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.is-quiet { background: transparent; color: var(--blue); border-color: var(--rule); }
.btn.is-quiet:hover { border-color: var(--blue); background: #fff; }
.btn.is-danger { background: var(--danger); border-color: var(--danger); }
.btn.is-danger:hover { background: #8F1E18; border-color: #8F1E18; }
.btn.is-small { min-height: 36px; padding: 6px 12px; font-size: 0.8125rem; }
.btn.is-wide { width: 100%; }
.link-btn { padding: 0; border: 0; background: none; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.link-btn[disabled] { color: var(--muted); text-decoration: none; cursor: default; }

/* ----------------------------------------------------------------- fields */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.field label, .field .label { font-size: 0.875rem; font-weight: 500; }
.field .hint { font-size: 0.8125rem; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="number"], .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid #B8C4D6; border-radius: var(--r-sm); background: #fff;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--turquoise); }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 0.9375rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); }
.check small { display: block; color: var(--muted); font-size: 0.8125rem; }
.form-error { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-tint); color: var(--danger); font-size: 0.875rem; }
.form-note { margin-top: 14px; font-size: 0.875rem; color: var(--muted); }

/* ----------------------------------------------------------------- header */
.top { background: var(--navy); color: #fff; border-bottom: 4px solid var(--lime); }
.top-inner { max-width: var(--page); margin: 0 auto; padding: 12px var(--gutter); min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand-mark { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark sup { font-size: 0.55em; font-weight: 400; }
.brand-mark img { display: block; height: 34px; width: auto; }
.brand-product { padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, 0.3); font-size: 0.9375rem; color: var(--on-navy-muted); white-space: nowrap; }
.top-nav { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; font-size: 0.875rem; }
.top-nav a, .top-nav button { color: #fff; background: none; border: 0; padding: 6px 0; text-decoration: none; cursor: pointer; font-size: inherit; }
.top-nav a:hover, .top-nav button:hover { text-decoration: underline; text-underline-offset: 4px; }
.top-nav .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; max-width: min(46vw, 320px); }
.top-nav .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { max-width: var(--page); margin: 0 auto; padding: clamp(24px, 5vw, 48px) var(--gutter) 64px; }
.page-foot { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 40px; font-size: 0.8125rem; color: var(--muted); }

h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; color: var(--navy); }
.section-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; color: var(--navy); margin: 56px 0 16px; }
.lede { margin-top: 16px; max-width: 58ch; color: var(--muted); }

/* ---------------------------------------------------------------- sign in */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.signin-brand { background: var(--navy); color: #fff; padding: clamp(24px, 5vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; border-right: 6px solid var(--lime); }
.signin-brand h1 { color: #fff; font-size: clamp(2rem, 1.1rem + 3.4vw, 3.5rem); max-width: 11ch; }
.signin-brand .callers { margin: 28px 0 0; padding: 0; list-style: none; max-width: 34ch; }
.signin-brand .callers li { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.18); color: var(--on-navy-muted); font-size: 0.9375rem; }
.signin-brand .callers b { display: block; color: #fff; font-weight: 500; }
.signin-brand .slogan { font-size: 0.875rem; color: var(--lime); font-weight: 500; }
.signin-form { display: flex; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 56px); }
.signin-card { width: 100%; max-width: 400px; }
.signin-card h2 { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.015em; color: var(--navy); line-height: 1.2; }
.signin-card .lede { margin: 10px 0 24px; font-size: 0.9375rem; }
.signin-card .btn { margin-top: 18px; }
.signin-card .sent-to { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.code-input { font-size: 1.75rem !important; font-weight: 700; letter-spacing: 0.32em; text-align: center; padding-left: 0.32em !important; min-height: 64px !important; }
.signin-links { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.875rem; }

/* ------------------------------------------------------ member: the intro */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 32px 48px; align-items: start; }

.time { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 20px 22px 22px; }
.time-left { display: flex; align-items: baseline; gap: 10px; }
.time-left strong { font-size: 3.25rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--navy); }
.time-left span { font-weight: 500; }
.time.is-out .time-left strong { color: var(--danger); }
.gauge { display: block; width: 100%; height: 10px; margin: 14px 0 12px; border: 0; border-radius: 999px; background: var(--rule); overflow: hidden; appearance: none; -webkit-appearance: none; }
.gauge::-webkit-progress-bar { background: var(--rule); border-radius: 999px; }
.gauge::-webkit-progress-value { background: var(--lime); border-radius: 999px; }
.gauge::-moz-progress-bar { background: var(--lime); border-radius: 999px; }
.time-detail { font-size: 0.8125rem; color: var(--muted); }
.time .btn { margin-top: 16px; }
.time-asked { margin-top: 16px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--notice-tint); font-size: 0.8125rem; }

.banner { margin-top: 32px; padding: 18px 20px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.banner p { max-width: 60ch; font-size: 0.9375rem; }
.banner b { display: block; font-size: 1rem; }
.banner.is-out { background: var(--danger-tint); border: 1px solid #F1C9C5; }
.banner.is-setup { background: var(--notice-tint); border: 1px solid #BFE6E7; align-items: flex-end; }
.banner form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.banner .field { min-width: 200px; }

/* ------------------------------------------------------- member: the lines */
.lines { margin-top: 40px; display: grid; gap: 24px; }
.line { display: grid; grid-template-columns: minmax(0, 348px) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.plate { background: var(--navy); color: #fff; padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.plate h2 { font-size: 1.0625rem; font-weight: 500; line-height: 1.3; }
.plate-who { font-size: 0.8125rem; color: var(--on-navy-muted); }
.dial {
  margin: 14px 0 12px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  background: var(--lime); color: var(--navy); border-radius: var(--r-md);
  font-size: clamp(1.375rem, 1rem + 1.4vw, 1.625rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap;
  text-decoration: none;
  transition: background-color 120ms ease;
}
.dial:hover { background: var(--lime-hover); }
.dial:focus-visible { outline-color: #fff; outline-offset: 3px; border-radius: var(--r-md); }
.dial-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--lime); display: grid; place-items: center; flex: none; }
.dial-icon svg.icon { width: 20px; height: 20px; }
button.dial { width: 100%; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.dial.is-off, .dial.is-off:hover { background: #2B4A7C; color: var(--on-navy-muted); }
.dial.is-off .dial-icon { background: rgba(255, 255, 255, 0.12); color: var(--on-navy-muted); }
.plate-say { font-size: 0.8125rem; color: var(--on-navy-muted); }
.plate-say b { color: #fff; font-weight: 500; }

.scenarios { margin: 0; padding: 0; list-style: none; }
.scenario { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 8px 20px; align-items: start; padding: 22px 24px; }
.scenario + .scenario { border-top: 1px solid var(--rule); }
.say { color: var(--blue); line-height: 1.1; }
.say small { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.say b { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; }
.scenario h3 { font-size: 1rem; font-weight: 500; line-height: 1.35; }
.scenario p { margin-top: 4px; font-size: 0.875rem; color: var(--muted); max-width: 62ch; }
.scenario .btn { white-space: nowrap; }

/* ----------------------------------------------------------------- tables */
.table-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.8125rem; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: #FAFBFD; white-space: nowrap; }
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 22px 24px; color: var(--muted); font-size: 0.9375rem; }

.person b { display: block; font-weight: 500; }
.person span { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; background: #E7EEF8; color: var(--blue); white-space: nowrap; }
.tag.is-off { background: #ECEFF3; color: var(--muted); }
.usage-cell { min-width: 150px; }
.usage-cell .gauge { height: 6px; margin: 6px 0 0; }
.usage-cell.is-out b { color: var(--danger); }
.usage-cell.is-out .gauge::-webkit-progress-value { background: var(--danger); }
.usage-cell.is-out .gauge::-moz-progress-bar { background: var(--danger); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------------ admin */
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 56px 0 16px; }
.section-head .section-title { margin: 0; }
.notices { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.notices li { padding: 12px 16px; border-left: 4px solid var(--turquoise); background: var(--notice-tint); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 0.875rem; max-width: 90ch; }
.requests { display: grid; gap: 12px; }
.request { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--lime); border-radius: var(--r-md); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.request p { font-size: 0.9375rem; max-width: 60ch; }
.request .note { color: var(--muted); font-size: 0.875rem; margin-top: 2px; }
.request .row-actions { align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 24px; }
.panel > p { max-width: 76ch; font-size: 0.9375rem; color: var(--muted); }
.panel ol { margin: 12px 0 0; padding-left: 20px; max-width: 76ch; font-size: 0.9375rem; color: var(--muted); }
.panel ol li + li { margin-top: 4px; }
.line-ids { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.line-ids .field + .field { margin-top: 0; }
.line-ids input { font-size: 0.875rem; }
.panel-actions { margin-top: 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- dialog */
dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(10, 46, 99, 0.5); }
.dialog-body { padding: 24px; }
.dialog-body h2 { font-size: 1.25rem; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; line-height: 1.25; }
.dialog-body > p { margin-top: 8px; font-size: 0.9375rem; color: var(--muted); }
.dialog-body form { margin-top: 18px; }
.dialog-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: var(--r-md); background: var(--navy); color: #fff; font-size: 0.9375rem; z-index: 20; }

.loading { padding: 48px var(--gutter); color: var(--muted); }
.stopped { max-width: 520px; margin: 0 auto; padding: 72px var(--gutter); }
.stopped p { margin-top: 12px; color: var(--muted); }
.stopped .btn { margin-top: 24px; }

/* ----------------------------------------------------------- small screens */
@media (max-width: 860px) {
  .signin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .signin-brand { border-right: 0; border-bottom: 6px solid var(--lime); gap: 28px; }
  .signin-brand .callers, .signin-brand .slogan { display: none; }
  .signin-brand h1 { max-width: none; }
  .signin-form { align-items: flex-start; }

  .intro { grid-template-columns: 1fr; gap: 24px; }
  .time { padding: 16px 18px 18px; }
  .time-left strong { font-size: 2.5rem; }
  .line { grid-template-columns: 1fr; }
  .plate { padding: 20px; }
  .line-ids { grid-template-columns: 1fr; }

  /* Tables turn into a list of labelled rows. */
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.data, table.data tbody, table.data tr, table.data td { display: block; }
  table.data tr { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
  table.data tr:last-child { border-bottom: 0; }
  table.data td { padding: 3px 0; border: 0; }
  table.data td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.8125rem; }
  table.data td.person::before, table.data td.actions::before { content: none; }
  table.data td.actions { padding-top: 10px; }
  .row-actions { justify-content: flex-start; }
  .usage-cell .gauge { max-width: 220px; }
}

@media (max-width: 560px) {
  .brand-product { display: none; }
  .scenario { grid-template-columns: 1fr; padding: 20px; }
  .say { display: flex; align-items: baseline; gap: 8px; }
  .say small { margin: 0; font-size: 0.875rem; }
  .say b { font-size: 1.375rem; }
  .scenario .btn { justify-self: start; margin-top: 6px; }
  .dial { justify-content: flex-start; }
  .banner form, .banner .field, .banner .btn { width: 100%; }
  .dialog-actions .btn { flex: 1 1 auto; }
}

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

@media print {
  .top-nav, .btn, .toast { display: none !important; }
}
