/* UI tokens + accessibility defaults (Wise-inspired, not copied) */
/* This file is intentionally plain CSS (served by Propshaft) so it is easy to revert. */

:root {
  /* Tell the browser we support both schemes; actual colors come from tokens. */
  color-scheme: light;

  /* Global chrome */
  --app-header-height: 64px;

  /* Typography */
  --ui-font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --ui-font-display: "Archivo Black", var(--ui-font-sans);

  /* Surfaces (light) */
  --bg: #f5f5f0;
  --surface: #e8ebe4; /* sage/gray: Wise-inspired container background */
  --surface2: #ecefec; /* cards float on surface */
  --surface2-hover: #e1e5de; /* card hover state */
  --border: #d4d9ce;

  /* Text (light) */
  --text: #0b1220;
  --muted: #44506a;
  --subtle: #6b7280;

  /* Brand (core blue) */
  --primary: var(--core-ocean-blue);
  --primary_hover: color-mix(in oklab, var(--primary) 85%, black);
  --primary_active: color-mix(in oklab, var(--primary) 70%, black);
  --primary_fg: var(--core-bright-blue);
  --link: var(--core-ocean-blue);
  --button-secondary-text: var(--core-ocean-blue);

  /* States */
  --success: #067a5c;
  --success_fg: #ffffff;
  --warning: #b45309;
  --warning_fg: #ffffff;
  --danger: #b42318;
  --danger_fg: #ffffff;
  --status-in-stock: #2563eb;
  --status-listed: #6366f1;
  --status-sold: var(--success);
  --status-defective: var(--danger);

  /* Bright accent colors for status bars (light mode) */
  --bright-orange: #FFC091;
  --bright-yellow: #FFEB69;
  --bright-blue: #A0E1E1;
  --bright-pink: #FFD7EF;

  /* Focus: must stay visible on both light and dark surfaces */
  --focus_ring: #3080ff; /* close to Tailwind blue-500 */
  --focus_ring_offset: #ffffff;

  /* Padding tokens */
  --padding-x-small: 8px;
  --padding-small: 16px;
  --padding-medium: 24px;
  --padding-large: 32px;

  /* Size tokens */
  --size-x-small: 24px;
  --size-medium: 40px;
  --size-large: 48px;
  --size-x-large: 56px;
  --size-2x-large: 72px;

  /* Radius tokens (desktop scale) */
  --radius-small: 16px;
  --radius-medium: 20px;
  --radius-large: 30px;
  --radius-x-large: 40px;
  --radius-2x-large: 60px;

  /* Shadow tokens */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);

  /* Foundational spacing tokens */
  --size-4: 4px;
  --size-8: 8px;
  --size-12: 12px;
  --size-16: 16px;
  --size-24: 24px;
  --size-32: 32px;
  --size-40: 40px;
  --size-48: 48px;
  --size-56: 56px;
  --size-64: 64px;
  --size-72: 72px;
  --size-80: 80px;
  --size-88: 88px;
  --size-96: 96px;
  --size-104: 104px;
  --size-112: 112px;
  --size-120: 120px;
  --size-128: 128px;
}

html[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces (dark) */
  --bg: #121511;
  --surface: #1a1d18; /* darker container */
  --surface2: #292d29; /* cards */
  --surface2-hover: #404441; /* card hover state */
  --border: #2e332b;

  /* Text (dark) */
  --text: #e6eaf2;
  --muted: #b8c0d4;
  --subtle: #95a0b8;

  /* Brand (core blue) */
  --primary: var(--core-bright-blue);
  --primary_fg: var(--core-ocean-blue);
  --link: var(--core-bright-blue);
  --button-secondary-text: var(--core-bright-blue);

  /* States */
  --success: #34d399;
  --success_fg: #071215;
  --warning: #fbbf24;
  --warning_fg: #141106;
  --danger: #fb7185;
  --danger_fg: #1a0c10;
  --status-in-stock: #3b82f6;
  --status-listed: #818cf8;
  --status-sold: var(--success);
  --status-defective: var(--danger);

  /* Bright accent colors for status bars (dark mode)
     Use same bright colors as light mode for visibility */
  --bright-orange: #FFC091;
  --bright-yellow: #FFEB69;
  --bright-blue: #A0E1E1;
  --bright-pink: #FFD7EF;

  --focus_ring: #60a5fa;
  --focus_ring_offset: #070b12;

  /* Shadow tokens (dark mode - slightly more visible) */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.16);
}

