@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
  color-scheme: light dark;
}

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Inter', sans-serif;
}

[id] {
  scroll-margin-top: 100px;
}

::selection {
  background: rgba(59, 130, 246, 0.3);
}

.page-shell {
  isolation: isolate;
}

.page-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(4, 146, 254, 0.08) 0%,
    #ffffff 100%
  );
  transition: background 0.5s ease, opacity 1s ease;
}

.dark .page-shell::before {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(4, 146, 254, 0.13) 0%,
    #000000 100%
  );
}

.particle {
  position: absolute;
  left: var(--left);
  top: var(--top);
  width: var(--size);
  height: var(--size);
  border-radius: 9999px;
  background: #0492fe;
  opacity: 0.7;
  box-shadow: 0 0 5px rgba(4, 146, 254, 0.3);
  transition:
    background-color 1s ease,
    box-shadow 1s ease,
    opacity 1s ease;
  animation: float-and-fade var(--duration) linear infinite;
  animation-delay: var(--delay);
}

.dark .particle {
  background: #93c5fd;
  opacity: 1;
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.4);
}

@keyframes float-and-fade {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }

  30% {
    opacity: 0;
  }

  50% {
    transform: translateY(-60px) translateX(15px);
    opacity: 0.6;
  }

  80% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-120px) translateX(30px);
    opacity: 0;
  }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal='left'] {
  transform: translateX(-40px);
}

[data-reveal='right'] {
  transform: translateX(40px);
}

[data-reveal='scale'] {
  transform: scale(0.95);
}

[data-reveal='none'] {
  transform: none;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.dashboard-preview {
  background: #ffffff;
  border: 1px solid #000000;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.05);
}

.dark .dashboard-preview {
  background: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 60px rgba(4, 146, 254, 0.1);
}

.dashboard-topbar {
  background: #f9fafb;
  border-bottom: 1px solid #000000;
}

.dark .dashboard-topbar {
  background: #111111;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.dashboard-address {
  background: #ffffff;
  border: 1px solid #000000;
  color: #000000;
}

.dark .dashboard-address {
  background: rgba(0, 0, 0, 0.4);
  border-color: transparent;
  color: #9ca3af;
}

.dashboard-sidebar {
  background: rgba(249, 250, 251, 0.5);
  border-right: 1px solid #000000;
}

.dark .dashboard-sidebar {
  background: #080808;
  border-right-color: rgba(255, 255, 255, 0.05);
}

.dashboard-main {
  background: #ffffff;
}

.dark .dashboard-main {
  background: transparent;
}

.dashboard-income-card {
  background: #ffffff;
  border: 1px solid #000000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.dark .dashboard-income-card {
  background: #121212;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.dashboard-bar {
  height: 0;
  transition:
    height 0.6s ease,
    filter 0.2s ease,
    transform 0.2s ease;
}

.dashboard-preview.is-visible .dashboard-bar {
  height: var(--target-height);
}

.dashboard-bar:hover {
  filter: brightness(1.1);
  transform: scaleY(1.05);
}

.dark .dashboard-bar:hover {
  filter: brightness(1.4);
  transform: scaleY(1.08);
}

.orders-preview {
  background: #ffffff;
  border: 1px solid #000000;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.05);
}

.dark .orders-preview {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.orders-row {
  background: #ffffff;
  border: 1px solid #000000;
}

.dark .orders-row {
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
}

.orders-row:hover {
  background: #fcfcfc;
}

.dark .orders-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.status-dot {
  background: var(--dot-light);
}

.dark .status-dot {
  background: var(--dot-dark, var(--dot-light));
}

.mercado-preview {
  position: relative;
  background: #ffffff;
  border: 1px solid #000000;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.05);
}

.mercado-preview::before {
  content: none;
}

.mercado-preview::after {
  content: none;
}

.dark .mercado-preview {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.mercado-preview-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 27rem;
  flex-direction: column;
  gap: 1rem;
}

.mercado-preview-shell::before {
  content: none;
}

.dark .mercado-preview-shell {
  background: transparent;
}

.mercado-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mercado-shell-title {
  margin: 0;
  color: #000000;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.dark .mercado-shell-title {
  color: #ffffff;
}

.mercado-shell-badge,
.mercado-chip,
.mercado-mini-pill,
.mercado-flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 9999px;
}

.mercado-shell-badge,
.mercado-chip,
.mercado-mini-pill,
.mercado-flow-pill {
  border: 1px solid #000000;
  background: #ffffff;
  color: #000000;
  font-size: 0.75rem;
  font-weight: 600;
}

.dark .mercado-shell-badge,
.dark .mercado-chip,
.dark .mercado-mini-pill,
.dark .mercado-flow-pill {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.88);
}

.mercado-shell-badge {
  padding: 0.4rem 0.65rem;
}

.mercado-chip,
.mercado-mini-pill,
.mercado-flow-pill {
  padding: 0.35rem 0.6rem;
}

.mercado-status-light {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.5);
  animation: mercado-pulse 2.3s ease-in-out infinite;
}

@keyframes mercado-pulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.16);
  }
}

.mercado-terminal-stage {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border: 1px solid #000000;
  border-radius: 1.35rem;
  padding: 0.9rem;
  background: #ffffff;
}

