:root {
  --blue: #004aad;
  --blue-dark: #00357d;
  --orange: #fc8e4c;
  --ink: #111317;
  --white: #ffffff;
  --surface: #f4f4f0;
  --line: rgba(17, 19, 23, 0.14);
  --display: "Anton", Impact, sans-serif;
  --body: "Inter", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--surface); color: var(--ink); }

body {
  margin: 0;
  min-width: 0;
  font-family: var(--body);
  background:
    linear-gradient(135deg, rgba(0, 74, 173, 0.06), transparent 32rem),
    var(--surface);
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.62; }

.payment-header {
  min-height: 92px;
  padding: 0 clamp(1rem, 4vw, 4rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.payment-brand { display: inline-flex; width: max-content; }
.payment-brand img { width: 132px; height: auto; display: block; }
.secure-label { font-weight: 700; font-size: 0.84rem; letter-spacing: 0.08em; text-transform: uppercase; }
.back-link { justify-self: end; font-weight: 700; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { color: var(--blue); }

.sandbox-banner {
  padding: 0.7rem 1rem;
  text-align: center;
  color: var(--ink);
  background: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.payment-layout {
  width: min(1180px, calc(100% - 2rem));
  margin: clamp(2rem, 5vw, 5rem) auto;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(310px, 0.7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.payment-panel,
.order-summary {
  min-width: 0;
  border-radius: 22px;
}

.payment-panel {
  padding: clamp(1.25rem, 3vw, 2.75rem);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(17, 19, 23, 0.08);
}

.kicker,
.summary-kicker {
  margin: 0 0 0.8rem;
  color: var(--orange);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.13em;
}

h1,
h2 { font-family: var(--display); font-weight: 400; }

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
}

.payment-subtitle { margin: 1rem 0 2rem; color: rgba(17, 19, 23, 0.66); }
.loading-card { padding: 1.25rem; border: 1px dashed var(--blue); border-radius: 14px; color: var(--blue-dark); }

.method-section {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.method-section.is-pending { visibility: hidden; }

.section-label { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 1rem; }
.section-label h2 { margin: 0; font-size: clamp(1.35rem, 2.5vw, 2rem); letter-spacing: 0.015em; }

.field-heading {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.field-help { margin: 0 0 0.85rem; color: rgba(17, 19, 23, 0.62); font-size: 0.8rem; line-height: 1.45; }
.payment-choice-heading { margin: 1.15rem 0 0.75rem; }

#express-checkout-element,
#contact-details-element,
#payment-element { min-width: 0; }

#contact-details-element { margin-bottom: 1rem; }

.primary-action,
.secondary-action {
  width: 100%;
  min-height: 54px;
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action { color: var(--ink); background: var(--orange); box-shadow: 5px 5px 0 var(--blue); }
.secondary-action { color: var(--ink); background: var(--orange); box-shadow: 5px 5px 0 var(--blue); }
.primary-action:not(:disabled):hover,
.primary-action:not(:disabled):focus-visible,
.secondary-action:not(:disabled):hover,
.secondary-action:not(:disabled):focus-visible { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.55rem;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.bank-transfer p { margin: 0 0 1rem; color: rgba(17, 19, 23, 0.7); line-height: 1.6; }
.email-error { margin: 0.8rem 0 0; color: #9b1c1c; font-size: 0.82rem; font-weight: 600; line-height: 1.45; }
.bank-transfer label { display: block; margin-bottom: 0.45rem; font-size: 0.85rem; font-weight: 700; }
.bank-transfer input {
  width: 100%;
  min-height: 50px;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(17, 19, 23, 0.35);
  border-radius: 9px;
  background: var(--white);
}
.bank-transfer input:focus { outline: 3px solid rgba(0, 74, 173, 0.2); border-color: var(--blue); }

.payment-message { min-height: 1.4rem; margin-top: 1rem; color: #9b1c1c; font-weight: 600; line-height: 1.5; }
.security-copy { display: grid; gap: 0.25rem; margin-top: 1.5rem; padding: 1rem; background: var(--surface); border-radius: 12px; font-size: 0.82rem; line-height: 1.45; }
.security-copy strong { color: var(--blue-dark); }

.order-summary {
  position: sticky;
  top: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(145deg, var(--blue), var(--blue-dark));
  box-shadow: 10px 10px 0 var(--orange);
}

.order-summary::after {
  content: "A";
  position: absolute;
  right: -0.1em;
  bottom: -0.28em;
  z-index: 0;
  font-family: var(--display);
  font-size: 14rem;
  color: rgba(255,255,255,0.055);
  pointer-events: none;
}

.order-summary::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -80%;
  z-index: 2;
  width: 70%;
  height: 220%;
  pointer-events: none;
  transform: rotate(32deg) translateX(-180%);
  background: linear-gradient(90deg, transparent 0%, rgba(252, 142, 76, 0.1) 20%, rgba(255, 255, 255, 0.22) 48%, rgba(252, 142, 76, 0.24) 62%, transparent 100%);
  filter: blur(2px);
}

.order-summary.is-sweeping::before { animation: alta-summary-shine 780ms ease-out; }

.order-summary > * { position: relative; z-index: 1; }
.order-summary h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1; }
.summary-price { margin: 0.85rem 0 1.8rem; color: var(--orange); font-family: var(--display); font-size: clamp(2rem, 4vw, 3.2rem); }
.summary-benefits { display: grid; gap: 0.7rem; margin: 0; padding: 1.2rem 0 1.6rem; list-style: none; border-top: 1px solid rgba(255,255,255,0.25); }
.summary-benefits li::before { content: "✓"; margin-right: 0.6rem; color: var(--orange); font-weight: 900; }
.summary-totals { display: grid; gap: 0.8rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,0.25); }
.summary-totals div { display: flex; justify-content: space-between; gap: 1rem; }
.summary-total { padding-top: 0.8rem; font-size: 1.08rem; border-top: 1px solid rgba(255,255,255,0.15); }
.summary-sandbox { display: inline-block; margin-top: 2rem; padding: 0.45rem 0.65rem; color: var(--ink); background: var(--orange); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; }

.return-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--blue); }
.return-shell { width: min(720px, 100%); padding: clamp(1.5rem, 5vw, 4rem); border-radius: 22px; background: var(--white); box-shadow: 10px 10px 0 var(--orange); }
.return-brand { display: flex; justify-content: center; align-items: center; width: 100%; margin-bottom: 2rem; }
.return-brand img { display: block; width: 230px; height: auto; margin-inline: auto; }
.return-kicker { margin: 0 0 0.6rem; color: var(--orange); font-weight: 900; letter-spacing: 0.12em; font-size: 0.75rem; }
.return-shell h1 { margin-bottom: 1rem; }
.return-message { max-width: 58ch; line-height: 1.65; }
.return-email { font-weight: 700; color: var(--blue-dark); }
.return-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.return-actions a,
.return-actions button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 0.75rem 1rem; border: 2px solid var(--ink); border-radius: 9px; font-weight: 800; text-decoration: none; }
.return-actions [hidden] { display: none; }
.return-actions .primary-link { color: var(--white); background: var(--blue); box-shadow: 4px 4px 0 var(--orange); }
.return-actions .secondary-link { background: var(--surface); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes alta-summary-shine {
  from { transform: rotate(32deg) translateX(-180%); }
  to { transform: rotate(32deg) translateX(380%); }
}

@media (max-width: 900px) {
  .payment-layout { grid-template-columns: minmax(0, 1fr); }
  .order-summary { position: relative; top: auto; grid-row: 1; }
}

@media (max-width: 560px) {
  .payment-header { min-height: 76px; grid-template-columns: 1fr auto; padding-inline: 1rem; }
  .payment-brand img { width: 106px; }
  .secure-label { display: none; }
  .back-link { font-size: 0.82rem; }
  .payment-layout { width: min(100% - 1rem, 1180px); margin: 1rem auto 2rem; gap: 1rem; }
  .payment-panel, .order-summary { border-radius: 15px; }
  .payment-panel, .order-summary { padding: 1.1rem; }
  h1 { font-size: clamp(2rem, 11vw, 3.1rem); overflow-wrap: normal; }
  .method-section { padding-block: 1.2rem; }
  .summary-price { margin-bottom: 1.2rem; }
  .order-summary { box-shadow: 6px 6px 0 var(--orange); }
  .return-brand img { width: 168px; }
  .return-actions { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .order-summary::before { display: none; }
}