@media (max-width: 767px) {
  :root {
    /* Radius tokens (mobile scale) */
    --radius-small: 10px;
    --radius-medium: 16px;
    --radius-large: 24px;
    --radius-x-large: 32px;
    --radius-2x-large: 48px;
  }
}

html {
  font-family: var(--ui-font-sans);
}

/* Grid container (Wise-like margins) */
.ds-grid-container {
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: 20px;
}

@media (min-width: 480px) {
  .ds-grid-container {
    padding-inline: 32px;
  }
}

@media (min-width: 768px) {
  .ds-grid-container {
    padding-inline: 40px;
  }
}

@media (min-width: 992px) {
  .ds-grid-container {
    padding-inline: 80px;
  }
}

@media (min-width: 1200px) {
  .ds-grid-container {
    padding-inline: 100px;
  }
}

/* Typography foundations helpers */
.design-typography__display {
  font-family: var(--ui-font-display);
  letter-spacing: 0.01em;
}

/* Title Screen: Main page title (30px, semibold, -2.5% tracking, 34px line-height) */
.ds-title-screen {
  font-size: 30px;
  font-weight: 600;
  line-height: 34px;
  letter-spacing: -0.025em;
  color: var(--text);
}

/* Title Section: Section headings (26px, semibold, -1.5% tracking) */
.ds-title-section {
  font-size: 26px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: -0.015em;
  color: var(--text);
}

/* Title Subsection: Subsection headings (22px, semibold, -1.5% tracking) */
.ds-title-subsection {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.015em;
  color: var(--text);
}

/* Title Body: Body headings (18px, semibold, -1% tracking) */
.ds-title-body {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Padding tokens helpers */
.ui-padding-x-small {
  padding: var(--padding-x-small);
}

.ui-padding-small {
  padding: var(--padding-small);
}

.ui-padding-medium {
  padding: var(--padding-medium);
}

.ui-padding-large {
  padding: var(--padding-large);
}

/* Size tokens helpers */
.ui-size-x-small {
  width: var(--size-x-small);
  height: var(--size-x-small);
}

.ui-size-medium {
  width: var(--size-medium);
  height: var(--size-medium);
}

.ui-size-large {
  width: var(--size-large);
  height: var(--size-large);
}

.ui-size-x-large {
  width: var(--size-x-large);
  height: var(--size-x-large);
}

.ui-size-2x-large {
  width: var(--size-2x-large);
  height: var(--size-2x-large);
}

.ui-size-circle {
  border-radius: 9999px;
  background: color-mix(in oklab, var(--primary) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--primary) 35%, transparent);
}

/* Radius helpers */
.ui-radius-small {
  border-radius: var(--radius-small);
}

.ui-radius-medium {
  border-radius: var(--radius-medium);
}

.ui-radius-large {
  border-radius: var(--radius-large);
}

.ui-radius-x-large {
  border-radius: var(--radius-x-large);
}

.ui-radius-2x-large {
  border-radius: var(--radius-2x-large);
}

/* Focus ring helper */
.ui-focus-ring:focus-visible {
  outline: 2px solid var(--focus_ring);
  outline-offset: 2px;
}

/* Form controls */
.ui-input {
  display: flex;
  align-items: center;
  gap: var(--size-8);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: var(--size-8) var(--padding-small);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ui-input:focus-within {
  border-color: var(--focus_ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--focus_ring) 35%, transparent);
}

.ui-input__field {
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--text);
}

.ui-input__field:focus-visible {
  outline: none;
}

.ui-input__field::placeholder {
  color: var(--subtle);
}

