/* Owner-login modal chrome — single source for BOTH the unified SPA and the
   branded 404 "Enter" door (proposals/2026-06-06-app-route-removal-and-ck4o4-enter.md).
   These rules used to live inline in cko.css; they were factored out so the
   standalone 404 (which does NOT load the full cko.css design system) can render
   a byte-identical modal.

   Token strategy: every design token is referenced as `var(--cko-*, <fallback>)`.
   On the SPA, cko.css :root supplies the tokens (incl. dark mode) and wins. On
   the standalone 404 (no cko.css), the light-theme fallbacks below apply — the
   exact values from cko.css :root, so the modal looks identical in light mode.
   No :root redefinition here ⇒ zero risk of overriding cko.css theming. */

.cko-login-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: cko-fade 0.2s ease-out;
}
.cko-login-overlay.open { display: flex; }
.cko-login-card {
  position: relative;
  background: var(--cko-surface, oklch(100% 0 0));
  width: 100%;
  max-width: 380px;
  border-radius: var(--cko-r-lg, 20px);
  box-shadow: var(--cko-shadow-md, 0 4px 16px oklch(20% 0.02 50 / 0.08), 0 1px 3px oklch(20% 0.02 50 / 0.05));
  border: 1px solid var(--cko-border-sub, oklch(93% 0.01 75));
  padding: 26px 22px 22px;
  max-height: 92dvh;
  overflow-y: auto;
}
.cko-login-close {
  position: absolute;
  top: 12px; inset-inline-end: 12px;
  background: transparent; border: 0;
  color: var(--cko-text, oklch(18% 0.02 50)); opacity: 0.55;
  cursor: pointer; padding: 4px; border-radius: var(--cko-r-sm, 8px);
  display: inline-flex;
}
.cko-login-close:hover { opacity: 1; background: var(--cko-border-sub, oklch(93% 0.01 75)); }
.cko-login-title {
  margin: 0 0 8px;
  font-size: 19px; font-weight: 600;
  color: var(--cko-text, oklch(18% 0.02 50));
  text-align: center;
}
/* "Caeiro" in the title — the modal's accent (matches the Log in button; adapts
   per-tenant on the SPA). */
.cko-login-brand { color: var(--cko-accent, oklch(60% 0.14 38)); }
.cko-login-label {
  display: block;
  font-size: 13px;
  color: var(--cko-text, oklch(18% 0.02 50)); opacity: 0.62;
  margin: 14px 0 5px;
}
.cko-login-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--cko-border, oklch(89% 0.012 75));
  border-radius: var(--cko-r-md, 14px);
  background: var(--cko-bg, oklch(97% 0.012 75));
  color: var(--cko-text, oklch(18% 0.02 50));
  outline: none;
  font-family: inherit;
}
.cko-login-input:focus { border-color: var(--cko-accent, oklch(60% 0.14 38)); }
.cko-login-input.code { text-align: center; letter-spacing: 8px; font-size: 22px; }

/* Show/hide password toggle — sits inside the password field. Two SVGs (open
   eye / eye-with-slash); the `.revealed` class on the button swaps which shows. */
.cko-login-pass-wrap { position: relative; }
.cko-login-pass-wrap .cko-login-input { padding-inline-end: 44px; }
.cko-login-eye {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent; border: 0;
  padding: 6px; cursor: pointer;
  display: inline-flex; align-items: center;
  color: var(--cko-text, oklch(18% 0.02 50)); opacity: 0.5;
  border-radius: var(--cko-r-sm, 8px);
}
.cko-login-eye:hover { opacity: 0.9; }
.cko-login-eye .eye-hide { display: none; }
.cko-login-eye.revealed .eye-show { display: none; }
.cko-login-eye.revealed .eye-hide { display: inline-flex; }
.cko-login-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-size: 15px; font-weight: 600;
  border-radius: var(--cko-r-md, 14px);
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}
.cko-login-btn.primary { background: var(--cko-accent, oklch(60% 0.14 38)); color: var(--cko-on-accent, oklch(99% 0.005 75)); border-color: var(--cko-accent, oklch(60% 0.14 38)); }
.cko-login-btn.primary:hover { background: var(--cko-accent-hi, oklch(55% 0.16 38)); }
.cko-login-btn.ghost { background: transparent; color: var(--cko-accent, oklch(60% 0.14 38)); border-color: var(--cko-accent, oklch(60% 0.14 38)); margin-top: 0; }
/* Method toggle — segmented control (Password | WhatsApp). One panel shows at a
   time; the active tab gets a raised "pill" on the card surface. */
.cko-login-tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0 0;
  padding: 4px;
  background: var(--cko-bg, oklch(95% 0.012 75));
  border-radius: var(--cko-r-md, 14px);
}
.cko-login-tab {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: calc(var(--cko-r-md, 14px) - 4px);
  background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--cko-text, oklch(18% 0.02 50)); opacity: 0.6;
  cursor: pointer;
  transition: background .15s, opacity .15s, box-shadow .15s;
}
.cko-login-tab.active {
  background: var(--cko-surface, oklch(100% 0 0));
  opacity: 1;
  box-shadow: 0 1px 3px oklch(20% 0.02 50 / 0.10);
}
/* Morphing slot — a FIXED height so the modal never resizes/jumps when the top
   element swaps between password input / send-code button / code input. Exactly
   one item shows at a time; visibility is class-driven (never the `hidden`
   attribute, which loses to any display rule). Each item fills the slot, so all
   three states are pixel-identical in height. */
.cko-login-slot { height: 48px; margin-top: 18px; }
.cko-login-slot-item { display: none; width: 100%; height: 100%; margin: 0; box-sizing: border-box; }
.cko-login-slot-item.is-active { display: block; }
.cko-login-pass-wrap.cko-login-slot-item { position: relative; }
.cko-login-pass-wrap.cko-login-slot-item .cko-login-input { height: 100%; }
.cko-login-btn:disabled { opacity: 0.45; cursor: default; }
.cko-login-msg { margin: 4px 0 0; padding: 9px 12px; border-radius: var(--cko-r-md, 14px); font-size: 14px; }
.cko-login-msg.err { background: oklch(95% 0.04 25); color: oklch(45% 0.18 25); }
.cko-login-msg.ok  { background: oklch(95% 0.06 150); color: oklch(40% 0.12 150); }

/* Defined in cko.css too (used widely there); duplicated here so the standalone
   404 — which loads only this file — still has the fade. Identical keyframe. */
@keyframes cko-fade { from { opacity: 0; } to { opacity: 1; } }
