:root { color-scheme: light; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f4f4f2;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}

.checkout { max-width: 1050px; margin: auto; padding: 2rem; }

.back-link { color: #333; font-size: 0.95rem; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.content {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.order-summary, .payment-card {
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 35px #00000012;
}

.brand-logo { display: block; width: 96px; height: 96px; margin-bottom: 2rem; object-fit: contain; }
.label { margin: 0 0 0.5rem; color: #666; font-size: 0.75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0 0 1.75rem; line-height: 1.15; }
h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); }
h2 { font-size: 1.65rem; }

.line-item, .total { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; }
.total { margin-top: .75rem; border-top: 1px solid #dedede; font-size: 1.2rem; }

.notice { margin: -1rem 0 1.75rem; color: #555; font-size: .9rem; line-height: 1.45; }
form { display: grid; gap: 1.1rem; }
label { display: grid; gap: .45rem; font-size: .9rem; font-weight: 700; }
input {
  width: 100%; padding: .9rem 1rem; border: 1px solid #c9c9c9; border-radius: .45rem;
  color: #111; font: inherit; font-weight: 400; outline: none;
}
input:focus { border-color: #000; box-shadow: 0 0 0 3px #00000012; }
.short-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.expiry-date { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .45rem; }
.expiry-date input { min-width: 0; text-align: center; }
button { border: 0; border-radius: .45rem; padding: 1rem; background: #000; color: #fff; cursor: pointer; font: inherit; font-weight: 700; }
button:hover, button:focus-visible { background: #333; }
.message { min-height: 1.2em; margin: 1rem 0 0; font-size: .9rem; font-weight: 700; }

.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 1.25rem; background: #00000080; }
.modal[hidden] { display: none; }
.modal-content { width: min(100%, 430px); padding: 2.5rem; border-radius: 1rem; background: #fff; text-align: center; box-shadow: 0 20px 50px #00000040; }
.modal-content h2 { margin-bottom: .75rem; }
.modal-content p:not(.label) { color: #555; line-height: 1.5; }
.modal-content button { width: 100%; margin-top: 1rem; }
.loader { width: 3.2rem; height: 3.2rem; margin: 0 auto 1.5rem; border: .28rem solid #e4e4e4; border-top-color: #000; border-radius: 50%; animation: spin .9s linear infinite; }
.modal.complete .loader { display: grid; place-items: center; border-color: #16803a; animation: none; }
.modal.complete .loader::after { content: "✓"; color: #16803a; font-size: 2rem; font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .checkout { padding: 1.25rem; }
  .content { grid-template-columns: 1fr; }
  .order-summary { order: 2; }
}