.ui-control {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: var(--size-8) var(--padding-small);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ui-control:focus-visible {
  outline: 2px solid var(--focus_ring);
  outline-offset: 2px;
  border-color: var(--focus_ring);
}

.ui-button-danger {
  background: var(--danger);
  color: var(--danger_fg);
  border: 1px solid color-mix(in oklab, var(--danger) 80%, transparent);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.ui-button-danger:hover {
  background: color-mix(in oklab, var(--danger) 85%, black);
  border-color: color-mix(in oklab, var(--danger) 85%, black);
}

body {
  background: var(--bg);
  color: var(--text);
}

/* Account menu (avatar dropdown) */
.account-menu__panel {
  /* Ensure the dropdown never becomes transparent, even if utility classes change */
  background-color: var(--surface2) !important;
}

.account-menu__panel a.account-menu__item,
.account-menu__panel a.account-menu__item:hover,
.account-menu__panel a.account-menu__item:focus,
.account-menu__panel a.account-menu__item:active {
  /* Prevent global link styling (blue + underline) inside dropdown rows */
  color: inherit;
  text-decoration: none;
}

.account-menu__item {
  /* Make anchors look like the other dropdown "buttons" */
  color: var(--text);
  text-decoration: none;
}

.account-menu__trigger:hover,
.account-menu__trigger:focus-visible,
.account-menu__trigger[aria-expanded="true"] {
  /* Match the desktop sidebar active highlight */
  background-color: color-mix(in oklab, var(--primary) 10%, transparent) !important;
}

.account-menu__item:hover,
.account-menu__item:focus-visible {
  /* Same hover behavior as sidebar items */
  background-color: color-mix(in oklab, var(--primary) 10%, transparent);
}

.account-menu__icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.account-menu__icon {
  display: block;
  color: var(--muted);
  align-self: center;
}

.account-menu__item:hover .account-menu__icon,
.account-menu__item:focus-visible .account-menu__icon {
  color: var(--primary);
}

.inventory-status__modal-overlay {
  background-color: rgba(0, 0, 0, 0.6);
}

.inventory-status__modal-panel {
  background-color: var(--surface2) !important;
}

.inventory-table__grid {
  display: grid;
  grid-template-columns: 36px minmax(200px, 2.8fr) minmax(80px, 0.7fr) minmax(110px, 0.85fr) minmax(90px, 0.7fr) 28px;
  gap: 10px;
  align-items: center;
}

.inventory-table__frame {
  background: var(--surface2);
  box-shadow: var(--shadow-card);
  padding: 8px;
  border-radius: 24px;
}

.inventory-table__card {
  background: var(--surface2);
  border-radius: 18px;
  overflow: hidden;
}

.inventory-table__header {
  background-color: transparent;
}

.inventory-table__row {
  position: relative;
}

.inventory-table__separator {
  height: 1px;
  margin: 0 22px;
  background-color: color-mix(in oklab, var(--text) 12%, transparent);
}

.inventory-table__card > turbo-frame:last-child .inventory-table__separator {
  display: none;
}

.inventory-table__row::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 6px;
  bottom: 6px;
  border-radius: 16px;
  background-color: transparent;
  transition: background-color 150ms ease;
  pointer-events: none;
  z-index: 0;
}

.inventory-table__row > .inventory-table__grid {
  position: relative;
  z-index: 1;
}

.inventory-table__row:hover::after,
.inventory-table__row:focus-visible::after {
  background-color: color-mix(in oklab, var(--primary) 10%, transparent);
}

.status-bar__fill {
  background-color: var(--status-in-stock);
}

.status-bar__fill--in_stock {
  background-color: var(--status-in-stock);
}

.status-bar__fill--listed {
  background-color: var(--status-listed);
}

.status-bar__fill--sold {
  background-color: var(--status-sold);
}

.status-bar__fill--defective {
  background-color: var(--status-defective);
}

.peer:checked + .status-pill--in_stock {
  background-color: var(--status-in-stock);
  border-color: transparent;
  color: var(--text);
}

.peer:checked + .status-pill--listed {
  background-color: var(--status-listed);
  border-color: transparent;
  color: var(--text);
}

.peer:checked + .status-pill--sold {
  background-color: var(--status-sold);
  border-color: transparent;
  color: var(--text);
}

.peer:checked + .status-pill--defective {
  background-color: var(--status-defective);
  border-color: transparent;
  color: var(--text);
}

.status-badge {
  color: var(--text);
}

.status-badge--in_stock {
  background-color: var(--status-in-stock);
  border-color: transparent;
  color: var(--text);
}

.status-badge--listed {
  background-color: var(--status-listed);
  border-color: transparent;
  color: var(--text);
}

.status-badge--sold {
  background-color: var(--status-sold);
  border-color: transparent;
  color: var(--text);
}

.status-badge--defective {
  background-color: var(--status-defective);
  border-color: transparent;
  color: var(--text);
}

.account-menu__segment[aria-checked="true"] .account-menu__icon {
  color: var(--text);
}

.account-menu__segment:hover .account-menu__icon,
.account-menu__segment:focus-visible .account-menu__icon {
  color: var(--primary);
}

/* Segmented control (Wise-ish) used inside account menu */
.account-menu__segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  height: 40px;
  min-width: 170px;
  padding: 4px;
  border-radius: 9999px;
  background: color-mix(in oklab, var(--text) 8%, transparent);
  overflow: hidden;
}

.account-menu__theme-row:hover .account-menu__segmented,
.account-menu__theme-row:focus-within .account-menu__segmented {
  /* Hover highlight should be on the pill itself (Wise-like), not on a square row */
  background: color-mix(in oklab, var(--text) 12%, transparent);
}

