/* =====================================================================
   Dynamic Fleet OS — Tenant Registration Landing
   Theme tokens mirror the Command Center admin panel design system.
   Dark is the canonical theme; a [data-theme] attribute on <html>
   switches palettes. All colors are CSS variables.
   ===================================================================== */

/* ---- Tokens -------------------------------------------------------- */
:root {
  /* Radii */
  --radius-sm: 0.375rem;   /* 6px  — pills, chips */
  --radius-md: 0.5rem;     /* 8px  — buttons */
  --radius: 0.625rem;      /* 10px — inputs / cards */
  --radius-lg: 0.75rem;    /* 12px — large cards / modals */
  --radius-xl: 1rem;

  /* Layout */
  --page-max-width: 1200px;
  --page-px: 1.5rem;

  /* Type */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
    Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Accent identity (shared across themes) */
  --accent: #22d3ee;       /* cyan-400 */
  --grad-start: #38bdf8;   /* sky-400  */
  --grad-end: #22d3ee;     /* cyan-400 */
}

/* Dark — canonical command-center palette (default) */
:root,
:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #080b12;
  --bg-grid: rgba(56, 189, 248, 0.05);
  --surface: #111621;
  --surface-2: #141a27;
  --elevated: #181e2c;
  --muted: #1c2331;
  --muted-fg: #94a3b8;
  --fg: #e8edf5;
  --fg-soft: #c3cad6;
  --border: #262f40;
  --border-strong: #364155;

  --primary: #38bdf8;            /* sky-400 */
  --primary-strong: #0ea5e9;
  --primary-fg: #08121e;
  --primary-soft: rgba(56, 189, 248, 0.14);

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.14);

  --shadow-card: 0 1px 0 0 rgba(255, 255, 255, 0.02) inset,
    0 1px 2px 0 rgba(0, 0, 0, 0.35);
  --shadow-elevated: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --glow: 0 12px 40px -12px rgba(56, 189, 248, 0.45);
  --nav-bg: rgba(8, 11, 18, 0.72);
}

/* Light — crisp white/gray, sky-blue primary */
:root[data-theme='light'] {
  color-scheme: light;

  --bg: #f6f8fb;
  --bg-grid: rgba(14, 165, 233, 0.06);
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --elevated: #ffffff;
  --muted: #f1f4f8;
  --muted-fg: #64748b;
  --fg: #0f172a;
  --fg-soft: #334155;
  --border: #e3e8ef;
  --border-strong: #cbd5e1;

  --primary: #0ea5e9;
  --primary-strong: #0284c7;
  --primary-fg: #ffffff;
  --primary-soft: rgba(14, 165, 233, 0.10);

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.10);

  --shadow-card: 0 1px 2px 0 rgba(15, 23, 42, 0.06),
    0 1px 3px 0 rgba(15, 23, 42, 0.08);
  --shadow-elevated: 0 24px 60px -28px rgba(15, 23, 42, 0.28);
  --glow: 0 16px 44px -16px rgba(14, 165, 233, 0.40);
  --nav-bg: rgba(246, 248, 251, 0.78);
}

/* ---- Reset / base -------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Ambient glows + faint grid that reads like the command center canvas */
  background-image:
    radial-gradient(60rem 40rem at 80% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(50rem 36rem at 0% 10%, var(--primary-soft), transparent 55%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

img, svg { display: block; }

::placeholder {
  color: var(--muted-fg);
  opacity: 0.75;
}

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ---- Layout helpers ------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding-inline: var(--page-px);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
}
.section-label::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--primary);
  opacity: 0.6;
}

