/* ============================================================
   SELF-HOSTED FONTS — replaces Google Fonts CDN.
   Served read-only from the embedded /static/fonts/ tree so the
   strict Content-Security-Policy (default-src 'self', no CDN)
   holds with no external request. Inter Tight is supplied by the
   Inter variable font (400–700); JetBrains Mono and Source Serif 4
   are static weights.
   ============================================================ */
@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterVariable-Italic.woff2') format('woff2');
  font-weight: 400 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/static/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/static/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/static/fonts/SourceSerif4.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/static/fonts/SourceSerif4-Italic.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}

/* ============================================================
   ELYTRA CUSTOMER PORTAL — portal.css
   Dark, enterprise-grade security product UI.
   Palette evolved from the Elytra brand: deep slate base,
   logo blue as the interactive accent, amber as a warm
   secondary / warning tone. Source Serif 4 for display,
   Inter Tight for UI, JetBrains Mono for IDs & keys.
   ------------------------------------------------------------
   Drop-in for Go html/template. No JS framework required;
   HTMX hooks attach to the data-attributes noted in comments.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Surfaces (dark) */
  --bg:            #0a0e14;
  --bg-2:          #0d121a;
  --surface:       #111824;
  --surface-2:     #161f2d;
  --surface-3:     #1c2738;
  --input:         #0e141d;

  /* Lines */
  --border:        #232f40;
  --border-2:      #2e3d52;
  --hairline:      rgba(255,255,255,0.06);

  /* Text */
  --text:          #e9eef6;
  --text-2:        #97a6ba;
  --muted:         #647488;

  /* Brand + accent */
  --brand:         #4a86c4;       /* logo "elytra" blue */
  --accent:        #4a9ede;       /* interactive blue */
  --accent-2:      #74b6ec;       /* hover / bright */
  --accent-deep:   #2f6ea8;
  --accent-weak:   rgba(74,158,222,0.12);
  --accent-line:   rgba(74,158,222,0.34);

  /* Amber (from shield) */
  --amber:         #e0954f;
  --amber-2:       #f0ad6a;
  --amber-weak:    rgba(224,149,79,0.13);
  --amber-line:    rgba(224,149,79,0.32);

  /* Semantic */
  --success:       #41c463;
  --success-weak:  rgba(65,196,99,0.13);
  --warning:       #e0a93f;
  --warning-weak:  rgba(224,169,63,0.13);
  --danger:        #f0635a;
  --danger-weak:   rgba(240,99,90,0.13);

  /* Type */
  --sans:  'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Radius + shadow */
  --r-sm: 6px;
  --r:    9px;
  --r-lg: 14px;
  --shadow:    0 1px 0 rgba(0,0,0,.35), 0 10px 30px -16px rgba(0,0,0,.75);
  --shadow-lg: 0 24px 70px -28px rgba(0,0,0,.85);

  /* Layout */
  --maxw: 1240px;
  --bar-h: 68px;
}

/* ---------- 2. Reset / base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(74,158,222,.10), transparent 60%),
    radial-gradient(900px 540px at 8% 4%, rgba(224,149,79,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1,h2,h3,h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.18; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
::selection { background: rgba(74,158,222,.3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.wrap--narrow { max-width: 880px; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }

/* ---------- 3. Eyebrow / section labels ---------- */
.eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: .19em;
  text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 9px;
}
.eyebrow--amber { color: var(--amber-2); }
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: currentColor; opacity: .6;
}
.eyebrow.no-rule::before { display: none; }