.account-menu__segmented::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 9999px;
  background: var(--surface2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.account-menu__segmented[data-active="dark"]::before,
html[data-theme="dark"] .account-menu__segmented::before {
  transform: translateX(100%);
}

.account-menu__segment {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  padding: 0;
  border: none;
  outline: none;
}

.account-menu__segmented--menu {
  width: 100%;
  min-width: 0;
  /* Base segmented has 4px padding, so make the content box 36px tall:
     44px total height - 8px padding = 36px (matches .account-menu__icon-wrap) */
  height: 44px;
}

.account-menu__segmented[data-active="light"] .account-menu__segment:first-child,
html[data-theme="light"] .account-menu__segment:first-child {
  color: var(--text);
}

.account-menu__segmented[data-active="dark"] .account-menu__segment:last-child,
html[data-theme="dark"] .account-menu__segment:last-child {
  color: var(--text);
}

.account-menu__segment:focus-visible {
  outline: 2px solid var(--focus_ring);
  outline-offset: 2px;
}

/* Links */
a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: underline;
}

/* Sidebar should NOT look like a regular "link list" (no underline, no link-blue). */
.desktop-sidebar a,
.desktop-sidebar a:hover,
.desktop-sidebar a:focus,
.desktop-sidebar a:active,
.mobile-bottom-nav a,
.mobile-bottom-nav a:hover,
.mobile-bottom-nav a:focus,
.mobile-bottom-nav a:active {
  text-decoration: none;
}

/* Theme toggle icon swapping (works without JS too) */
.theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* Header logo swapping */
.logo-dark {
  display: none;
}

html[data-theme="dark"] .logo-dark {
  display: block;
}

html[data-theme="dark"] .logo-light {
  display: none;
}

/* Lucro wordmark */
.lucro-logo-text {
  font-family: var(--ui-font-display);
  font-style: normal;
  font-weight: 800;
  font-size: 24px;
  line-height: 24px;
  height: 24px;
  display: block;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--core-ocean-blue);
}

html[data-theme="dark"] .lucro-logo-text {
  color: var(--core-bright-blue);
}

/* Avatar (Wise-inspired) */
.ui-avatar {
  position: relative;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  overflow: hidden;
}

.ui-avatar--interactive {
  cursor: pointer;
}

.ui-avatar--borderless {
  border: none;
}

.ui-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.2);
  transform-origin: center;
  border-radius: 9999px;
  display: block;
}

.ui-avatar__text {
  font-size: var(--avatar-text-size, 12px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ui-avatar__badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: var(--badge-size, 14px);
  height: var(--badge-size, 14px);
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.ui-avatar__badge-text {
  font-size: 9px;
  font-weight: 700;
  color: var(--text);
}

.ui-avatar__badge-icon {
  width: 10px;
  height: 10px;
  color: var(--text);
}

.ui-avatar__badge-image {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
}

.ui-avatar__dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: var(--danger);
  border: 2px solid var(--bg);
}

/* Avatar groups */
.ui-avatar-group {
  display: inline-flex;
  align-items: center;
}

.ui-avatar-group__item + .ui-avatar-group__item {
  margin-left: calc(var(--avatar-overlap, 10px) * -1);
}

.ui-avatar-group--diagonal .ui-avatar-group__item + .ui-avatar-group__item {
  transform: translateY(var(--avatar-offset, 6px));
}

/* <details> accordion polish (used for list-item expanders) */
details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}

/* Global focus ring (keyboard users) */
:focus-visible {
  outline: 2px solid var(--focus_ring);
  outline-offset: 2px;
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* OrderItem page: enforce 2-column layout at md+ without relying on Tailwind rebuilds */
.order-item-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .order-item-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
}

/* Landing page */
.landing {
  background: var(--bg);
  color: var(--text);
}

.landing-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, color-mix(in oklab, var(--core-bright-blue) 35%, transparent) 0%, transparent 55%),
    radial-gradient(circle at 85% 15%, color-mix(in oklab, var(--primary) 25%, transparent) 0%, transparent 50%),
    linear-gradient(180deg, color-mix(in oklab, var(--surface) 70%, transparent), transparent 65%),
    var(--bg);
}

html[data-theme="dark"] .landing-hero {
  background:
    radial-gradient(circle at 20% 15%, color-mix(in oklab, var(--core-bright-blue) 45%, transparent) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, color-mix(in oklab, var(--primary) 35%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, color-mix(in oklab, var(--surface2) 65%, transparent), transparent 70%),
    var(--bg);
}

.landing-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.landing-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-x-large);
  box-shadow: 0 18px 40px color-mix(in oklab, var(--text) 10%, transparent);
}