.dark .mercado-terminal-stage {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.05);
}

.mercado-screen-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: 1.15rem;
  padding: 1rem;
  border: 1px solid #000000;
  background: #f9fafb;
}

.dark .mercado-screen-card {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.05);
}

.mercado-chip {
  align-self: flex-start;
  color: #000000;
}

.dark .mercado-chip {
  color: rgba(255, 255, 255, 0.88);
}

.mercado-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mercado-mini-pill.is-active {
  border-color: #000000;
  background: #f3f4f6;
  color: #000000;
}

.dark .mercado-mini-pill.is-active {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.mercado-progress-track {
  overflow: hidden;
  height: 0.7rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.12);
}

.dark .mercado-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

.mercado-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #0492fe;
  transition: width 1.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.mercado-preview.is-visible .mercado-progress-fill {
  width: var(--target-width);
}

.mercado-flow-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.mercado-flow-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid #000000;
  border-radius: 1.15rem;
  padding: 0.8rem 0.9rem;
  background: #ffffff;
  transition: background-color 0.22s ease;
}

.mercado-flow-row:hover {
  background: #fcfcfc;
}

.dark .mercado-flow-row {
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
}

.dark .mercado-flow-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mercado-flow-dot {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  border-radius: 9999px;
}

.mercado-flow-dot.is-terminal {
  background: #0492fe;
}

.mercado-flow-dot.is-sync {
  background: #ffb800;
}

.mercado-flow-dot.is-alert {
  background: #00d186;
}

.mercado-sync-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border: 1px solid #000000;
  border-radius: 1rem;
  padding: 0.9rem;
  background: #ffffff;
}

.dark .mercado-sync-strip {
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
}

.mercado-sync-label {
  color: #6b7280;
  font-size: 0.84rem;
  font-weight: 600;
}

.dark .mercado-sync-label {
  color: rgba(255, 255, 255, 0.72);
}

.mercado-sync-track {
  position: relative;
  display: flex;
  width: 7.75rem;
  justify-content: space-between;
}

.mercado-sync-track::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.15);
}

.dark .mercado-sync-track::before {
  background: rgba(255, 255, 255, 0.1);
}

.mercado-sync-track-fill {
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  top: 50%;
  height: 2px;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  border-radius: 9999px;
  background: #0492fe;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.mercado-preview.is-visible .mercado-sync-track-fill {
  transform: translateY(-50%) scaleX(1);
}

.mercado-sync-node {
  position: relative;
  z-index: 1;
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid #000000;
  border-radius: 9999px;
  background: #ffffff;
}

.dark .mercado-sync-node {
  border-color: rgba(255, 255, 255, 0.18);
  background: #08172d;
}

.mercado-sync-node.is-active {
  border-color: #0492fe;
  background: #0492fe;
}

.dark .mercado-sync-node.is-active {
  border-color: #0492fe;
  background: #0492fe;
}

.mercado-skeleton {
  display: block;
  width: 0;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.14);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.dark .mercado-skeleton {
  background: rgba(255, 255, 255, 0.1);
}

.mercado-skeleton-title {
  height: 0.82rem;
}

.mercado-skeleton-copy {
  height: 0.55rem;
  opacity: 0.72;
}

.mercado-preview.is-visible .mercado-skeleton {
  width: var(--target-width);
}

.feature-card-shell {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  box-shadow: 0 20px 45px rgba(229, 231, 235, 0.5);
}

.dark .feature-card-shell {
  background: #1a1a1a;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.chart-bar {
  height: 0;
  transition: height 1s cubic-bezier(0.33, 1, 0.68, 1);
}

.feature-card-shell.is-visible .chart-bar {
  height: var(--target-height);
}

.progress-fill {
  width: 0;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-card-shell.is-visible .progress-fill {
  width: var(--target-width);
}

.input-field.has-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.dark .input-field.has-error {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

@media (max-width: 639px) {
  [id] {
    scroll-margin-top: 136px;
  }

  .mercado-preview {
    padding: 1rem;
  }

  .mercado-preview-shell {
    min-height: auto;
  }

  .mercado-shell-title {
    font-size: 1.3rem;
  }

  .mercado-terminal-stage,
  .mercado-sync-strip {
    padding: 1rem;
  }

  .mercado-flow-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mercado-flow-pill {
    margin-left: 1.55rem;
  }

  .mercado-sync-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .feature-card-shell {
    padding: 1.5rem;
  }

  .orders-preview {
    min-height: 28rem;
    padding: 1.25rem;
    border-radius: 1.75rem;
  }

  .orders-row {
    padding: 1rem;
  }

  .dashboard-address {
    max-width: 100%;
    overflow: hidden;
    padding-left: 1rem;
    padding-right: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .particle {
    display: none;
  }

  .dashboard-bar {
    height: var(--target-height);
  }

  .chart-bar {
    height: var(--target-height);
  }

  .progress-fill {
    width: var(--target-width);
  }

  .mercado-status-light {
    animation: none;
  }

  .mercado-progress-fill {
    width: var(--target-width);
  }

  .mercado-skeleton {
    width: var(--target-width);
  }

  .mercado-sync-track-fill {
    transform: translateY(-50%) scaleX(1);
  }
}