:root {
  color-scheme: light;
  --ink: #1f2937;
  --muted: #607080;
  --line: #d8e0e7;
  --paper: #fbfcfd;
  --surface: #ffffff;
  --accent: #087f8c;
  --accent-strong: #075e67;
  --warm: #b45309;
  --good: #0f766e;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(20, 38, 56, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(216, 224, 231, 0.86);
  background: rgba(251, 252, 253, 0.92);
  backdrop-filter: blur(12px);
}

.topbar h1,
.section h2,
.panel h2 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(20px, 3vw, 30px);
}

.topbar__nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.language-control {
  min-width: 126px;
}

.language-control span {
  font-size: 12px;
}

.topbar__nav a {
  min-width: 68px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}

.topbar__nav a:hover {
  border-color: var(--line);
  color: var(--accent-strong);
  background: var(--surface);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.hero {
  min-height: 430px;
  display: grid;
  align-items: center;
  margin: 24px 0;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(10, 38, 48, 0.88), rgba(10, 38, 48, 0.48)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='600' viewBox='0 0 1200 600'%3E%3Crect width='1200' height='600' fill='%23dfe8ed'/%3E%3Cg fill='none' stroke='%23087f8c' stroke-width='4' opacity='.58'%3E%3Cpath d='M105 352 C188 220 297 223 360 318 S557 420 636 268 S844 97 955 205 1058 430 1130 352'/%3E%3Cpath d='M80 430 C188 320 289 346 362 388 S526 428 613 332 795 179 904 274 1039 430 1136 390' opacity='.45'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='.92'%3E%3Ccircle cx='106' cy='352' r='18'/%3E%3Ccircle cx='360' cy='318' r='18'/%3E%3Ccircle cx='636' cy='268' r='18'/%3E%3Ccircle cx='955' cy='205' r='18'/%3E%3Ccircle cx='1130' cy='352' r='18'/%3E%3Ccircle cx='80' cy='430' r='14'/%3E%3Ccircle cx='613' cy='332' r='14'/%3E%3Ccircle cx='904' cy='274' r='14'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.auth-screen {
  display: grid;
  gap: 22px;
  min-height: calc(100vh - 96px);
  align-content: center;
  padding: 34px 0;
}

.auth-hero {
  max-width: 760px;
}

.auth-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.04;
}

.auth-hero h3 {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: clamp(22px, 3vw, 34px);
}

.auth-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
  align-items: start;
}

.auth-login-message {
  grid-column: 1 / -1;
  min-height: 24px;
  margin-top: -6px;
}

.hero__content {
  width: min(720px, 100%);
  padding: clamp(28px, 6vw, 64px);
  color: white;
}

.hero h2 {
  margin: 0 0 16px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.08;
}

.hero p {
  max-width: 630px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
}

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

.section {
  padding: 32px 0;
}

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

.section__heading--compact {
  align-items: center;
}

.section h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.filter,
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 700;
}

.button--primary {
  background: var(--accent);
  color: white;
}

.button--primary:hover {
  background: var(--accent-strong);
}

.button--ghost {
  border-color: var(--line);
  background: white;
  color: var(--accent-strong);
}

.button--ghost:hover {
  border-color: var(--accent);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-color: var(--line);
  background: white;
  color: var(--muted);
  font-size: 22px;
}

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

.product-card,
.panel,
.order-card,
.invoice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.product-card h3 {
  margin: 0;
  font-size: 22px;
}

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

.product-meta span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef2f6;
  padding-bottom: 7px;
}

.product-card__footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.price {
  color: var(--warm);
  font-size: 22px;
  font-weight: 800;
}

.section--split {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

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

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

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

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 22px;
}

.checkbox-field input {
  width: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cart-list {
  display: grid;
  gap: 10px;
  min-height: 100px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr 92px 34px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fbfdff;
}

.cart-item strong {
  display: block;
}

.cart-item small {
  color: var(--muted);
}

.cart-item input {
  padding: 8px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.totals {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.totals dt,
.totals dd {
  margin: 0;
}

.totals__grand {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 20px;
  font-weight: 800;
}

.message {
  min-height: 24px;
  color: var(--good);
  font-weight: 700;
}

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

.invoice-result[hidden],
[hidden] {
  display: none !important;
}

.invoice {
  padding: clamp(18px, 4vw, 34px);
}

.invoice__top,
.invoice__summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.invoice h3 {
  margin: 0 0 10px;
  font-size: 28px;
}

.invoice table,
.order-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

.invoice th,
.invoice td,
.order-card th,
.order-card td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.invoice th,
.order-card th {
  color: var(--muted);
  font-size: 13px;
}

.invoice__totals {
  width: min(320px, 100%);
  margin-left: auto;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
}

.hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.orders-list {
  display: grid;
  gap: 14px;
}

.admin-block {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-edit-form {
  margin-bottom: 16px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-row h3,
.admin-row p {
  margin: 0 0 5px;
}

.admin-row__amount {
  color: var(--warm);
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}

.admin-row__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.order-card {
  padding: 18px;
}

.order-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.order-card h3 {
  margin: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #edf7f7;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.order-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  color: var(--muted);
}

.order-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

@media (max-width: 800px) {
  .topbar,
  .section__heading,
  .invoice__top,
  .invoice__summary,
  .order-card__head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar__nav {
    width: 100%;
  }

  .topbar__nav a {
    flex: 1;
  }

  .hero {
    min-height: 390px;
  }

  .section--split,
  .auth-grid,
  .form-grid,
  .form-grid--three,
  .admin-login,
  .admin-row,
  .order-card__grid {
    grid-template-columns: 1fr;
  }

  .admin-row__amount,
  .admin-row__actions {
    justify-content: flex-start;
    text-align: left;
  }

  .cart-item {
    grid-template-columns: 1fr 84px 34px;
  }
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .hero,
  #catalog,
  #order,
  .section__heading button {
    display: none !important;
  }

  main {
    width: 100%;
    margin: 0;
  }

  .invoice {
    border: 0;
    box-shadow: none;
  }
}