.landing-surface--raised {
  background: var(--surface2);
}

.landing-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
}

.landing-play {
  background: color-mix(in oklab, var(--primary) 15%, transparent);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
}

.landing-step {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-small);
  background: var(--primary);
  color: var(--primary_fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.landing-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 8px 12px;
  color: var(--text);
}

.landing-section-ocean-hero .landing-select {
  background-color: var(--core-ocean-blue);
  border-color: rgba(255, 255, 255, 0.35);
  padding-right: 36px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.landing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--primary_fg);
  border: 1px solid var(--primary);
  border-radius: var(--radius-medium);
  padding: 12px 20px;
  font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.landing-button:hover {
  background: var(--primary_hover);
  border-color: var(--primary_hover);
}

.landing-button--ghost {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}

.landing-button--ghost:hover {
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  border-color: color-mix(in oklab, var(--border) 70%, transparent);
}

/* Landing page - new design system styles */

/* Sticky header with blur */
.landing-header-blur {
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.landing-dark-surface.landing-header-blur {
  background: var(--core-ocean-blue);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.landing-dark-surface {
  color-scheme: dark;
  --bg: #070b12;
  --surface: #0b1220;
  --surface2: #0f172a;
  --border: #1f2a44;
  --text: #e6eaf2;
  --muted: #b8c0d4;
  --subtle: #95a0b8;
  --primary: var(--core-bright-blue);
  --primary_hover: color-mix(in oklab, var(--primary) 80%, black);
  --primary_active: color-mix(in oklab, var(--primary) 65%, black);
  --primary_fg: var(--core-ocean-blue);
  --link: var(--core-bright-blue);
  --focus_ring: var(--core-bright-blue);
  --focus_ring_offset: var(--core-ocean-blue);
  --button-secondary-text: var(--core-bright-blue);
}

.landing-dark-surface .logo-dark {
  display: block;
}

.landing-dark-surface .logo-light {
  display: none;
}

.landing-dark-surface .lucro-logo-text {
  color: var(--core-bright-blue);
}

/* Hero section - bold editorial style */
.landing-hero-new {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

html[data-theme="dark"] .landing-hero-new {
  background: var(--bg);
}

.landing-dark-surface.landing-hero-new,
.landing-dark-surface .landing-hero-new {
  background: var(--core-ocean-blue);
}

/* Display typography - Archivo Black */
.landing-display-xl {
  font-family: var(--ui-font-display);
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 0.85;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--core-bright-blue);
}

html[data-theme="dark"] .landing-display-xl {
  color: var(--core-bright-blue);
}

.landing-display-lg {
  font-family: var(--ui-font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--core-ocean-blue);
}

html[data-theme="dark"] .landing-display-lg {
  color: var(--text);
}

.landing-display-md {
  font-family: var(--ui-font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--core-ocean-blue);
}

html[data-theme="dark"] .landing-display-md {
  color: var(--text);
}

.landing-display--light {
  color: #ffffff;
}

/* Accent kicker - small uppercase label */
.landing-kicker-accent {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
}

.landing-hero-avatar {
  background: transparent;
  border-color: color-mix(in oklab, var(--core-bright-blue) 35%, transparent);
  color: var(--core-bright-blue);
}

/* Step numbers with secondary colors */
.landing-step-accent {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-small);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.landing-step-accent--orange {
  background: #FFC091;
  color: #1a1a1a;
}

.landing-step-accent--yellow {
  background: #FFEB69;
  color: #1a1a1a;
}

.landing-step-accent--teal {
  background: #A0E1E1;
  color: #1a1a1a;
}

.landing-step-accent--pink {
  background: #FFD7EF;
  color: #1a1a1a;
}

html[data-theme="dark"] .landing-step-accent--orange {
  background: #260A2F;
  color: #FFC091;
}

.landing-dark-surface .landing-step-accent--orange {
  background: #260A2F;
  color: #FFC091;
}

html[data-theme="dark"] .landing-step-accent--yellow {
  background: #3A341C;
  color: #FFEB69;
}

.landing-dark-surface .landing-step-accent--yellow {
  background: #3A341C;
  color: #FFEB69;
}

html[data-theme="dark"] .landing-step-accent--teal {
  background: #21231D;
  color: #A0E1E1;
}

.landing-dark-surface .landing-step-accent--teal {
  background: #21231D;
  color: #A0E1E1;
}

html[data-theme="dark"] .landing-step-accent--pink {
  background: #320707;
  color: #FFD7EF;
}

.landing-dark-surface .landing-step-accent--pink {
  background: #320707;
  color: #FFD7EF;
}

/* Elevated card with shadow */
.landing-card-elevated {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-x-large);
  padding: var(--padding-large);
  box-shadow:
    0 4px 6px -1px color-mix(in oklab, var(--text) 5%, transparent),
    0 20px 40px -4px color-mix(in oklab, var(--text) 12%, transparent);
}

/* Badge for "Example" label */
.landing-badge-subtle {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--surface);
  color: var(--subtle);
  border: 1px solid var(--border);
}

