:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg-alt: #eef6f1;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --text: #0f172a;
  --muted: #526070;
  --line: rgba(15, 23, 42, 0.12);
  --primary: #136f4a;
  --primary-strong: #0c5a3c;
  --primary-soft: #dff3e8;
  --accent: #d97706;
  --accent-soft: #fff1d6;
  --danger: #dc2626;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(19, 111, 74, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.14), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, #fbfaf7 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 82%);
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.page-shell {
  position: relative;
  z-index: 1;
}

.topbar,
.section,
.hero,
.footer,
.auth-shell {
  width: min(1180px, calc(100vw - 32px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, #28a56d 100%);
  color: white;
  box-shadow: 0 12px 30px rgba(19, 111, 74, 0.24);
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-title strong {
  font-size: 1rem;
}

.brand-title span {
  font-size: 0.82rem;
  color: var(--muted);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topnav a,
.topnav button,
.chip,
.segment {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.topnav a:hover,
.topnav button:hover,
.chip:hover,
.segment:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  background: rgba(255, 255, 255, 0.94);
}

.topnav .primary-action,
.btn.primary,
.segment.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: white;
  border-color: transparent;
}

.topnav .ghost-action,
.btn.ghost,
.segment {
  background: rgba(255, 255, 255, 0.78);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 24px;
  align-items: stretch;
  padding: 10px 0 18px;
}

.hero-card,
.panel,
.auth-card,
.metric-card,
.assistant-card,
.shipping-card,
.auth-visual {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-copy {
  padding: 44px;
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.18), transparent 62%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 18px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-copy p {
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn,
.segment,
.chip,
.filter-btn,
.modal-close,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-weight: 600;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.metric-card {
  padding: 18px;
}

.metric-card strong {
  display: block;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  font-family: var(--font-display);
}

.metric-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-side {
  display: grid;
  gap: 16px;
}

.hero-card {
  padding: 26px;
}

.hero-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.hero-card p,
.panel-note,
.helper-copy,
.section-subtitle,
.assistant-answer,
.auth-card p,
.footer {
  color: var(--muted);
}

.hero-card-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.hero-card-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.hero-card-row:last-child {
  border-bottom: 0;
}

.hero-card-row strong {
  display: block;
  font-size: 0.95rem;
}

.hero-card-row span {
  font-size: 0.88rem;
  color: var(--muted);
}

.section {
  padding: 18px 0 12px;
}

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

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
}

.section-subtitle {
  max-width: 64ch;
  margin: 8px 0 0;
  line-height: 1.6;
}

.panel {
  padding: 22px;
}

.toolbar,
.filter-row,
.calc-grid,
.modal-grid,
.auth-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.marketplace-controls {
  margin: 18px 0 18px;
  padding: 20px;
  display: grid;
  gap: 14px;
}

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

.marketplace-grid .field.full {
  grid-column: 1 / -1;
}

.marketplace-actions {
  justify-content: flex-start;
}

.marketplace-count {
  margin: 0;
}

.segment,
.filter-btn,
.chip {
  min-height: 40px;
  padding: 0 14px;
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, #b45309 100%);
  color: white;
  border-color: transparent;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.item-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.item-card {
  grid-column: span 1;
  overflow: hidden;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-soft);
}

.item-visual {
  position: relative;
  height: 190px;
  background: linear-gradient(135deg, #e7f4ec 0%, #f5efe1 100%);
}

.item-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-strong);
  border: 1px solid rgba(19, 111, 74, 0.15);
}

.badge.secondary {
  left: auto;
  right: 14px;
  color: var(--accent);
  border-color: rgba(217, 119, 6, 0.16);
}

.item-content {
  padding: 18px;
}

.item-content h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.item-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.price {
  display: block;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--primary-strong);
}

.price small {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(16px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: min(92vh, 980px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.modal-close {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
}

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

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: white;
  color: var(--text);
}

.field input[type="search"] {
  appearance: none;
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(19, 111, 74, 0.18);
  border-color: rgba(19, 111, 74, 0.42);
}

.upload-box {
  min-height: 162px;
  padding: 16px;
  border-radius: 18px;
  border: 1.5px dashed rgba(15, 23, 42, 0.18);
  background: linear-gradient(180deg, rgba(223, 243, 232, 0.42), rgba(255, 255, 255, 0.9));
  position: relative;
  overflow: hidden;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-box figure {
  margin: 0;
  display: grid;
  gap: 10px;
  place-items: center;
  text-align: center;
  min-height: 130px;
}

.upload-box img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  display: none;
}

.upload-box.has-image figure {
  display: none;
}

.upload-box.has-image img {
  display: block;
}

.helper-copy {
  font-size: 0.9rem;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.status {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.calculator-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
}

.shipping-card {
  padding: 20px;
}

.shipping-result {
  display: grid;
  gap: 10px;
}

.shipping-amount {
  font-size: clamp(2rem, 5vw, 3rem);
  font-family: var(--font-display);
  letter-spacing: -0.05em;
  font-weight: 700;
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.assistant-feed {
  display: grid;
  gap: 12px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.bubble {
  width: fit-content;
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.55;
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.bubble.user {
  margin-left: auto;
  background: var(--primary-soft);
  border-color: rgba(19, 111, 74, 0.12);
}

.bubble.bot {
  background: rgba(255, 255, 255, 0.98);
}

.footer {
  padding: 40px 0 60px;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.75fr);
  gap: 18px;
  width: 100%;
}

.auth-visual {
  padding: 34px;
  display: grid;
  align-content: space-between;
  min-height: 640px;
  overflow: hidden;
  position: relative;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.16), transparent 64%);
}

.auth-visual h1 {
  margin: 18px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.auth-visual p {
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.7;
}

.auth-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.auth-card {
  padding: 28px;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.auth-tabs {
  margin: 16px 0 18px;
}

.auth-tab {
  flex: 1 1 0;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: white;
  border-color: transparent;
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-note {
  margin-top: 14px;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .hero,
  .calculator-card,
  .assistant-layout,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .auth-visual {
    min-height: unset;
  }
}

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

  .hero-copy,
  .panel,
  .hero-card,
  .auth-card,
  .auth-visual,
  .shipping-card,
  .modal {
    border-radius: 22px;
  }

  .hero-copy {
    padding: 28px 22px;
  }

  .hero-stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }
}
