/* ============================================================================
   OrgOS.now — Official Verdant White Core Design System
   Harbor Floating Architecture + Orion Advisory Editorial Discipline
   ZERO PILLS · Architectural 6px–10px Radii · Circles Reserved Exclusively for ORBs
   ============================================================================ */

:root {
  --font-sans: 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Fraunces', 'New York', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Verdant White Core Surfaces (Harbor Architecture) */
  --canvas-frame: #0B7A54;
  --bg-app: #F3F6F5;
  --bg-canvas: #F7F9F7;
  --bg-sidebar: #F9FBFA;
  --surface: #FFFFFF;
  --surface-2: #EEF3F0;
  --surface-tint: #E5F1EB;

  /* Ink */
  --ink: #071E17;
  --ink-2: #2A4038;
  --ink-3: #587268;
  --ink-4: #7E968C;

  /* Hairlines */
  --line: #E3EAE6;
  --line-strong: #CFDAD4;

  /* Botanical Emerald Signature */
  --emerald-deep: #064E3B;
  --emerald: #059669;
  --emerald-mid: #10B981;
  --emerald-bright: #34D399;
  --emerald-bio: #10E89A;
  --emerald-soft: #E1F6EC;
  --emerald-ink: #046C4E;

  /* Semantic Status */
  --ok: #059669;
  --ok-bg: #E1F6EC;
  --warn: #B45309;
  --warn-bg: #FEF3C7;
  --err: #B91C1C;
  --err-bg: #FEE2E2;

  /* Dark Contrast Fold */
  --dark-void: #061410;
  --dark-panel: #0B1F19;

  /* Strict Architectural Geometry (ZERO PILLS) */
  --r-frame: 22px;
  --r-card: 12px;
  --r-ui: 6px;
  --r-tag: 5px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

.font-serif-soft {
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.font-mono { font-family: var(--font-mono); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dashFlow {
  to { stroke-dashoffset: -120; }
}
@keyframes marqueeRun {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes shimmerSweep {
  0% { transform: translateX(-140%) skewX(-22deg); }
  38%, 100% { transform: translateX(260%) skewX(-22deg); }
}

/* ============================================================================
   HARBOR RADIANT VERDANT BACKDROP + FLOATING WHITE FRAME
   ============================================================================ */
.os-shell-backdrop {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(92% 72% at 0% 0%, #34D399 0%, transparent 56%),
    radial-gradient(75% 65% at 100% 100%, #064E3B 0%, transparent 72%),
    linear-gradient(145deg, #0E8F64 0%, #057452 52%, #064E3B 100%);
}
.os-shell-backdrop::before,
.os-shell-backdrop::after {
  content: '';
  position: fixed;
  width: 46vw;
  aspect-ratio: 1;
  border-radius: 10%;
  background: rgba(255, 255, 255, 0.075);
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 0;
}
.os-shell-backdrop::before { top: -18vw; left: 28vw; }
.os-shell-backdrop::after { bottom: -32vw; right: -10vw; }

.os-frame {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  background: var(--bg-app);
}
@media (min-width: 960px) {
  .os-shell-backdrop { padding: 20px; }
  .os-frame {
    min-height: calc(100dvh - 40px);
    max-width: 1520px;
    margin-inline: auto;
    border-radius: var(--r-frame);
    overflow: hidden;
    box-shadow: 0 32px 84px -30px rgba(4, 30, 22, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.45);
  }
}

/* ============================================================================
   ARCHITECTURAL BUTTONS & ZERO-PILL TAGS
   ============================================================================ */
.os-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-ui);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 150ms var(--ease), box-shadow 180ms ease, border-color 160ms ease, background-color 160ms ease;
}
.os-btn:hover { border-color: var(--emerald); background: var(--bg-canvas); }
.os-btn:active { transform: scale(0.985); }

.os-btn-primary {
  border-color: #047857;
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 1px 3px rgba(5, 118, 82, 0.32), 0 8px 20px -8px rgba(5, 150, 105, 0.45);
}
.os-btn-primary:hover {
  border-color: #065F46;
  background: linear-gradient(180deg, #12C489 0%, #059669 100%);
  transform: translateY(-1px);
}
.os-btn-primary .sheen {
  position: absolute;
  inset: 0;
  width: 44%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-140%) skewX(-22deg);
  animation: shimmerSweep 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

.os-btn-forest {
  border-color: var(--ink);
  background: var(--ink);
  color: #F4FAF7;
}
.os-btn-forest:hover { background: #0C3126; border-color: #0C3126; color: #FFFFFF; transform: translateY(-1px); }

.os-btn-full { width: 100%; height: 42px; font-size: 13.5px; }

/* Strict Anti-Pill Tag (5px Sharp Architectural Corner + Micro Square LED) */
.os-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--r-tag);
  border: 1px solid var(--line);
  background: var(--bg-canvas);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.os-tag .led {
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--emerald-mid);
  box-shadow: 0 0 7px rgba(16, 185, 129, 0.65);
}
.os-tag[data-tone="ok"] { background: var(--ok-bg); border-color: rgba(5, 150, 105, 0.22); color: var(--emerald-ink); }
.os-tag[data-tone="warn"] { background: var(--warn-bg); border-color: rgba(180, 83, 9, 0.22); color: var(--warn); }
.os-tag[data-tone="warn"] .led { background: #D97706; box-shadow: none; }
.os-tag[data-tone="idle"] { background: var(--surface-2); border-color: var(--line); color: var(--ink-3); }
.os-tag[data-tone="idle"] .led { background: #94A3B8; box-shadow: none; }

/* Eyebrow — Pure Typography (Zero Pills) */
.os-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--emerald);
}
.os-eyebrow-bar {
  width: 20px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--emerald-deep), var(--emerald-mid));
}

/* Panels & Form Fields */
.os-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
}

.os-field { display: grid; gap: 6px; }
.os-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.os-input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: var(--r-ui);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.os-input:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

/* Harbor Split-Screen Auth Layout */
.os-auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.os-auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1020px;
  min-height: 620px;
  display: grid;
  grid-template-columns: 1fr 1.02fr;
  border-radius: var(--r-frame);
  background: var(--bg-app);
  overflow: hidden;
  box-shadow: 0 34px 86px -30px rgba(4, 30, 22, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.45);
  animation: fadeUp 320ms var(--ease) both;
}
@media (max-width: 860px) {
  .os-auth-card { grid-template-columns: 1fr; min-height: auto; }
  .os-auth-vitrine { display: none !important; }
}
.os-auth-form-col {
  background: var(--surface);
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.os-auth-vitrine {
  margin: 12px;
  border-radius: 14px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(85% 70% at 0% 0%, #34D399 0%, transparent 58%),
    radial-gradient(75% 70% at 100% 100%, #064E3B 0%, transparent 72%),
    #059669;
}

/* Floating Harbor Vitrine Cards */
.vitrine-stage {
  position: relative;
  width: min(390px, 100%);
  aspect-ratio: 1 / 1.06;
}
.vitrine-card {
  position: absolute;
  display: grid;
  gap: 5px;
  padding: 18px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 52px -22px rgba(4, 38, 28, 0.55);
  animation: fadeUp 650ms var(--ease) both;
}
.vitrine-card span.k { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.vitrine-a { inset: 0 10% auto 0; }
.vitrine-b { inset: auto 0 0 42%; justify-items: center; text-align: center; animation-delay: 120ms; }
.vitrine-c { inset: 48% auto auto 0; width: 42%; animation-delay: 220ms; }

/* OTP 6-digit architectural input boxes */
.otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.otp-digit {
  height: 48px;
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  border-radius: var(--r-ui);
  border: 1px solid var(--line-strong);
  background: var(--bg-canvas);
  color: var(--ink);
  transition: all 140ms ease;
}
.otp-digit:focus {
  outline: none;
  border-color: var(--emerald);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.16);
}

/* Orbital SVG helpers */
.connector-flow { stroke-dasharray: 7 18; animation: dashFlow 2.6s linear infinite; }
.orb-node { cursor: pointer; }

/* Toast */
.os-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 120;
  padding: 11px 16px;
  border-radius: var(--r-ui);
  background: var(--dark-void);
  color: #F4FAF7;
  border: 1px solid var(--emerald-mid);
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: 0 18px 42px rgba(4, 24, 18, 0.35);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 200ms var(--ease);
}
.os-toast.show { opacity: 1; transform: translateY(0); }