/* =====================================================================
   Navbar
   ===================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  /* Dark tile so the white/blue eye mark reads on both light and dark themes. */
  background: #05080f;
  box-shadow: var(--glow);
  flex-shrink: 0;
  overflow: hidden;
  padding: 0.28rem;
}
.logo__mark svg { width: 1.25rem; height: 1.25rem; }
.logo__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo__title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.logo__sub {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme toggle switch */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 3.5rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  background: var(--muted);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.theme-toggle__thumb {
  position: absolute;
  top: 50%;
  left: 0.18rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 9999px;
  background-image: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: var(--primary-fg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
:root[data-theme='light'] .theme-toggle__thumb {
  transform: translate(1.65rem, -50%);
}
.theme-toggle__thumb svg { width: 0.85rem; height: 0.85rem; }
/* Show the right icon per theme */
.theme-toggle__thumb .icon-sun { display: none; }
.theme-toggle__thumb .icon-moon { display: block; }
:root[data-theme='light'] .theme-toggle__thumb .icon-sun { display: block; }
:root[data-theme='light'] .theme-toggle__thumb .icon-moon { display: none; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.7rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    filter 0.15s ease, background 0.15s ease, border-color 0.15s ease,
    color 0.15s ease;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.btn--primary {
  color: var(--primary-fg);
  background-image: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  box-shadow: var(--glow), inset 0 1px 0 0 rgba(255, 255, 255, 0.28);
}
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0) scale(0.99); }
.btn--ghost {
  color: var(--fg);
  background: var(--surface);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--border-strong); background: var(--muted); }
.btn--lg { padding: 0.9rem 1.6rem; font-size: 1rem; }
.btn--block { width: 100%; }
.btn__icon { width: 1.1rem; height: 1.1rem; }

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
  position: relative;
  padding-top: clamp(3.5rem, 8vw, 6.5rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero__copy { max-width: 38rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-soft);
  margin-bottom: 1.5rem;
}
.badge__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.65rem);
  font-weight: 800;
  margin-bottom: 1.1rem;
}
.hero h1 .accent {
  background-image: linear-gradient(120deg, var(--grad-start), var(--grad-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  color: var(--muted-fg);
  margin-bottom: 2rem;
  max-width: 34rem;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.25rem;
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.stat__value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.stat__label {
  font-size: 0.8rem;
  color: var(--muted-fg);
}

/* Hero visual — a floating "dashboard" glass panel */
.hero__visual { position: relative; }
.glass-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-elevated);
  padding: 1.25rem;
  overflow: hidden;
}
.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(30rem 16rem at 90% -20%, var(--primary-soft), transparent 60%);
  pointer-events: none;
}
.panel__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.panel__dot {
  width: 0.7rem; height: 0.7rem; border-radius: 9999px;
  background: var(--border-strong);
}
.panel__title {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-fg);
}
.panel__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.panel__tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 0.85rem;
}
.panel__tile .k {
  font-size: 0.7rem;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.panel__tile .v {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.25rem;
}
.panel__tile .v.up { color: var(--success); }
.panel__tile .v.accent { color: var(--primary); }
.panel__spark {
  grid-column: span 2;
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  height: 4.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 0.75rem;
}
.panel__spark span {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background-image: linear-gradient(180deg, var(--grad-start), var(--grad-end));
  opacity: 0.85;
  animation: grow 1.4s ease-out backwards;
}
@keyframes grow {
  from { transform: scaleY(0.15); transform-origin: bottom; opacity: 0.3; }
}

.hero__float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--elevated);
  box-shadow: var(--shadow-elevated);
  font-size: 0.82rem;
  font-weight: 600;
  animation: float 4s ease-in-out infinite;
}
.hero__float .ico {
  display: grid; place-items: center;
  width: 1.7rem; height: 1.7rem;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
}
.hero__float .ico svg { width: 1rem; height: 1rem; }
.hero__float--tl { top: 0.5rem; left: -1.25rem; }
.hero__float--br { bottom: 1rem; right: -1.25rem; animation-delay: -2s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* =====================================================================
   Features strip
   ===================================================================== */
.features { padding-block: clamp(2rem, 5vw, 3.5rem); }
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.feature:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: var(--glow);
}
.feature__icon {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 1rem;
}
.feature__icon svg { width: 1.4rem; height: 1.4rem; }
.feature h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature p { font-size: 0.92rem; color: var(--muted-fg); }

/* =====================================================================
   Registration
   ===================================================================== */
.register { padding-block: clamp(3rem, 7vw, 5rem); }
.register__inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.register__intro h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  margin-block: 1rem;
}
.register__intro p { color: var(--muted-fg); font-size: 1.02rem; max-width: 32rem; }
.checklist {
  list-style: none;
  padding: 0;
  margin: 1.75rem 0 0;
  display: grid;
  gap: 0.85rem;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.95rem;
  color: var(--fg-soft);
}
.checklist .check {
  display: grid; place-items: center;
  width: 1.4rem; height: 1.4rem;
  border-radius: 9999px;
  background: var(--success-soft);
  color: var(--success);
  flex-shrink: 0;
}
.checklist .check svg { width: 0.85rem; height: 0.85rem; }

/* Form card */
.form-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-elevated);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.form-card__header { margin-bottom: 1.5rem; }
.form-card__header h3 {
  font-size: 1.4rem;
  font-weight: 700;
}
.form-card__header p {
  font-size: 0.9rem;
  color: var(--muted-fg);
  margin-top: 0.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-soft);
}
.field label .req { color: var(--danger); margin-left: 0.15rem; }

.input {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input:hover { border-color: var(--border-strong); }
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea.input { min-height: 6.5rem; resize: vertical; }
.field__hint { font-size: 0.75rem; color: var(--muted-fg); }

.form-card__footer { margin-top: 1.5rem; }
.form-card__note {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: var(--muted-fg);
  text-align: center;
}

/* Submit button spinner */
.spinner {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Toggle label vs spinner via loading state */
.btn[data-loading='true'] .btn__label { display: none; }
.btn[data-loading='true'] .spinner { display: block; }
.btn .spinner { display: none; }
.btn[data-loading='true'] { cursor: progress; opacity: 0.85; }

/* Status message */
.form-status {
  display: none;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.form-status[data-show='true'] { display: flex; }
.form-status .status__icon { flex-shrink: 0; width: 1.2rem; height: 1.2rem; margin-top: 0.05rem; }
.form-status--success {
  background: var(--success-soft);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}
.form-status--error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

/* =====================================================================
   Footer
   ===================================================================== */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem;
}
.footer__copy { font-size: 0.85rem; color: var(--muted-fg); }
.footer__links { display: flex; gap: 1.25rem; }
.footer__links a {
  font-size: 0.85rem;
  color: var(--muted-fg);
  transition: color 0.15s ease;
}
.footer__links a:hover { color: var(--primary); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { display: none; }
  .register__inner { grid-template-columns: 1fr; }
  .features__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .field--half { grid-column: 1 / -1; }
  .hero__stats { gap: 1.5rem; }
  .logo__sub { display: none; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
