:root,
html[data-theme="dark"] {
  --ink: #f8fbff;
  --muted: #9eb1c9;
  --faint: #6f839d;
  --night: #07111f;
  --night-2: #0c1a2d;
  --panel: rgba(9, 24, 42, 0.78);
  --panel-2: rgba(255, 255, 255, 0.075);
  --line: rgba(183, 209, 238, 0.16);
  --line-strong: rgba(96, 214, 255, 0.36);
  --cyan: #29d8ff;
  --blue: #1877ff;
  --red: #ff3e55;
  --pink: #ff7a90;
  --mint: #32e2a7;
  --gold: #ffd166;
  --radius: 28px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --body-bg:
    linear-gradient(115deg, rgba(255, 62, 85, 0.18), transparent 28%),
    radial-gradient(circle at 84% 9%, rgba(41, 216, 255, 0.22), transparent 26%),
    radial-gradient(circle at 45% 105%, rgba(255, 209, 102, 0.10), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #0b1829 50%, #06101d 100%);
  --grid-line: rgba(255, 255, 255, 0.07);
  --grid-opacity: 0.18;
  --topbar-bg: rgba(5, 14, 26, 0.76);
  --field-bg: rgba(0, 0, 0, 0.24);
  --soft-bg: rgba(255, 255, 255, 0.055);
  --soft-bg-hover: rgba(255, 255, 255, 0.075);
  --media-bg: rgba(0, 0, 0, 0.24);
}

html[data-theme="light"] {
  --ink: #102033;
  --muted: #50687f;
  --faint: #7690aa;
  --night: #f7fbff;
  --night-2: #eaf3fb;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-2: rgba(8, 36, 70, 0.06);
  --line: rgba(22, 70, 112, 0.16);
  --line-strong: rgba(11, 121, 181, 0.34);
  --cyan: #087ea4;
  --blue: #245fe7;
  --red: #d32949;
  --pink: #e14f76;
  --mint: #078a66;
  --gold: #b06a00;
  --shadow: 0 24px 70px rgba(20, 54, 86, 0.18);
  --body-bg:
    linear-gradient(115deg, rgba(255, 122, 144, 0.22), transparent 30%),
    radial-gradient(circle at 86% 8%, rgba(41, 216, 255, 0.22), transparent 28%),
    radial-gradient(circle at 35% 112%, rgba(255, 209, 102, 0.18), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, #eef7ff 55%, #f8fbff 100%);
  --grid-line: rgba(20, 54, 86, 0.08);
  --grid-opacity: 0.35;
  --topbar-bg: rgba(255, 255, 255, 0.78);
  --field-bg: rgba(255, 255, 255, 0.82);
  --soft-bg: rgba(8, 36, 70, 0.055);
  --soft-bg-hover: rgba(8, 36, 70, 0.085);
  --media-bg: rgba(255, 255, 255, 0.72);
}

html[data-theme="pink"] {
  --ink: #fff7fb;
  --muted: #ffd2df;
  --faint: #efa8bc;
  --night: #220817;
  --night-2: #351025;
  --panel: rgba(55, 13, 37, 0.78);
  --panel-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 211, 223, 0.20);
  --line-strong: rgba(255, 122, 162, 0.42);
  --cyan: #ffd166;
  --blue: #ff6f9f;
  --red: #ff3e7b;
  --pink: #ff9bb5;
  --mint: #8ef0ce;
  --gold: #ffe08a;
  --shadow: 0 28px 90px rgba(78, 9, 43, 0.48);
  --body-bg:
    radial-gradient(circle at 82% 8%, rgba(255, 209, 102, 0.24), transparent 24%),
    radial-gradient(circle at 20% 20%, rgba(255, 122, 144, 0.26), transparent 30%),
    linear-gradient(180deg, #210715 0%, #421328 52%, #260717 100%);
  --grid-line: rgba(255, 255, 255, 0.08);
  --grid-opacity: 0.16;
  --topbar-bg: rgba(34, 8, 23, 0.78);
  --field-bg: rgba(0, 0, 0, 0.22);
  --soft-bg: rgba(255, 255, 255, 0.065);
  --soft-bg-hover: rgba(255, 255, 255, 0.095);
  --media-bg: rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI Variable", "Segoe UI", "Trebuchet MS", sans-serif;
  background: var(--body-bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, black, transparent 82%);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--red), var(--blue) 58%, var(--cyan));
  box-shadow: 0 18px 40px rgba(24, 119, 255, 0.25);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0.02em;
}