/* Stat cards with accent top border */
.landing-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  padding: var(--padding-small);
  position: relative;
}

.landing-stat-card--yellow {
  border-top: 3px solid #FFEB69;
}

.landing-stat-card--teal {
  border-top: 3px solid #A0E1E1;
}

.landing-stat-card--orange {
  border-top: 3px solid #FFC091;
}

.landing-stat-card--pink {
  border-top: 3px solid #FFD7EF;
}

/* Large button */
.landing-button-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--primary_fg);
  border: 2px solid var(--primary);
  border-radius: var(--radius-large);
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 100ms ease;
}

.landing-button-lg:hover {
  background: var(--primary_hover);
  border-color: var(--primary_hover);
  transform: translateY(-1px);
}

.landing-button--inverted {
  background: #ffffff;
  color: var(--core-ocean-blue);
  border-color: #ffffff;
}

.landing-button--inverted:hover {
  background: #f0f0f0;
  border-color: #f0f0f0;
}

.landing-button--ghost-light {
  background: transparent;
  color: #ffffff;
  border-color: color-mix(in oklab, #ffffff 40%, transparent);
}

.landing-button--ghost-light:hover {
  background: color-mix(in oklab, #ffffff 10%, transparent);
  border-color: color-mix(in oklab, #ffffff 60%, transparent);
}

/* Play button */
.landing-play-button {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-large);
  background: color-mix(in oklab, var(--primary) 15%, transparent);
  border: 2px solid color-mix(in oklab, var(--primary) 30%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: background-color 150ms ease, transform 100ms ease;
}

.landing-play-button:hover {
  background: color-mix(in oklab, var(--primary) 25%, transparent);
  transform: scale(1.05);
}

/* Section backgrounds */
.landing-section {
  background: var(--bg);
}

.landing-section-mist {
  background: var(--core-mist-blue);
}

html[data-theme="dark"] .landing-section-mist {
  background: var(--surface);
}

.landing-section-ocean {
  background: var(--core-ocean-blue);
  color: #ffffff;
}

html[data-theme="dark"] .landing-section-ocean {
  background: linear-gradient(135deg, var(--core-ocean-blue) 0%, color-mix(in oklab, var(--core-ocean-blue) 70%, var(--primary)) 100%);
}

/* Feature cards with accent left border */
.landing-feature-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  padding: var(--padding-medium);
  border-left: 4px solid var(--border);
}

.landing-feature-card--orange {
  border-left-color: #FFC091;
}

.landing-feature-card--yellow {
  border-left-color: #FFEB69;
}

.landing-feature-card--teal {
  border-left-color: #A0E1E1;
}

.landing-feature-card--pink {
  border-left-color: #FFD7EF;
}

/* Generic card */
.landing-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  padding: var(--padding-medium);
}

/* Bullet points */
.landing-bullet {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-top: 6px;
}

.landing-bullet--blue {
  background: var(--primary);
}

.landing-bullet--muted {
  background: var(--subtle);
}

/* Step card for "How it works" */
.landing-step-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-x-large);
  padding: var(--padding-large);
}

.landing-step-number {
  font-family: var(--ui-font-display);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.landing-step-number--orange {
  color: #FFC091;
}

.landing-step-number--teal {
  color: #64E1FF;
}

.landing-step-number--pink {
  color: #FFD7EF;
}

html[data-theme="dark"] .landing-step-number--orange {
  color: #FFC091;
}

html[data-theme="dark"] .landing-step-number--teal {
  color: #64E1FF;
}

html[data-theme="dark"] .landing-step-number--pink {
  color: #FFD7EF;
}

/* Testimonial card */
.landing-testimonial-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  padding: var(--padding-medium);
  border-left: 4px solid var(--core-bright-blue);
}

/* Legacy divider (keep for backward compatibility) */
.landing-divider {
  border-top: 1px solid var(--border);
}

.text-muted {
  color: var(--muted);
}

.text-subtle {
  color: var(--subtle);
}

