/* Checkout and thank-you pages. Same Ink & Signal tokens as the site (styles.css). */

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

.co {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px 96px;
  align-items: start;
}
.co h1 {
  font-size: 36px;
  font-weight: 740;
}
.co-notice {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fff3ec;
  border: 1px solid #ffd3bf;
  color: #7a2e0e;
}

fieldset {
  min-width: 0; /* browsers default fieldsets to min-content, which overflowed phones */
  margin: 32px 0 0;
  padding: 0;
  border: 0;
}
legend {
  margin-bottom: 14px;
  padding: 0;
  font-weight: 650;
  font-size: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.field span {
  font-size: 14px;
  font-weight: 550;
  color: var(--ink-2);
}
.field small {
  color: var(--muted);
  font-size: 13px;
}
.field input {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  font: 16px var(--ui); /* 16px keeps phones from zooming in */
  transition: border-color 100ms;
}
.field input:focus {
  outline: none;
  border-color: var(--ink);
}
.field input::placeholder {
  color: #a3a097;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field input {
  min-width: 0;
  width: 100%;
}

/* payment methods and banks: real radio buttons, styled as tiles */
.methods {
  display: grid;
  gap: 10px;
}
.method,
.bank {
  position: relative;
  cursor: pointer;
}
.method input,
.bank input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.method > span {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 14px 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  transition: border-color 100ms;
}
.method > span::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 1.5px solid #a3a097;
  border-radius: 50%;
  background: #fff;
}
.method small {
  color: var(--muted);
  font-size: 14px;
}
.method input:checked + span {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.method input:checked + span::before {
  border: 5px solid var(--ink);
}
.method input:focus-visible + span,
.bank input:focus-visible + span {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

.panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 12px;
  background: #e9e7e0;
}
.panel-title {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 15px;
}
.panel-hint {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}
.panel .field:first-of-type {
  margin-top: 12px;
}
.banks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bank span {
  display: block;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  font-size: 14px;
  text-align: center;
  transition: border-color 100ms;
}
.bank:hover span {
  border-color: #b8b4a9;
}
.bank input:checked + span {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  font-weight: 600;
}

.co-error {
  margin: 20px 0 0;
  color: #b4280a;
  font-weight: 550;
}
#co .buy.wide {
  margin-top: 24px;
  font-size: 17px;
}
.buy:disabled {
  opacity: 0.6;
  cursor: progress;
}
.co-fine {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.co-summary {
  position: sticky;
  top: 96px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-2);
}
.co-summary img {
  border-radius: 10px;
  margin-bottom: 18px;
}
.sum-row,
.sum-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.co-summary ul {
  margin: 10px 0 18px;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 14px;
}
.sum-total {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}
.sum-fine {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* thank-you page */
.ty {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}
.ty h1 {
  font-size: 40px;
  font-weight: 750;
}
.ty .lead {
  margin: 14px 0 28px;
}
.ty-steps {
  margin: 32px 0 0;
  padding-left: 20px;
  color: var(--ink-2);
}
.ty-steps li + li {
  margin-top: 8px;
}
.ty-box {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: 12px;
  background: #e9e7e0;
  color: var(--ink-2);
  font-size: 15px;
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  vertical-align: -3px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 800ms linear infinite; /* only while waiting for the bank */
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .co {
    grid-template-columns: minmax(0, 1fr); /* let the column shrink to the phone's width */
    gap: 32px;
    padding-top: 24px;
  }
  .co-summary {
    position: static;
    order: -1;
  }
  .co-summary img {
    display: none;
  }
  .banks {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