.brand small {
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

nav a,
.pill,
.theme-switcher button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 10px 15px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  background: var(--soft-bg);
  transition: 180ms ease;
}

nav a:hover,
.pill,
.theme-switcher button:hover,
.theme-switcher button.active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--soft-bg-hover);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.theme-switcher button {
  min-height: 34px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.theme-switcher button.active {
  color: #00101a;
  background: linear-gradient(135deg, var(--gold), var(--cyan));
}

.danger {
  color: #ffdce2;
  background: rgba(255, 62, 85, 0.14);
  border-color: rgba(255, 62, 85, 0.22);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 30px));
  margin: 0 auto;
  padding: 38px 0 76px;
}

.hero {
  min-height: calc(100vh - 118px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 5vw, 62px);
}

.hero-copy {
  animation: rise-in 520ms ease both;
}

.hero h1,
.page-head h1,
.form-page h1 {
  margin: 17px 0;
  max-width: 900px;
  font-size: clamp(44px, 7.7vw, 94px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.hero p,
.page-head p,
.form-page p,
.muted {
  color: var(--muted);
  line-height: 1.72;
  font-size: 17px;
}

.hero p {
  max-width: 700px;
  font-size: 19px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 9px 14px;
  border-radius: 999px;
  color: #ffffff;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 850;
  background: linear-gradient(90deg, rgba(255, 62, 85, 0.20), rgba(41, 216, 255, 0.18));
  border: 1px solid var(--line);
}

.actions,
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.actions {
  margin-top: 26px;
}

.trust-row {
  margin-top: 26px;
}

.trust-row span {
  color: var(--muted);
  padding: 10px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--red), var(--blue) 58%, var(--cyan));
  box-shadow: 0 18px 40px rgba(24, 119, 255, 0.22);
}

.button.full {
  width: 100%;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.045);
}

.device-stage {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
  animation: rise-in 620ms 90ms ease both;
}

.device-card,
.floating-card,
.panel,
.module-card,
.metric,
.cart,
.timeline-panel article {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.device-card.main {
  width: min(460px, 100%);
  min-height: 460px;
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(41, 216, 255, 0.14), transparent 40%),
    linear-gradient(320deg, rgba(255, 62, 85, 0.16), transparent 44%),
    rgba(7, 17, 31, 0.78);
}

.device-top {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.device-top span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.8;
}

.ticket-preview {
  padding: 30px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.ticket-preview small,
.ticket-preview p {
  color: var(--muted);
}

.ticket-preview strong {
  display: block;
  margin: 8px 0;
  color: #fff;
  font-size: clamp(52px, 8vw, 84px);
  letter-spacing: -0.07em;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.mini-grid span {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.floating-card {
  position: absolute;
  padding: 18px 20px;
  min-width: 170px;
  backdrop-filter: blur(16px);
}

.floating-card strong,
.floating-card span {
  display: block;
}

.floating-card strong {
  font-size: 36px;
}

.floating-card span {
  color: var(--muted);
}

.floating-card.one {
  top: 50px;
  right: 4px;
}

.floating-card.two {
  bottom: 72px;
  left: 0;
}

.feature-strip,
.timeline-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-strip article,
.timeline-panel article {
  padding: 24px;
}

.feature-strip span,
.timeline-panel span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 15px;
  color: #00101a;
  background: var(--gold);
  font-weight: 950;
}

.feature-strip strong,
.timeline-panel strong {
  display: block;
  font-size: 22px;
}

.feature-strip p,
.timeline-panel p {
  color: var(--muted);
}

.page-head {
  margin-bottom: 28px;
}

.page-head.app-head {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 62, 85, 0.10), rgba(41, 216, 255, 0.08));
}

