/*
 * The customer's pages. Design tokens: the subset the portal uses of the console's copy of the
 * Latitude design system's light-theme tokens (services/console/public/console.css), to be kept
 * in step. Source (read-only): Operator repository, design/latitude-ds/tokens/.
 * Everything below the tokens uses these variables only; no colour is written out a second time.
 * Light theme only. One column, at most 480px wide, comfortable at 320px.
 */
:root {
  /* colors.css */
  --purple-050: #F4F0FE;
  --purple-200: #CDBCFB;
  --purple-500: #784EF7;
  --purple-600: #6438E9;
  --purple-700: #5229CE;

  --success: oklch(0.62 0.13 158);
  --success-soft: oklch(0.95 0.03 158);
  --danger: oklch(0.6 0.19 25);
  --danger-soft: oklch(0.95 0.03 25);

  --bg-page: #F6F7FC;
  --bg-surface: #FFFFFF;
  --bg-hover: #F1F2F9;
  --bg-active: #E7E9F4;

  --text-primary: #000040;
  --text-secondary: #40424D;
  --text-muted: #6E7180;
  --text-link: #6438E9;

  --border-subtle: #EDEFF7;
  --border-default: #D3D6E0;
  --border-strong: #BCBFCC;

  --accent: var(--purple-500);
  --accent-hover: var(--purple-600);
  --accent-active: var(--purple-700);
  --accent-soft: var(--purple-050);
  --accent-soft-border: var(--purple-200);
  --on-accent: #FFFFFF;

  --focus-ring: 0 0 0 3px rgba(120, 78, 247, 0.28);

  /* typography.css */
  --font-sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-sub1: 32px;
  --text-sub2: 24px;
  --text-p1: 18px;
  --text-p2: 16px;
  --text-body: 14px;
  --text-sm: 13px;

  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-xbold: 800;

  --leading-heading: 1.2;
  --leading-body: 1.5;

  --tracking-tight: -0.02em;
  --tracking-wide: 0.06em;

  /* spacing.css */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-10: 40px;
  --space-12: 48px;

  --control-h-lg: 44px;
  --topbar-h: 56px;

  /* effects.css */
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 64, 0.06);

  /* This page's own measure: one column. */
  --column-max: 480px;
}

/* Fonts: the design system's own files, served from /static (no third-party request). */
@font-face { font-family: "Manrope"; src: url("/static/manrope-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/manrope-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/manrope-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/manrope-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/manrope-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* Base: 16px body text on these pages. */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-p2);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a { color: var(--text-link); }
p { margin: 0 0 var(--space-4); }
.mono { font-family: var(--font-mono); }
[hidden] { display: none !important; }

/* The link page: while portal.js opens a link (about half a second) the page stays blank below the
   top bar, so nothing flashes; the opening message is for screen readers only. */
.shell-opening { display: none; }
.kx-opening .shell-manual { display: none; }
.kx-opening .shell-opening {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Focus: the design system's ring, plus an outline that shows in forced-colors mode. */
:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; outline-offset: 2px; }
}

/* Top bar: the logo and the product name, nothing to navigate to. */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--topbar-h);
  padding: var(--space-2) var(--space-6);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
/* Clear space around the logo is a quarter of its height (24px / 4 = 6px). */
.logo-clear { display: inline-flex; padding: 6px; }
.logo-full { display: block; height: 24px; width: auto; }
.logo-mark { display: none; height: 26px; width: auto; }
.topbar-product {
  padding-left: var(--space-3);
  border-left: 1px solid var(--border-default);
  font-size: var(--text-p2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
}

/* The one column. */
.page {
  display: block;
  width: 100%;
  max-width: calc(var(--column-max) + 2 * var(--space-6));
  margin: 0 auto;
  padding: var(--space-10) var(--space-6) var(--space-12);
}

h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sub1);
  font-weight: var(--weight-xbold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-heading);
}
.lede { margin: 0 0 var(--space-6); color: var(--text-secondary); font-size: var(--text-p1); }

/* Card (design system Card) */
.panel {
  margin: 0 0 var(--space-6);
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel > :last-child { margin-bottom: 0; }

/* Facts: label above value, which reads well at any width. */
.facts { margin: 0; }
.facts dt { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-muted); }
.facts dd { margin: 0 0 var(--space-4); overflow-wrap: anywhere; }
.facts dd:last-of-type { margin-bottom: 0; }

/* Form fields (design system Input), 16px text so phones do not zoom in. */
.field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
label { font-size: var(--text-body); font-weight: var(--weight-semibold); color: var(--text-primary); }
input[type='text'], textarea {
  width: 100%;
  min-height: var(--control-h-lg);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-p2);
  line-height: var(--leading-body);
}
textarea { min-height: 9rem; resize: vertical; }
input.mono, textarea.mono { font-family: var(--font-mono); font-size: var(--text-body); }
.code-input { max-width: 12rem; font-family: var(--font-mono); font-size: var(--text-sub2); letter-spacing: var(--tracking-wide); }
input[type='text']:hover, textarea:hover { border-color: var(--border-strong); }
input[type='text']:focus, textarea:focus { outline: 2px solid transparent; border-color: var(--accent); box-shadow: var(--focus-ring); }
input[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--danger); }

input[type='file'] { width: 100%; font-family: var(--font-sans); font-size: var(--text-body); color: var(--text-secondary); }
input[type='file']::file-selector-button {
  min-height: var(--control-h-lg);
  margin-right: var(--space-3);
  padding: 0 var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
input[type='file']::file-selector-button:hover { background: var(--bg-hover); border-color: var(--border-strong); }
input[type='file']:focus-visible { box-shadow: none; }
input[type='file']:focus-visible::file-selector-button { box-shadow: var(--focus-ring); border-color: var(--accent); }

/* "or" between the two ways to give the key. */
.or {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }

/* What the button will do, said just before it. */
.before-button { color: var(--text-secondary); }

/* Buttons (design system Button, large: 44px touch targets), full width in the column. */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--control-h-lg);
  padding: var(--space-2) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-sans);
  font-size: var(--text-p2);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-body);
  cursor: pointer;
}
.button:hover { background: var(--accent-hover); }
.button:active { background: var(--accent-active); transform: scale(0.98); }
.button-secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-default); box-shadow: var(--shadow-sm); }
.button-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.button-secondary:active { background: var(--bg-active); }

.secondary-action { padding-top: var(--space-2); }
.secondary-action p { color: var(--text-secondary); font-size: var(--text-body); }

/* Inline notice (design system alert tone) */
.notice {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--accent-soft-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--text-primary);
}
.notice-error { border-color: var(--danger); background: var(--danger-soft); }
.notice-success { border-color: var(--success); background: var(--success-soft); }

@media (max-width: 30rem) {
  .topbar { padding: var(--space-2) var(--space-4); }
  .logo-full { display: none; }
  .logo-mark { display: block; }
  .page { padding: var(--space-6) var(--space-4) var(--space-10); }
  h1 { font-size: var(--text-sub2); }
  .lede { font-size: var(--text-p2); }
  .panel { padding: var(--space-4); }
}
