/*
 * Portalis — the design system the product site, the sign-up and the account pages share.
 *
 * Taken from the UI redesign: Archivo for everything spoken, IBM Plex Mono for anything
 * that is a number, a serial or a measurement. Paper rather than white, ink rather than
 * black, and one orange used sparingly enough that it still means "do this".
 */

:root {
  --paper:      #F6F4F1;
  --paper-2:    #FFFFFF;
  --paper-3:    #EFEBE5;
  --ink:        #16242F;
  --ink-2:      #4A5E6E;
  --ink-3:      #7B8B98;
  --line:       #E2DDD6;
  --line-2:     #D3CCC2;
  --accent:     #C63F19;
  --accent-2:   #FF7A4D;
  --accent-3:   #FFD9CB;
  --ok:         #1F7A4D;
  --ok-soft:    #DCF0E4;
  --warn:       #9A6400;
  --warn-soft:  #FBEBCB;
  --bad:        #A8341B;
  --bad-soft:   #F8DED6;
  --radius:     14px;
  --shadow:     0 1px 2px rgba(22,36,47,.05), 0 8px 24px rgba(22,36,47,.06);
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: #9E3213; }

::selection { background: var(--accent-3); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 26px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 26px; }

/* ── type ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; font-weight: 800; line-height: 1.12; }
h1 { font-size: clamp(38px, 6vw, 68px); }
h2 { font-size: clamp(28px, 3.6vw, 42px); }
h3 { font-size: 21px; letter-spacing: -0.01em; }
p  { margin: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); line-height: 1.55; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }

/* ── header ───────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 244, 241, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); position: relative; flex: none; }
.mark::before {
  content: ''; position: absolute; inset: 8px 6px auto 6px; height: 8px;
  border: 1.6px solid var(--accent-2); border-bottom: none; border-radius: 2px 2px 0 0;
  transform: skewY(-15deg);
}
.mark::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 8px; height: 1.6px; background: var(--accent-2); }
.navlinks { flex: 1; display: flex; gap: 26px; align-items: center; justify-content: flex-end; font-size: 14.5px; font-weight: 500; flex-wrap: wrap; }
.navlinks a { color: var(--ink-2); }
.navlinks a:hover { color: var(--ink); }
/* a button in the nav is a button first: the link colour above would otherwise win on
   specificity and leave the label the same colour as what it sits on */
.navlinks a.btn-primary, .navlinks a.btn-primary:hover { color: #fff; }
.navlinks a.btn-ghost, .navlinks a.btn-dark:hover { color: var(--ink); }
.navlinks a.btn-dark { color: #fff; }

/* ── buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  font-family: var(--sans); font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .05s;
  text-align: center; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #A93414; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--paper-3); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #0E1920; color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── surfaces ─────────────────────────────────────────────────────── */
.card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card-flat { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.panel-body { padding: 22px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ── pills and status ─────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--paper-3); color: var(--ink-2); border: 1px solid var(--line);
}
.pill-ok    { background: var(--ok-soft);   color: var(--ok);    border-color: #BEE3CE; }
.pill-warn  { background: var(--warn-soft); color: var(--warn);  border-color: #EFD79C; }
.pill-bad   { background: var(--bad-soft);  color: var(--bad);   border-color: #EEC2B6; }
.pill-accent{ background: var(--accent-3);  color: var(--accent);border-color: #FFC2AB; }

/* ── forms ────────────────────────────────────────────────────────── */
label.field { display: block; margin-bottom: 16px; }
label.field > span {
  display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-2); margin-bottom: 6px;
}
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--paper-2); color: var(--ink); font-family: var(--sans); font-size: 15px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-3);
}
textarea { min-height: 96px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

.notice { padding: 12px 15px; border-radius: 10px; font-size: 14.5px; margin-bottom: 16px; }
.notice-bad  { background: var(--bad-soft);  color: var(--bad);  border: 1px solid #EEC2B6; }
.notice-ok   { background: var(--ok-soft);   color: var(--ok);   border: 1px solid #BEE3CE; }
.notice-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #EFD79C; }
.notice:empty { display: none; }

/* ── tables ───────────────────────────────────────────────────────── */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: 10px 12px; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 700;
  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: none; }
table.data tbody tr:hover { background: var(--paper); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── footer ───────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); margin-top: 90px; padding: 40px 0 56px; color: var(--ink-2); font-size: 14px; }
.foot .wrap { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; }

/* ── portal shell (account / admin) ───────────────────────────────── */
.shell { padding: 36px 0 90px; }
.shell h1 { font-size: clamp(28px, 3.4vw, 38px); margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 28px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabpanel[hidden] { display: none; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; font-weight: 700; align-self: center; }
.kv dd { margin: 0; }

.skeleton { color: var(--ink-3); font-size: 14.5px; padding: 28px 0; text-align: center; }
