/* ============================================================
   Kritis — Ink + Cyan UI kit (portable, framework-free)
   For the IPP appliance local web UI (first-boot wizard etc.)

   The cloud app is Next.js + Tailwind + shadcn; this file is a
   hand-distilled, dependency-free equivalent so a plain HTML /
   Jinja template renders in the same Ink+Cyan look. Drop this
   one <link> in and use the .k-* classes below.

   Source of truth: kritis repo CLAUDE.md "## Design Direction"
   + frontend/src/app/globals.css. Keep visually in sync; if the
   cloud palette changes, this file changes.
   ============================================================ */

/* ---- Fonts ----
   Online: keep this @import (Google Fonts).
   Air-gapped appliance: self-host the IBM Plex Sans (300–700) +
   IBM Plex Mono (400/500/600) woff2 files and replace the @import
   with @font-face blocks pointing at the local paths. Do NOT fall
   back to a different family — the type IS part of the brand. */
/* Self-hosted IBM Plex (air-gap): woff2 in ./fonts/, see DESIGN.md */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-mono-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-mono-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-300-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-300-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/k-ui/fonts/plex-sans-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Ink chrome */
  --k-ink:        #0B1B2B;   /* page H1, primary CTA solid, modal headers */
  --k-ink-deep:   #06121E;
  --k-ink-deepest:#040A14;
  --k-navy:       #11324A;   /* mid-shadow gradient stop */

  /* Accent — Vivid Jade (the on-premise appliance brand; the Kritis CLOUD
     console is cyan, so the box is visually unmistakable while staying in the
     same Ink/Plex family). --k-accent* is the canonical, vendor-neutral name;
     the legacy --k-cyan* names are kept as aliases so existing references theme
     for free. --k-accent-rgb feeds the rgba() tints in one place. */
  --k-accent:      #06D2B6;   /* rails, active nav, info, hover */
  --k-accent-deep: #0A8C7C;   /* CTA hover, links/text on light, secondary */
  --k-accent-light:#5EE6D3;   /* gradient mids */
  --k-accent-pale: #DEF8F4;   /* pale washes */
  --k-accent-rgb:  6, 210, 182;
  --k-cyan:       var(--k-accent);
  --k-cyan-deep:  var(--k-accent-deep);
  --k-cyan-light: var(--k-accent-light);
  --k-cyan-pale:  var(--k-accent-pale);

  /* Surfaces */
  --k-bg:         #F4F6F8;   /* cool-white page background */
  --k-card:       #FFFFFF;   /* primary card surface */

  /* Text */
  --k-charcoal:   #3A4A5C;   /* eyebrow labels on light bg */
  --k-charcoal-soft: #5B6478;
  --k-charcoal-mute: #8B92A8;

  /* Semantic (stay semantic — only brand emerald was retired) */
  --k-ok:    #059669;  --k-ok-bg:   #ecfdf5;  --k-ok-border:   #a7f3d0;
  --k-warn:  #b45309;  --k-warn-bg: #fffbeb;  --k-warn-border: #fcd34d;
  --k-err:   #b91c1c;  --k-err-bg:  #fef2f2;  --k-err-border:  #fecaca;

  /* Structure */
  --k-radius: 6px;                                   /* cards/inputs (rounded-md) */
  --k-radius-sm: 3px;
  --k-hairline: rgba(0, 0, 0, 0.05);                 /* border-black/[0.05] */
  --k-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.03);
  --k-shadow-modal: 0 24px 56px rgba(11, 27, 43, 0.22);  /* ink-tinted */

  --k-font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --k-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* ---- Base ---- */
.k-page {
  margin: 0;
  background: var(--k-bg);
  color: var(--k-ink);
  font-family: var(--k-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.k-container { max-width: 1024px; margin: 0 auto; padding: 0 24px; }  /* match app max-w-5xl */

/* ---- Typography ---- */
.k-h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.k-h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.k-h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }

/* Eyebrow label — charcoal on light, cyan on dark (set .on-dark) */
.k-eyebrow {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.25em; color: var(--k-charcoal);
}
.k-eyebrow.on-dark { color: var(--k-cyan); }

/* Monospace for ALL scalars: ids, codes, counters, %, tokens */
.k-mono { font-family: var(--k-mono); font-variant-numeric: tabular-nums; }

.k-muted { color: var(--k-charcoal-soft); }

/* ---- Cards + hairlines ---- */
.k-card {
  background: var(--k-card);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius);
  box-shadow: var(--k-shadow-card);
}
/* Cyan hairline used as a structural separator */
.k-hairline-cyan {
  height: 1px; border: 0;
  background: linear-gradient(to right, rgba(var(--k-accent-rgb), 0.5), transparent);
}

/* ---- Ink-chrome header band (modal / wizard / hero) ----
   Restrained: use for the modal/wizard header + primary CTAs. Do
   NOT paint in-app dashboard panels with it. */
