/* ZigZag B2B Portal — synthesized from site + site-recycling + site-moving family tokens */
/* Accent shell: navy · per-vertical ribbons map to Junk / Recycling / Moving marketing brands */

:root {
  /* Portal shell (neutral) */
  --color-portal-chrome: #0f172a;
  --color-portal-on-chrome: #f8fafc;
  --color-portal-muted-on-chrome: #cbd5e1;

  --color-bg: #fafaf5;
  --color-surface: #ffffff;
  --color-surface-2: #f4f4ef;
  --color-text: #0a0a0a;
  --color-text-body: #3f3f46;
  --color-text-muted: #71717a;
  --color-border: #e6e6e0;

  /* Operational primary (interactive on light surfaces — stays navy family) */
  --color-accent: #0f172a;
  --color-accent-hover: #1e293b;
  --color-accent-soft: rgba(15, 23, 42, 0.08);
  --color-accent-text: #fafaf5;

  --vertical-junk: #ffc700;
  --vertical-recycling: #16a34a;
  --vertical-moving: #2563eb;
  --color-accent-vertical: var(--vertical-junk);

  --color-ink: #0a0a0a;
  --color-ink-2: #171717;
  --color-on-ink: #fafaf5;
  --color-on-ink-muted: #a3a3a3;

  --color-success: #15803d;
  --color-success-bg: #ecfdf5;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  --container-max: 1200px;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-md: 0 4px 16px rgba(10, 10, 10, 0.06), 0 1px 3px rgba(10, 10, 10, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 10, 10, 0.1), 0 2px 8px rgba(10, 10, 10, 0.05);

  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 380ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --font-sans: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: Lexend, var(--font-sans);

  --z-nav: 50;
  --z-toast: 100;
}

[data-zzp-vertical="junk"] {
  --color-accent-vertical: var(--vertical-junk);
}
[data-zzp-vertical="recycling"] {
  --color-accent-vertical: var(--vertical-recycling);
}
[data-zzp-vertical="moving"] {
  --color-accent-vertical: var(--vertical-moving);
}

/* Theme: booking + marketing surfaces default light; operator may force dark */

:root.portal-operator-shell[data-portal-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-2: #334155;
  --color-text: #f8fafc;
  --color-text-body: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-border: #334155;

  --color-accent-soft: rgba(248, 250, 252, 0.08);

  --color-success-bg: #0f1f14;
  --color-error-bg: #2a1414;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root[data-portal-theme="system"].portal-operator-shell {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-2: #334155;
    --color-text: #f8fafc;
    --color-text-body: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-border: #334155;

    --color-accent-soft: rgba(248, 250, 252, 0.08);

    --color-success-bg: #0f1f14;
    --color-error-bg: #2a1414;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}

/* Segmented vertical switch — ≥44px hit targets */
.zzp-vertical-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.zzp-vertical-switch__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-portal-muted-on-chrome, var(--color-text-muted));
  margin-right: var(--space-2);
}

.zzp-vertical-switch__group {
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
}

.landing-brand .zzp-vertical-switch__group {
  background: rgba(15, 23, 42, 0.06);
}

.landing-brand .zzp-vertical-switch button.zzp-vertical-switch__active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-portal-chrome);
  border-color: var(--color-accent-vertical);
}

.zzp-vertical-switch button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-sm);
  color: inherit;
  background: transparent;
  transition: background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.zzp-vertical-switch button:focus-visible {
  outline: 2px solid var(--color-accent-vertical);
  outline-offset: 2px;
}

.zzp-vertical-switch button.zzp-vertical-switch__active {
  background: rgba(248, 250, 252, 0.15);
  border-color: var(--color-accent-vertical);
}

.zzp-vertical-switch button[data-vertical="junk"].zzp-vertical-switch__active {
  border-color: var(--vertical-junk);
}
.zzp-vertical-switch button[data-vertical="recycling"].zzp-vertical-switch__active {
  border-color: var(--vertical-recycling);
}

/* --- transient toasts (shared across portal roles) --- */
.zzp-toast-host {
  position: fixed;
  inset: auto 1rem 1rem auto;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(440px, 100vw - 2rem);
  pointer-events: none;
}

.zzp-toast {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-body);
  border: 1px solid var(--color-border);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  font-size: var(--text-sm);
}

.zzp-toast-error {
  border-color: #fecaca;
  background: var(--color-error-bg);
  color: var(--color-error);
}

.zzp-toast-success {
  border-color: var(--vertical-recycling);
  background: var(--color-success-bg);
}

.zzp-toast-hide {
  opacity: 0;
  transition: opacity 280ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .zzp-toast-hide {
    transition-duration: 0.01ms;
  }
}

/* --- Canonical ZigZag glyph tile (lightning-bolt-Z, marketing parity) --- */
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-portal-chrome);
  color: #fafaf5;
  flex-shrink: 0;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.brand-mark svg {
  width: 22px;
  height: 28px;
  display: block;
}

.brand-mark.brand-mark-sm {
  width: 32px;
  height: 32px;
}

.brand-mark.brand-mark-sm svg {
  width: 18px;
  height: 22px;
}

/* Vertical-aware tinting: when a vertical context is active, glyph tile flips
   to that vertical's accent (driven by the [data-zzp-vertical] dataset that
   portal-context.js writes onto <html>). */
:root[data-zzp-vertical="junk"] .brand-mark.brand-mark-vertical {
  background: var(--vertical-junk);
  color: #0a0a0a;
}

:root[data-zzp-vertical="recycling"] .brand-mark.brand-mark-vertical {
  background: var(--vertical-recycling);
  color: #ffffff;
}

:root[data-zzp-vertical="moving"] .brand-mark.brand-mark-vertical {
  background: var(--vertical-moving);
  color: #ffffff;
}

.brand-wordmark {
  font-family: var(--font-display, "Lexend"), system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.005em;
  color: inherit;
}