/* ---------- 4. App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 32px;
  background: rgba(10,14,20,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__logo { height: 48px; width: auto; display: block; }
.brand__mark { height: 30px; width: auto; }
.brand__word { display: inline-flex; align-items: baseline; gap: 6px; line-height: 1; }
.brand__word b { font-weight: 600; font-size: 18px; letter-spacing: -.01em; color: var(--text); }
.brand__word i {
  font-style: normal; font-size: 13px; font-weight: 500; letter-spacing: .12em;
  text-transform: lowercase; color: var(--muted);
}
.appbar__nav { display: flex; align-items: center; gap: 4px; height: 100%; }
.appbar__nav a {
  display: inline-flex; align-items: center; height: 100%;
  padding: 0 14px; color: var(--text-2); font-size: 14px; font-weight: 500;
  position: relative; transition: color .15s;
}
.appbar__nav a:hover { color: var(--text); }
.appbar__nav a.active { color: var(--text); }
.appbar__nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.appbar__right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.appbar__user { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.appbar__user .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  color: var(--accent-2); background: var(--accent-weak);
  border: 1px solid var(--accent-line);
}
.appbar__user .org { color: var(--text); font-weight: 500; }
.appbar__user .sep { color: var(--border-2); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 0 16px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--accent); color: #061018; }
.btn--primary:hover { background: var(--accent-2); color: #061018; }
.btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn--secondary:hover { background: var(--surface-3); border-color: #3a4c64; color: var(--text); }
.btn--ghost { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn--ghost:hover { color: var(--text); border-color: #3a4c64; background: var(--surface); }
.btn--danger { background: var(--danger-weak); color: var(--danger); border-color: rgba(240,99,90,.4); }
.btn--danger:hover { background: rgba(240,99,90,.2); color: #ff8077; }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn--link { background: none; border: none; color: var(--accent); padding: 0; height: auto; font-weight: 600; }
.btn--link:hover { color: var(--accent-2); }

/* ---------- 6. Cards / panels ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card__body { padding: 22px 24px; }
.card__head {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card__head h3 { font-size: 15px; }
.card__head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card--link { transition: border-color .16s, transform .16s, background .16s; }
.card--link:hover { border-color: var(--border-2); transform: translateY(-2px); background: var(--surface-2); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }

/* ---------- 7. Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; line-height: 1.4;
  border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--blue    { color: var(--accent-2); background: var(--accent-weak); border-color: var(--accent-line); }
.badge--green   { color: #5fd984;        background: var(--success-weak); border-color: rgba(65,196,99,.34); }
.badge--amber   { color: var(--amber-2);  background: var(--amber-weak);   border-color: var(--amber-line); }
.badge--success { color: #5fd984;        background: var(--success-weak); border-color: rgba(65,196,99,.34); }
.badge--warning { color: var(--warning);  background: var(--warning-weak);  border-color: rgba(224,169,63,.34); }
.badge--danger  { color: #ff8077;        background: var(--danger-weak);  border-color: rgba(240,99,90,.4); }
.badge--muted   { color: var(--text-2);   background: var(--surface-3);     border-color: var(--border-2); }
.badge--upper { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }

/* ---------- 8. Tables ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td { padding: 13px 18px; border-bottom: 1px solid var(--hairline); color: var(--text); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-id { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.table .row-action { text-align: right; white-space: nowrap; }
.table .strong { font-weight: 600; }

/* ---------- 9. Forms ---------- */
.field { margin-bottom: 18px; }
.field > label, .label {
  display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--text-2); margin-bottom: 7px;
}
.label .req { color: var(--amber-2); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--input); border: 1px solid var(--border-2); border-radius: var(--r-sm);
  padding: 10px 13px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: #56657a; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); background: var(--bg-2);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2397a6ba' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkrow { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); }
.checkrow input { width: 16px; height: 16px; accent-color: var(--accent); }

/* file dropzone */
.dropzone {
  border: 1.5px dashed var(--border-2); border-radius: var(--r-sm);
  padding: 24px; text-align: center; color: var(--text-2); background: var(--bg-2);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--accent-line); background: var(--surface); }
.dropzone svg { width: 22px; height: 22px; color: var(--muted); margin-bottom: 6px; }
.dropzone b { color: var(--accent-2); font-weight: 600; }

/* segmented severity control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg label {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px; border: 1px solid var(--border-2); border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; text-align: center;
  background: var(--input); transition: all .14s;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label .sd { width: 8px; height: 8px; border-radius: 50%; }
.seg label:hover { border-color: #3a4c64; color: var(--text); }
.seg input:checked + label, .seg label.is-on {
  color: var(--text); border-color: var(--accent-line); background: var(--accent-weak);
}

/* ---------- 10. Page scaffolding ---------- */
.page { padding: 38px 0 80px; }
.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head__title { font-size: 27px; font-weight: 600; letter-spacing: -.02em; }
.page-head__sub { color: var(--text-2); margin-top: 5px; font-size: 14.5px; max-width: 60ch; }
.page-head__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--border-2); }

.section-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.section-title .count { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }

/* grids */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.col-span-2 { grid-column: span 2; }

/* ---------- 11. Stat cards ---------- */
.stat { padding: 18px 20px; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; margin: 0 0 10px; }
.stat .num { font-size: 34px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat .num.serif { font-family: var(--serif); font-weight: 500; }
.stat .foot { font-size: 12.5px; color: var(--text-2); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.stat .foot.up { color: var(--success); }
.stat .foot.warn { color: var(--warning); }
.stat--accent { border-top: 2px solid var(--accent); }
.stat--amber  { border-top: 2px solid var(--amber); }

/* ---------- 12. Product cards ---------- */
.product-card { display: flex; flex-direction: column; padding: 20px 20px 18px; height: 100%; }
.product-card__top { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 13px; }
.prod-mark {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  display: grid; place-items: center; background: var(--surface-3);
  border: 1px solid var(--border-2); color: var(--accent-2);
}
.prod-mark svg { width: 21px; height: 21px; }
.prod-mark.amber { color: var(--amber-2); }
.product-card__name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.product-card__name small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); font-family: var(--mono); letter-spacing: 0; margin-top: 3px; }
.product-card__desc { font-size: 13.5px; color: var(--text-2); line-height: 1.5; flex: 1; }
.product-card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.product-card__foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: 10px; }
.product-card__foot .spacer { flex: 1; }
.product-card.is-locked { opacity: .92; }
.product-card.is-locked .prod-mark { color: var(--muted); }

