/* Global Entry Seeker design system.
   Ink navy + white panels on mist. One accent (signal blue). Amber is reserved for Simulation Mode.
   Signature element: boarding-pass stubs for appointment times. */
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #0e2240; --ink-2: #1b3358; --ink-3: #2a4570;
  --mist: #f2f4f7; --panel: #ffffff; --line: #e3e7ee; --line-2: #d3d9e3;
  --text: #1b2433; --slate: #5a6577; --muted: #7a8597;
  --signal: #2e6bd9; --signal-ink: #1f55b8; --signal-soft: #e8f0fd;
  --ok: #1f8a5b; --ok-soft: #e5f4ec; --warn: #b7791f; --warn-soft: #fbf1df; --fail: #c23b3b; --fail-soft: #fbe9e9;
  --sim: #b7791f;
  --r-panel: 12px; --r-ctl: 8px;
  --shadow: 0 1px 2px rgba(14, 34, 64, .06), 0 4px 16px rgba(14, 34, 64, .05);
  --font: "Plex", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 15px/1.5 var(--font); color: var(--text); background: var(--mist); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 20px; line-height: 1.3; }
h3 { font-size: 16px; line-height: 1.4; }
p { margin: 0 0 12px; }
a { color: var(--signal-ink); }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--slate); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.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(--signal); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-ctl); border: 1px solid transparent; font: 500 14px var(--font); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s; white-space: nowrap; }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-ink); }
.btn-secondary { background: var(--panel); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--signal-ink); }
.btn-ghost:hover { background: var(--signal-soft); }
.btn-danger { background: var(--panel); color: var(--fail); border-color: #e7c3c3; }
.btn-danger:hover { background: var(--fail-soft); }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 500; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
label.field > small { display: block; color: var(--slate); font-size: 13px; margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  font: 400 15px var(--font); color: var(--text); background: #fff; }
textarea { min-height: 180px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--signal); outline: none; box-shadow: 0 0 0 3px var(--signal-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--signal); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-ctl); overflow: hidden; flex-wrap: wrap; }
.segmented button { border: 0; background: #fff; padding: 9px 14px; font: 500 14px var(--font); color: var(--slate); cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--line-2); }
.segmented button[aria-pressed=true] { background: var(--ink); color: #fff; }

/* ---------- surfaces */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head p { margin: 0; }
.stack > * + * { margin-top: 16px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }

/* ---------- status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px;
  font-weight: 500; background: var(--mist); color: var(--slate); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.fail { background: var(--fail-soft); color: var(--fail); }
.pill.info { background: var(--signal-soft); color: var(--signal-ink); }
.pill.plain::before { display: none; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 500; color: var(--slate); font-size: 13px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: #f8f9fb; }
td.num, th.num { text-align: right; }

/* ---------- empty, loading, error */
.empty { padding: 36px 20px; text-align: center; color: var(--slate); }
.empty h3 { margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, #eceff4 25%, #f5f7fa 50%, #eceff4 75%); background-size: 200% 100%;
  animation: shimmer 1.2s infinite; border-radius: 6px; min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notice { border-radius: var(--r-ctl); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.notice.error { background: var(--fail-soft); border-color: #efc9c9; color: #7d2323; }
.notice.warn { background: var(--warn-soft); border-color: #ecd6aa; color: #6e4a10; }
.notice.info { background: var(--signal-soft); border-color: #cdddf8; color: #1d3f7d; }
.notice.ok { background: var(--ok-soft); border-color: #c4e5d3; color: #155c3d; }
details.more summary { cursor: pointer; color: var(--signal-ink); font-size: 13px; margin-top: 6px; }
details.more pre { white-space: pre-wrap; font-size: 12px; background: #fff; padding: 8px; border-radius: 6px; margin: 6px 0 0; }

/* ---------- boarding-pass stub (signature element) */
.stub { display: grid; grid-template-columns: 1fr auto; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  position: relative; overflow: hidden; }
.stub + .stub { margin-top: 10px; }
.stub-main { padding: 14px 18px; }
.stub-main .when { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stub-main .where { color: var(--slate); font-size: 14px; }
.stub-side { padding: 14px 18px 14px 22px; border-left: 2px dashed var(--line-2); display: flex; flex-direction: column;
  justify-content: center; align-items: flex-end; gap: 4px; min-width: 132px; position: relative; }
.stub-side::before, .stub-side::after { content: ""; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--mist); border: 1px solid var(--line); }
.stub-side::before { top: -9px; } .stub-side::after { bottom: -9px; }
.stub-side .big { font-size: 22px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stub.gone { opacity: .6; }
@media (max-width: 480px) { .stub { grid-template-columns: 1fr; } .stub-side { border-left: 0; border-top: 2px dashed var(--line-2);
  align-items: flex-start; } .stub-side::before, .stub-side::after { display: none; } }

/* ---------- modal and toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(14, 34, 64, .45); display: flex; align-items: center;
  justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 24px;
  box-shadow: 0 20px 60px rgba(14, 34, 64, .25); }
.modal h2 { margin-bottom: 8px; }
.modal .btn-row { justify-content: flex-end; margin-top: 20px; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow);
  max-width: 380px; font-size: 14px; }
.toast.error { background: var(--fail); }

/* ---------- chart */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font: 11px var(--font); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--slate); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw-signal { background: var(--signal); } .sw-ok { background: var(--ok); } .sw-ink { background: var(--ink); } .sw-fail { background: var(--fail); }

/* ---------- auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 440px) 1fr; }
.auth-form { background: #fff; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-art { background: var(--ink); color: #c9d4e6; padding: 48px; display: flex; flex-direction: column; justify-content: flex-end; }
.auth-art h2 { color: #fff; font-size: 28px; max-width: 18ch; margin-bottom: 12px; }
.auth-art p { max-width: 46ch; }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); margin-bottom: 36px; }
.brandmark img { width: 34px; height: 34px; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } .auth-form { padding: 32px 22px; } }

/* ---------- polish pass 1 */
a.brandmark { text-decoration: none; }
.cols > .panel + .panel, .grid-2 > .panel + .panel, .grid-3 > .panel + .panel { margin-top: 0; }
.grid-2:has(> .panel), .grid-3:has(> .panel) { gap: 16px; }
.stub-side::before, .stub-side::after { background: #fff; }
.panel .stub { box-shadow: none; }
@media (max-width: 480px) {
  .stub { grid-template-columns: 1fr auto; }
  .stub-main { padding: 12px 14px; } .stub-main .when { font-size: 16px; }
  .stub-side { border-left: 2px dashed var(--line-2); border-top: 0; align-items: flex-end; min-width: 86px; padding: 12px 14px 12px 16px; }
  .stub-side::before, .stub-side::after { display: block; }
  .stub-side .big { font-size: 17px; }
}