.text-link {
  color: var(--link);
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

/* Design system buttons */
.ds-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-8);
  border: 1px solid transparent;
  border-radius: var(--radius-large);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.ds-button--lg {
  min-height: var(--size-x-large);
  padding: 0 var(--padding-large);
  font-size: 16px;
}

.ds-button--md {
  min-height: var(--size-large);
  padding: 0 var(--padding-medium);
  font-size: 14px;
}

.ds-button--sm {
  min-height: var(--size-medium);
  padding: 0 var(--padding-small);
  font-size: 12px;
}

.ds-button--primary {
  background: var(--primary);
  color: var(--primary_fg);
  border-color: var(--primary);
}

.ds-button--secondary {
  background: color-mix(in oklab, var(--button-secondary-color, var(--secondary-blue)) 35%, var(--surface2));
  color: var(--button-secondary-text, var(--text));
  border-color: color-mix(in oklab, var(--button-secondary-color, var(--secondary-blue)) 55%, var(--border));
}

.ds-button--secondary-neutral {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}

.ds-button--tertiary {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

.ds-button--negative {
  background: var(--danger);
  color: var(--danger_fg);
  border-color: var(--danger);
}

.ds-button--negative-secondary {
  background: color-mix(in oklab, var(--danger) 12%, var(--surface2));
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 30%, var(--border));
}

.ds-button--negative-tertiary {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
}

.ds-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (hover: hover) {
  .ds-button--primary:hover {
    background: var(--primary_hover);
    border-color: var(--primary_hover);
  }

  .ds-button--secondary:hover {
    background: color-mix(in oklab, var(--button-secondary-color, var(--secondary-blue)) 45%, var(--surface2));
  }

  .ds-button--secondary-neutral:hover {
    background: var(--surface);
  }

  .ds-button--tertiary:hover {
    background: var(--surface);
  }

  .ds-button--negative:hover {
    background: color-mix(in oklab, var(--danger) 85%, black);
    border-color: color-mix(in oklab, var(--danger) 85%, black);
  }

  .ds-button--negative-secondary:hover {
    background: color-mix(in oklab, var(--danger) 18%, var(--surface2));
  }

  .ds-button--negative-tertiary:hover {
    background: color-mix(in oklab, var(--danger) 12%, transparent);
  }
}

/* Design system cards */
.ds-card {
  background: var(--surface2);
  /* No border - differentiated by background color (Wise style) */
  box-shadow: var(--shadow-card);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--size-12);
  position: relative;
}

.ds-card--small {
  min-height: 88px;
  max-height: 300px;
  padding: var(--padding-small);
  border-radius: var(--radius-medium);
}

.ds-card--large {
  min-height: 300px;
  padding: var(--padding-large);
  border-radius: var(--radius-x-large);
}

.ds-card--soft {
  background: var(--surface2);
}

.ds-card--clickable {
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.ds-card-grid {
  display: grid;
  gap: var(--size-16);
}

.ds-card-stack {
  display: grid;
  gap: var(--size-16);
}

.ds-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-12);
}

.ds-card__stack {
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}

.ds-card__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--subtle);
  font-weight: 600;
}

.ds-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.ds-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.ds-card__value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ds-card__value--lg {
  font-size: 28px;
}

.ds-card__value--xl {
  font-size: 32px;
}

.ds-card__value--sm {
  font-size: 20px;
}

/* Value color modifiers for financial data (accessible contrast maintained) */
.ds-card__value--success {
  color: var(--success);
}

.ds-card__value--danger {
  color: var(--danger);
}

.ds-card__meta {
  font-size: 12px;
  color: var(--muted);
}

.ds-card__divider {
  height: 1px;
  background: var(--border);
}

.ds-card__pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-8);
}

.ds-card__pill {
  padding: var(--size-4) var(--size-12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
}

.ds-card__pill--active {
  background: color-mix(in oklab, var(--primary) 14%, var(--surface));
  border-color: color-mix(in oklab, var(--primary) 30%, transparent);
  color: var(--primary);
}

.ds-card__tag {
  padding: var(--size-4) var(--size-12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  background: color-mix(in oklab, var(--success) 18%, var(--surface));
}

.ds-card__sparkline {
  width: 100%;
  height: 64px;
}

.ds-card__sparkline path {
  stroke: var(--sparkline-color, var(--success));
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ds-card__sparkline circle {
  fill: var(--sparkline-color, var(--success));
}

.ds-card__bar {
  height: 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bar-color, var(--primary)) 18%, var(--surface));
  overflow: hidden;
}

.ds-card__bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--primary));
}