.k-ink-header {
  position: relative;
  background: linear-gradient(to bottom right, var(--k-ink), var(--k-ink), var(--k-cyan-deep));
  color: #fff;
  padding: 20px 24px;
  overflow: hidden;
}
/* 3px cyan side-rail on the left edge of an ink header */
.k-ink-header::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 3px;
  background: linear-gradient(to bottom, var(--k-cyan), var(--k-cyan-deep), rgba(var(--k-accent-rgb), 0.4));
}
.k-ink-header .k-h3 { color: #fff; }
/* Body copy on ink panels */
.on-ink { color: rgba(255, 255, 255, 0.82); }

/* ---- Modal shell ---- */
.k-modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(11, 27, 43, 0.35);
  animation: k-fade 160ms ease-out both;
}
.k-modal {
  position: relative; z-index: 10; width: 100%; max-width: 720px;
  background: var(--k-card); border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius); overflow: hidden;
  box-shadow: var(--k-shadow-modal);
  animation: k-modal-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ---- Buttons ---- */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--k-font); font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: var(--k-radius); cursor: pointer;
  border: 1px solid transparent; transition: background-color 140ms, color 140ms, border-color 140ms;
}
/* Primary CTA — ink solid → cyan-deep on hover */
.k-btn-primary { background: var(--k-ink); color: #fff; }
.k-btn-primary:hover { background: var(--k-cyan-deep); }
/* Alt primary — cyan solid with ink text */
.k-btn-cyan { background: var(--k-cyan); color: var(--k-ink); }
.k-btn-cyan:hover { background: var(--k-cyan-deep); color: #fff; }
/* Outlined secondary — ink text on cyan tint on hover */
.k-btn-outline { background: var(--k-card); border-color: var(--k-input, #e3e8ee); color: var(--k-ink); }
.k-btn-outline:hover { background: rgba(var(--k-accent-rgb), 0.10); }
/* Destructive — outlined red, fills on hover. For removals/factory actions. */
.k-btn-danger { background: var(--k-card); border-color: var(--k-err-border); color: var(--k-err); }
.k-btn-danger:hover { background: var(--k-err); border-color: var(--k-err); color: #fff; }

/* ---- Inputs ---- */
.k-label {
  display: block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.25em; color: var(--k-charcoal); margin-bottom: 8px;
}
.k-input {
  width: 100%; box-sizing: border-box; font-family: var(--k-font); font-size: 14px;
  padding: 9px 12px; border: 1px solid #e3e8ee; border-radius: var(--k-radius);
  background: var(--k-card); color: var(--k-ink); outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}
.k-input:focus { border-color: var(--k-cyan); box-shadow: 0 0 0 3px rgba(var(--k-accent-rgb), 0.18); }
.k-input.k-mono { font-family: var(--k-mono); }

/* ---- Token / code display box (cyan-tinted) ---- */
.k-token-box {
  border: 1px solid rgba(var(--k-accent-rgb), 0.30);
  background: rgba(var(--k-accent-rgb), 0.04);
  border-radius: var(--k-radius);
  padding: 14px 16px;
}
.k-token-box .k-mono {
  display: block; word-break: break-all; font-size: 15px; font-weight: 500;
  line-height: 1.4; letter-spacing: -0.01em; color: var(--k-ink);
}

/* ---- Info banner (cyan tint — NOT amber; reserve amber for warnings) ---- */
.k-info {
  border: 1px solid rgba(var(--k-accent-rgb), 0.25);
  background: rgba(var(--k-accent-rgb), 0.06);
  color: var(--k-ink);
  border-radius: var(--k-radius); padding: 10px 14px; font-size: 12.5px;
}
.k-warn { border: 1px solid var(--k-warn-border); background: var(--k-warn-bg); color: var(--k-warn); border-radius: var(--k-radius); padding: 10px 14px; font-size: 12.5px; }
.k-err  { border: 1px solid var(--k-err-border);  background: var(--k-err-bg);  color: var(--k-err);  border-radius: var(--k-radius); padding: 10px 14px; font-size: 12.5px; }

/* ---- Numbered step bullet (ink circle + mono digit) ---- */
.k-step { display: flex; gap: 10px; align-items: flex-start; }
.k-step-num {
  flex: 0 0 auto; margin-top: 1px;
  width: 16px; height: 16px; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--k-ink); color: #fff;
  font-family: var(--k-mono); font-size: 9.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}

/* ---- Chip ---- */
.k-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 9999px;
  border: 1px solid rgba(var(--k-accent-rgb), 0.30); color: var(--k-cyan-deep);
  background: rgba(var(--k-accent-rgb), 0.06);
}
/* Capability pill on dark surfaces */
.k-chip.on-dark { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }

/* ---- Motion (hair-thin: fades + 2% scale; no slides/bounces) ---- */
@keyframes k-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes k-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