/* license status pill helpers */
.lic-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; }

/* ---------- 13. Activity feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed__item { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.feed__item:last-child { border-bottom: none; }
.feed__icon {
  width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2);
}
.feed__icon svg { width: 16px; height: 16px; }
.feed__icon.blue  { color: var(--accent-2); background: var(--accent-weak); border-color: var(--accent-line); }
.feed__icon.green { color: #5fd984; background: var(--success-weak); border-color: rgba(65,196,99,.3); }
.feed__icon.amber { color: var(--amber-2); background: var(--amber-weak); border-color: var(--amber-line); }
.feed__body { flex: 1; min-width: 0; }
.feed__body .t { font-size: 13.5px; color: var(--text); }
.feed__body .t b { font-weight: 600; }
.feed__body .when { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 14. Banners / alerts ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 14px; padding: 15px 18px;
  border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface);
}
.banner__icon { flex: none; width: 22px; height: 22px; }
.banner__icon svg { width: 22px; height: 22px; }
.banner__body { flex: 1; font-size: 13.5px; color: var(--text-2); }
.banner__body b { color: var(--text); font-weight: 600; }
.banner__body .title { color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.banner__action { display: flex; align-items: center; gap: 8px; }
.banner--warning { border-color: var(--warning-weak); background: linear-gradient(0deg, var(--surface), var(--surface)) padding-box, var(--warning-weak); border-color: rgba(224,169,63,.4); }
.banner--warning { background: linear-gradient(90deg, rgba(224,169,63,.10), rgba(224,169,63,.02)); }
.banner--warning .banner__icon { color: var(--warning); }
.banner--danger  { background: linear-gradient(90deg, rgba(240,99,90,.10), rgba(240,99,90,.02)); border-color: rgba(240,99,90,.4); }
.banner--danger .banner__icon { color: var(--danger); }
.banner--info { background: linear-gradient(90deg, rgba(74,158,222,.09), rgba(74,158,222,.02)); border-color: var(--accent-line); }
.banner--info .banner__icon { color: var(--accent-2); }

/* quick actions */
.qa { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; }
.qa > div { flex: 1; min-width: 0; }
.qa__icon {
  width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-weak); border: 1px solid var(--accent-line); color: var(--accent-2);
}
.qa__icon svg { width: 20px; height: 20px; }
.qa__icon.amber { background: var(--amber-weak); border-color: var(--amber-line); color: var(--amber-2); }
.qa__t { font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.25; }
.qa__s { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.qa .arr { margin-left: auto; color: var(--muted); transition: transform .15s, color .15s; }
.card--link:hover .qa .arr { color: var(--accent-2); transform: translateX(3px); }

/* ---------- 15. Auth (sign in / mfa) ---------- */
.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
}
.auth-aside {
  position: relative; overflow: hidden; padding: 56px 60px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(700px 420px at 30% 20%, rgba(74,158,222,.16), transparent 60%),
    linear-gradient(160deg, #0f1622, #0a0e14 70%);
  border-right: 1px solid var(--border);
}
.auth-aside__mark { position: absolute; right: -120px; top: 50%; transform: translateY(-50%); width: 560px; opacity: .05; filter: grayscale(.2); }
.auth-aside__content { position: relative; z-index: 2; max-width: 460px; }
.auth-aside h2 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.12; letter-spacing: -.02em; margin: 22px 0 16px; }
.auth-aside h2 em { font-style: italic; color: var(--amber-2); }
.auth-aside p { color: var(--text-2); font-size: 15px; max-width: 42ch; }
.auth-trust { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 12px; }
.auth-trust .row { display: flex; align-items: center; gap: 11px; color: var(--text-2); font-size: 13.5px; }
.auth-trust .row svg { width: 17px; height: 17px; color: var(--success); flex: none; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 384px; }
.auth-card__brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 30px; }
.auth-card__brand img { height: 64px; }
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--text-2); font-size: 14px; margin-top: 6px; margin-bottom: 26px; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 13px; color: var(--muted); }
.auth-meta { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 16px; font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }

/* OTP inputs */
.otp { display: flex; gap: 10px; justify-content: center; margin: 4px 0 6px; }
.otp input {
  width: 50px; height: 60px; text-align: center; font-family: var(--mono); font-size: 24px;
  color: var(--text); background: var(--input); border: 1px solid var(--border-2); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }

/* ---------- 16. Landing ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero__bg-mark { position: absolute; right: -6%; top: 50%; transform: translateY(-50%); width: 620px; opacity: .06; pointer-events: none; }
.hero__inner { position: relative; z-index: 2; padding: 96px 0 92px; max-width: 760px; }
.hero__logo { height: 112px; margin-bottom: 26px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: 58px; line-height: 1.04; letter-spacing: -.025em; }
.hero h1 em { font-style: italic; color: var(--amber-2); }
.hero__lede { font-size: 18.5px; color: var(--text-2); margin-top: 22px; max-width: 56ch; line-height: 1.55; }
.hero__tag { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--brand); letter-spacing: .01em; }
.hero__cta { display: flex; gap: 14px; margin-top: 34px; align-items: center; flex-wrap: wrap; }
.hero__assure { display: flex; gap: 22px; margin-top: 40px; flex-wrap: wrap; }
.hero__assure .it { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.hero__assure .it svg { width: 16px; height: 16px; color: var(--success); }

.section { padding: 70px 0; border-bottom: 1px solid var(--border); }
.section__head { margin-bottom: 34px; max-width: 640px; }
.section__head h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -.02em; margin-top: 12px; }
.section__head p { color: var(--text-2); margin-top: 12px; font-size: 15.5px; }

.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.about h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -.02em; }
.about p { color: var(--text-2); font-size: 15.5px; margin-top: 16px; line-height: 1.65; }
.about__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.about__facts .f { background: var(--surface); padding: 22px 22px; }
.about__facts .f .n { font-family: var(--serif); font-size: 30px; color: var(--text); letter-spacing: -.02em; }
.about__facts .f .l { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }

/* ---------- 17. Footer ---------- */
.foot { border-top: 1px solid var(--border); background: var(--bg-2); padding: 30px 0; }
.foot__row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.foot__row .brand__mark { height: 24px; }
.foot__row .brand__logo { height: 34px; }
.foot__row .iso { display: inline-flex; align-items: center; gap: 7px; }
.foot__row .iso svg { width: 14px; height: 14px; color: var(--success); }
.foot__sep { flex: 1; }
.foot__row a { color: var(--text-2); }
.foot__links { display: flex; gap: 18px; }

/* ---------- 18. Misc ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
.kv dd.mono { font-family: var(--mono); font-size: 12.5px; }
.divider-y { width: 1px; background: var(--border); align-self: stretch; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 30px; height: 30px; opacity: .5; margin-bottom: 8px; }
.tag-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-filter button {
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2);
  font-size: 13px; font-weight: 500; padding: 7px 13px; border-radius: 999px; cursor: pointer; font-family: inherit;
  transition: all .14s;
}
.tag-filter button:hover { color: var(--text); border-color: #3a4c64; }
.tag-filter button.is-on { color: var(--text); background: var(--accent-weak); border-color: var(--accent-line); }

.delivery-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.delivery-note svg { width: 14px; height: 14px; color: var(--muted); }

/* tabs (admin section nav) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.tabs a {
  padding: 11px 16px; font-size: 14px; font-weight: 500; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .14s;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- 19. Responsive ---------- */
@media (max-width: 1080px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .grid-3, .grid-2, .form-row, .about, .about__facts { grid-template-columns: 1fr; }
  .hero h1 { font-size: 42px; }
  .appbar__nav { display: none; }
}
@media (max-width: 620px) {
  .grid-5, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: 0 18px; }
  .page-head__actions { width: 100%; margin-left: 0; }
}

/* ---------- 20. Portal additions (server-rendered specifics) ----------
   Components the handoff does not cover but the server renders: the TOTP
   enrolment QR (inline SVG, needs a light plate on the dark surface), the
   manual-entry secret, and the one-time initial-password chip. */
.qr-wrap {
  display: grid; place-items: center; padding: 16px;
  background: #fff; border-radius: var(--r);
  width: max-content; margin: 0 auto 18px;
}
.qr-wrap svg, .qr-wrap img { width: 196px; height: 196px; display: block; }
.secret-code {
  font-family: var(--mono); font-size: 15px; letter-spacing: .14em;
  text-align: center; color: var(--accent-2);
  background: var(--input); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 11px; margin: 0 0 20px; word-break: break-all;
}
.secret-inline {
  font-family: var(--mono); color: var(--amber-2);
  background: var(--input); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 2px 8px;
}
