:root {
  /* Kcell brand — extracted from "Kcell_template 2026.pptx" */
  --color-brand-purple: #652d86;
  --color-brand-purple-deep: #5e2883;
  --color-brand-purple-mid: #6e3193;
  --color-brand-magenta: #de1b58;
  --color-brand-magenta-deep: #c6003e;
  --color-brand-lime: #b4d335;
  --color-brand-canvas: #e9ebf5;
  --color-brand-slate: #44546a;

  --color-canvas: var(--color-brand-canvas);
  --color-surface: #ffffff;
  --color-surface-subtle: #f3f4fa;
  --color-surface-muted: #dde1ee;
  --color-ink: #000000;
  --color-ink-soft: var(--color-brand-slate);
  --color-muted: #6b7285;
  --color-border: #d0d5e4;
  --color-border-strong: #b4bbd0;
  --color-accent: var(--color-brand-purple);
  --color-accent-strong: var(--color-brand-purple-deep);
  --color-accent-soft: #f1e8f6;
  --color-on-accent: #ffffff;
  --color-success: #5c7a12;
  --color-success-soft: #f2f7d6;
  --color-warning: #8a5a00;
  --color-warning-soft: #f7edd3;
  --color-danger: var(--color-brand-magenta-deep);
  --color-danger-soft: #fce8ef;
  --color-info: var(--color-brand-purple-mid);
  --color-info-soft: #f1e8f6;
  --color-highlight: var(--color-brand-magenta);
  --color-highlight-soft: #fce8ef;
  --color-positive: var(--color-brand-lime);

  /* Shared semantic aliases. Components may use these names without inventing a local palette. */
  --color-background: var(--color-canvas);
  --color-surface-raised: var(--color-surface);
  --color-text: var(--color-ink);
  --color-text-muted: var(--color-muted);
  --color-accent-hover: var(--color-accent-strong);

  /*
    Deck fonts: Pragmatica / Effra / Gotham Book.
    Inter is the licensed-web fallback when brand fonts are not installed on the device.
  */
  --font-sans: "Pragmatica", "Effra", "Gotham Book", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Pragmatica Light", "Pragmatica", "Effra-Light", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(101, 45, 134, .08);
  --shadow-2: 0 12px 28px rgba(101, 45, 134, .12);
  --focus-ring: 0 0 0 3px rgba(101, 45, 134, .22);
  --content-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
*[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  font-family: var(--font-sans);
  color: var(--color-ink);
  background: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}
h1, h2, h3, .auth-gate-card h2 {
  font-family: var(--font-display);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
:where(a, button, input, select, textarea):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(101, 45, 134, .28);
  color-scheme: light;
}
.auth-gate[hidden] { display: none; }
.auth-gate-card {
  width: min(100%, 640px);
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-2);
}
.auth-login-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  margin: var(--space-7) 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}
.auth-login-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  min-height: 0;
}
.auth-login-pane-link {
  justify-content: center;
  border-right: 1px solid var(--color-border);
}
.auth-login-pane-label {
  margin: 0 !important;
  color: var(--color-ink-soft) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-login-pane-qr {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.auth-login-pane-qr canvas {
  width: 132px;
  height: 132px;
  display: block;
}
.auth-login-qr-hint {
  color: var(--color-ink-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.auth-login-row[hidden],
.auth-login-pane[hidden] { display: none !important; }
@media (max-width: 640px) {
  .auth-login-row { grid-template-columns: 1fr; }
  .auth-login-pane-link { border-right: 0; border-bottom: 1px solid var(--color-border); }
}
.auth-gate-card h2 {
  margin: var(--space-3) 0 var(--space-3);
  color: var(--color-ink);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.auth-gate-card p { color: var(--color-ink-soft); line-height: 1.55; }
.auth-eyebrow, .auth-gate .eyebrow {
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.bot-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .16s ease;
}
.bot-login:hover { background: var(--color-accent-strong); }
.bot-login[aria-disabled="true"] { pointer-events: none; opacity: .58; }
.bot-login-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
}
.bot-login-arrow { opacity: .75; font-size: 14px; }
.auth-gate-status { min-height: 22px; margin: 0 0 var(--space-2) !important; font-size: 13px; color: var(--color-accent) !important; font-weight: 700; }
.auth-gate-error { min-height: 24px; margin: var(--space-3) 0; color: var(--color-danger) !important; font-weight: 700; }
.auth-gate-note { margin-bottom: 0; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
