:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #166534;
  --success-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 28%),
    var(--bg);
}

input, select, button { font: inherit; }

.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

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

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 1.6px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.1;
}

.subtitle {
  margin: 10px 0 0;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.55;
}

.badge {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: #e2e8f0; color: #334155; }

.checkout-form {
  display: block;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
}

.stepper-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  transition: background 0.2s, color 0.2s;
}

.stepper-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.stepper-item.active .stepper-dot {
  background: var(--primary);
  color: #fff;
}

.stepper-item.active .stepper-label {
  color: var(--text);
}

.stepper-item.done .stepper-dot {
  background: var(--success-bg);
  color: var(--success);
}

.stepper-item.done .stepper-label {
  color: var(--success);
}

.stepper-line {
  flex: 1;
  max-width: 80px;
  height: 2px;
  margin: 0 8px 22px;
  background: #e2e8f0;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

.step-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.step-actions-back {
  margin-top: 14px;
}

.step-actions .btn {
  width: auto;
  flex: 1;
}

.step-actions .btn-primary:only-child {
  width: 100%;
  flex: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.field span em {
  color: var(--danger);
  font-style: normal;
}

.field span small {
  font-weight: 500;
  color: var(--muted);
}

.field-grid .field:first-child {
  grid-column: 1 / -1;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.15);
}

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

.product-card {
  position: relative;
  cursor: pointer;
}

.product-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-body {
  height: 100%;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.product-card input:checked + .product-body,
.product-card:hover .product-body {
  border-color: #64748b;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.product-card input:checked + .product-body {
  border-color: var(--primary);
  background: #f8fafc;
}

.product-image {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}

.product-name {
  font-size: 1rem;
  font-weight: 800;
}

.product-description {
  margin-top: 6px;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-price {
  margin-top: 14px;
  font-size: 1.35rem;
  font-weight: 800;
}

.summary-panel {
  position: static;
}

.review-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  background: #f8fafc;
}

.review-group + .review-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.review-group h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.review-group p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.review-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}

.review-total strong {
  font-size: 1.75rem;
}

#payBtn {
  width: 100%;
  margin-top: 18px;
}

.btn-secondary {
  background: #eef2f7;
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: var(--muted);
  font-size: 14px;
}

.summary-row.total {
  padding-top: 14px;
  margin-bottom: 8px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
}

.summary-row.total strong {
  font-size: 1.75rem;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-danger {
  margin-top: 10px;
  background: var(--danger-bg);
  color: var(--danger);
}

.status {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
}

.status.success {
  background: var(--success-bg);
  color: var(--success);
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-error {
  background: var(--danger-bg);
  color: #991b1b;
}

.empty {
  color: var(--muted);
  line-height: 1.55;
}

.footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.hidden { display: none !important; }

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
  }

  .stepper {
    padding: 14px 10px;
  }

  .stepper-line {
    max-width: 36px;
    margin-bottom: 18px;
  }

  .stepper-label {
    font-size: 11px;
  }

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

  .field-grid .field:first-child {
    grid-column: auto;
  }

  .step-actions {
    flex-direction: column-reverse;
  }

  .step-actions .btn {
    width: 100%;
  }
}
