:root {
  color-scheme: light;
  --ink: #20201f;
  --muted: #696763;
  --line: #e5e2dd;
  --brand: #15948f;
  --brand-dark: #0b6f6b;
  --brand-soft: #e9f7f5;
  --surface: #ffffff;
  --background: #fbfaf8;
  --shadow: 0 14px 40px rgba(30, 29, 27, 0.07);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--background); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px 24px 18px;
}

.brand {
  display: grid;
  gap: 1px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  color: var(--brand);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.secure {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #4d4b48;
  font-size: 12px;
  font-weight: 700;
}

.secure span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 10px;
}

.page {
  width: min(1120px, 100%);
  min-height: calc(100vh - 155px);
  margin: 0 auto;
  padding: 24px 24px 60px;
}

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 28px;
  align-items: start;
}

.checkout-main { min-width: 0; }
.intro { margin: 2px 0 24px; }
.eyebrow { margin: 0 0 7px; color: var(--brand-dark); font-size: 10px; font-weight: 700; letter-spacing: 0.18em; }
h1 { margin: 0 0 8px; font-size: clamp(34px, 4.5vw, 48px); line-height: 1.03; letter-spacing: -0.055em; }
.intro > p:last-child { margin: 0; color: var(--muted); font-size: 15px; }

#checkout-form { display: grid; gap: 16px; }
.form-card,
.summary-card,
.checkout-actions {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-card {
  display: grid;
  gap: 17px;
  margin: 0;
  padding: 24px;
}

.form-card legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.form-card legend span {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
}

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

label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #3d3b38;
  font-size: 13px;
  font-weight: 700;
}

label em { color: var(--muted); font-style: normal; font-weight: 400; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9d6d1;
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.18s, box-shadow 0.18s;
}

input, select { height: 52px; padding: 0 14px; }
select { padding-right: 42px; cursor: pointer; }
textarea { min-height: 92px; padding: 13px 14px; resize: vertical; }
input[readonly] { background: #f7f6f4; color: #5c5955; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field-help { margin-top: -2px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.4; }

.delivery-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}

.choice.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choice-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #f1efec; color: var(--brand-dark); font-size: 18px; }
.choice.selected .choice-icon { background: #fff; }
.choice-copy { min-width: 0; }
.choice strong, .choice small { display: block; }
.choice strong { margin-bottom: 3px; color: var(--ink); font-size: 13px; line-height: 1.2; }
.choice small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.3; }
.choice b { color: var(--ink); font-size: 13px; white-space: nowrap; }

.summary-card { position: sticky; top: 18px; overflow: hidden; padding: 22px; }
.summary-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.summary-heading h2 { margin: 0; font-size: 22px; letter-spacing: -0.04em; }
.summary-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.summary-heading a { color: var(--brand-dark); font-size: 12px; font-weight: 700; }

.items { display: grid; gap: 0; border-bottom: 1px solid var(--line); }
.item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  min-width: 0;
  padding: 17px 0;
}

.item + .item { border-top: 1px solid #efedea; }
.item img, .item-placeholder { width: 58px; height: 58px; border-radius: 11px; object-fit: cover; background: #f2f0ed; }
.item-placeholder { display: grid; place-items: center; font-size: 24px; }
.item-copy { min-width: 0; overflow-wrap: anywhere; }
.item h3 { margin: 0 0 5px; font-size: 12px; line-height: 1.35; }
.item p { margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.item p.item-detail { margin-top: 5px; color: #4f4c48; }
.item-price { align-self: start; padding-top: 1px; font-size: 12px; white-space: nowrap; }

.totals { display: grid; gap: 10px; padding: 18px 0 0; }
.totals > div { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 13px; }
.totals strong { color: var(--ink); }
.totals .grand-total { align-items: baseline; margin-top: 4px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--ink); font-size: 16px; font-weight: 700; }
.grand-total strong { font-size: 24px; letter-spacing: -0.045em; }

.trust-box { display: flex; gap: 10px; margin-top: 18px; padding: 12px; border-radius: 12px; background: var(--brand-soft); color: #365956; }
.trust-box > span { display: grid; place-items: center; flex: 0 0 auto; width: 21px; height: 21px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; }
.trust-box p { margin: 0; font-size: 10px; line-height: 1.45; }

.checkout-actions { display: grid; gap: 10px; padding: 14px; }
.pay-button, .primary-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 56px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, background 0.18s;
}

.pay-button { justify-content: space-between; width: 100%; padding: 0 18px; font-size: 14px; }
.pay-button:hover, .primary-link:hover { background: var(--brand-dark); transform: translateY(-1px); }
.checkout-actions > p { margin: 0; color: var(--muted); font-size: 10px; text-align: center; }
.form-message { padding: 14px 15px; border-radius: 11px; font-size: 12px; line-height: 1.5; }
.form-message.success { border: 1px solid #a8d9cd; background: #eaf7f3; color: #275e54; }

.state-card { max-width: 600px; margin: 54px auto; padding: 44px 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.state-card h1 { font-size: clamp(29px, 6vw, 39px); }
.state-card p { max-width: 440px; margin: 0 auto 22px; color: var(--muted); line-height: 1.6; }
.state-icon { display: block; margin-bottom: 14px; font-size: 38px; }
.primary-link { width: max-content; min-width: 165px; margin: 0 auto; padding: 0 20px; }
.spinner { display: block; width: 32px; height: 32px; margin: 0 auto 18px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

footer { display: flex; justify-content: space-between; gap: 20px; width: min(1120px, 100%); margin: 0 auto; padding: 0 24px 28px; color: var(--muted); font-size: 11px; }
footer a { color: var(--brand-dark); font-weight: 700; }

@media (max-width: 820px) {
  .checkout { grid-template-columns: 1fr; gap: 18px; }
  .summary-card { position: static; order: -1; }
}

@media (max-width: 560px) {
  .topbar { padding: 17px 16px 12px; }
  .brand { font-size: 17px; }
  .secure { padding: 8px 10px; font-size: 10px; }
  .page { padding: 16px 12px 42px; }
  .intro { margin: 2px 4px 20px; }
  h1 { font-size: 34px; }
  .intro > p:last-child { font-size: 13px; }
  .form-card, .summary-card, .checkout-actions { border-radius: 15px; }
  .form-card { gap: 15px; padding: 19px 15px; }
  .form-card legend { font-size: 18px; }
  .field-grid.two, .delivery-options { grid-template-columns: 1fr; }
  .choice { min-height: 72px; }
  .summary-card { padding: 18px 15px; }
  .item { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .item img, .item-placeholder { width: 52px; height: 52px; }
  .item-price { grid-column: 2; margin-top: -2px; color: var(--ink); }
  .checkout-actions { padding: 10px; }
  .pay-button { min-height: 54px; padding: 0 15px; }
  footer { padding: 0 16px 24px; }
}