.ds-card__link {
  color: var(--link);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.ds-card__link:hover {
  text-decoration: underline;
}

.ds-card__icon-circle {
  width: var(--size-medium);
  height: var(--size-medium);
  border-radius: 999px;
  background: color-mix(in oklab, var(--icon-color, var(--primary)) 18%, var(--surface));
  color: var(--icon-color, var(--primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ds-card__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-12);
}

.ds-card__dismiss {
  position: absolute;
  top: var(--size-8);
  right: var(--size-8);
  width: var(--size-medium);
  height: var(--size-medium);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease, background-color 150ms ease;
}

.ds-card__dismiss:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--surface) 85%, var(--primary) 15%);
}

.ds-card__media-block {
  height: 120px;
  border-radius: var(--radius-medium);
  background: color-mix(in oklab, var(--primary) 12%, var(--surface));
}

.ds-card__media-block--overlap {
  margin-bottom: calc(var(--size-16) * -1);
}

@media (min-width: 768px) {
  .ds-card-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

@media (hover: hover) {
  .ds-card--clickable:hover {
    background: var(--surface2-hover);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), 0 4px 10px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
  }
}

html[data-theme="dark"] .ds-card--clickable:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Design system form inputs */
.ds-input-label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.0125em;
}

.ds-input-container {
  background: var(--surface2);
  border: 1px solid color-mix(in oklab, var(--text) 30%, transparent);
  border-radius: 12px;
  padding: 8px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ds-input-container:hover {
  border-color: color-mix(in oklab, var(--text) 45%, transparent);
}

.ds-input-container:focus-within {
  border-color: color-mix(in oklab, var(--text) 60%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary) 20%, transparent);
}

.ds-input {
  width: 100%;
  background: transparent;
  color: var(--text);
  border: none;
  outline: none;
}

.ds-input::placeholder {
  color: var(--subtle);
}

/* Design system upload input (Wise-inspired) */
.ds-upload {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  background: var(--surface2);
  border: 1px solid color-mix(in oklab, var(--text) 30%, transparent);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ds-upload:hover {
  background: var(--surface2-hover);
  border-color: color-mix(in oklab, var(--text) 45%, transparent);
}

.ds-upload:focus-within {
  border-color: color-mix(in oklab, var(--text) 60%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary) 20%, transparent);
}

.ds-upload__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.ds-upload__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.ds-upload__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ds-upload__description {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.ds-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Design system buttons */
.ds-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.ds-button--primary {
  background: var(--primary);
  color: var(--primary_fg);
  border: none;
}

.ds-button--primary:hover:not(:disabled) {
  background: var(--primary_hover);
}

.ds-button--primary:active:not(:disabled) {
  transform: scale(0.98);
}

.ds-button--primary:disabled {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: not-allowed;
  opacity: 0.7;
}

.ds-button--full-width {
  width: 100%;
}

/* Mobile bottom nav - solid background + scroll hide animation */
.mobile-bottom-nav {
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-bottom-nav--hidden {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

/* App chrome: desktop left sidebar (Wise-like) */
.desktop-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  :root {
    /* Future: can be reduced to show icon-only collapsed rail */
    --sidebar-width: 18rem;
  }

  /* When the desktop sidebar is present, make the global header span edge-to-edge. */
  body:has(.desktop-sidebar) .global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: none;
  }

  .desktop-sidebar {
    display: block;
    position: fixed;
    left: 0;
    top: var(--app-header-height);
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 40;
    background: var(--bg);
    border-right: none;
    overflow-y: auto;
  }

  /* Desktop sidebar item states */
  .desktop-sidebar__link {
    color: var(--muted);
  }

  .desktop-sidebar__link:hover {
    background: transparent;
    color: var(--primary);
  }

  /* data-active comes from the ERB partial */
  .desktop-sidebar__link[data-active="true"] {
    background-color: color-mix(in oklab, var(--primary) 10%, transparent);
    color: var(--text);
  }

  /* Remove "outlined icon" look */
  .desktop-sidebar__icon {
    border: none;
    box-shadow: none;
    outline: none;
  }

  /* Only offset pages that actually render the sidebar */
  body:has(.desktop-sidebar) {
    padding-left: var(--sidebar-width);
    padding-top: var(--app-header-height);
  }

  /* Ensure mobile bottom nav never appears on desktop, even if Tailwind breakpoints don't rebuild */
  .mobile-bottom-nav {
    display: none !important;
  }

  /* Sidebar height is now below the fixed header. */
  body:has(.desktop-sidebar) .desktop-sidebar {
    height: calc(100vh - var(--app-header-height));
  }
}