.messages {
  position: relative;
  z-index: 2;
  width: min(1220px, calc(100% - 30px));
  margin: 18px auto 0;
}

.message {
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 20, 36, 0.86);
}

.message.success { border-color: rgba(50, 226, 167, 0.5); }
.message.error { border-color: rgba(255, 62, 85, 0.5); }
.message.info { border-color: rgba(41, 216, 255, 0.5); }

.form-page {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: 0.9fr minmax(340px, 530px);
  gap: 32px;
  align-items: center;
}

.form-page.compact {
  grid-template-columns: 1fr minmax(320px, 460px);
}

.auth-copy {
  max-width: 650px;
}

.panel,
.auth-card {
  padding: 26px;
}

.warning code {
  display: block;
  overflow-wrap: anywhere;
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--line);
  outline: none;
  background: var(--field-bg);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(41, 216, 255, 0.10);
}

.metric-grid,
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.module-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric,
.module-card {
  padding: 24px;
  overflow: hidden;
}

.metric.accent,
.primary-module {
  background:
    linear-gradient(135deg, rgba(255, 62, 85, 0.18), rgba(24, 119, 255, 0.14)),
    rgba(255, 255, 255, 0.06);
}

.metric span,
.module-card span {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.06em;
}

.module-card {
  min-height: 170px;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.module-card em {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 16px;
  color: #00101a;
  background: var(--cyan);
  font-style: normal;
  font-weight: 950;
}

.module-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.pos-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 410px);
  gap: 22px;
  align-items: start;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title h1,
.section-title h2,
.cart h2 {
  margin: 8px 0 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.05em;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.product-card {
  position: relative;
  display: grid;
  gap: 11px;
  min-height: 268px;
  padding: 16px;
  text-align: left;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(41, 216, 255, 0.14), transparent 45%),
    var(--soft-bg);
  color: var(--ink);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background:
    linear-gradient(150deg, rgba(41, 216, 255, 0.20), transparent 45%),
    var(--soft-bg-hover);
}

.product-card strong,
.product-card span {
  display: block;
}

.product-kicker {
  color: var(--faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-media {
  display: grid;
  place-items: center;
  width: 100%;
  height: 126px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.14), transparent 26%),
    var(--media-bg);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-fallback {
  color: var(--cyan);
  font-size: 44px;
  font-weight: 950;
  text-transform: uppercase;
}

.product-card strong {
  min-height: 44px;
  margin-top: 0;
  font-size: 18px;
  line-height: 1.22;
}

.product-price {
  margin-top: 12px;
  color: var(--gold);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.cart {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cart-items {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  max-height: 42vh;
  overflow: auto;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.065);
}

.cart-row button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.10);
}

.totals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
  font-size: 20px;
}

.totals strong {
  font-size: 34px;
  letter-spacing: -0.06em;
}

.subtle strong {
  color: var(--mint);
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
}

.import-panel p {
  margin: 0;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .form-page,
  .pos-screen,
  .form-grid.wide,
  .feature-strip,
  .timeline-panel {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .cart {
    position: static;
  }

  .floating-card {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .device-stage {
    min-height: auto;
    gap: 14px;
  }
}

@media (max-width: 650px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
  }

  .shell {
    width: min(100% - 18px, 1240px);
    padding-top: 22px;
  }

  .hero h1,
  .page-head h1,
  .form-page h1 {
    font-size: 42px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card {
    min-height: 238px;
    padding: 13px;
  }

  .product-media {
    height: 104px;
    border-radius: 17px;
  }

  .theme-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .theme-switcher button {
    flex: 1;
    justify-content: center;
  }
}
