:root {
  color-scheme: light;
  --surface: #ffffff;
  --surface-muted: #f4f7fb;
  --text: #132238;
  --muted: #5f6c7b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --border: #e6ebf2;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #f8fbff 0%, #eff5ff 100%);
}

body.modal-open {
  overflow: hidden;
}

.checkout-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.order-card {
  width: min(100%, 480px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.order-card h1 {
  margin: 1rem 0 0.5rem;
  font-size: 1.6rem;
}

.order-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.order-summary {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1rem 0.5rem;
  background: var(--surface-muted);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.8rem;
  color: var(--muted);
}

.summary-row + .summary-row {
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.summary-row strong {
  color: var(--text);
}

.checkout-button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
}

.checkout-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.checkout-button.is-inline {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.checkout-button:disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none;
}

.helper-text {
  margin-top: 0.9rem;
  font-size: 0.95rem;
  text-align: center;
}

.status-message {
  margin-top: 0.75rem;
  min-height: 1.25rem;
  color: var(--primary);
  font-size: 0.95rem;
  text-align: center;
}

.checkout-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 20, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
  z-index: 1000;
}

.checkout-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.checkout-modal__panel {
  width: min(100%, 980px);
  height: min(92vh, 780px);
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.checkout-modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
}

.checkout-modal__header {
  padding: 1.3rem 1.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.checkout-modal__header h2 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.checkout-modal__header p {
  margin: 0;
  color: var(--muted);
}

.checkout-modal__frame-wrap {
  flex: 1;
  padding: 0.8rem;
  background: var(--surface-muted);
}

.checkout-modal__frame-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  border-radius: 16px;
  background: #fff;
}

@media (max-width: 680px) {
  .order-card {
    padding: 1.5rem;
  }

  .checkout-modal__panel {
    height: 100vh;
    border-radius: 0;
  }

  .checkout-modal__frame-wrap {
    padding: 0.5rem;
  }
}
