:root {
  --checkout-bg: #f2f6fc;
  --checkout-text: #0f172a;
  --checkout-muted: #4f678a;
  --checkout-border: #c8dcfa;
  --checkout-primary: #0f62fe;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--checkout-text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, #f2f6fc 0%, #edf3fb 100%);
}

.checkout-page {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 22px 0 42px;
}

.checkout-wrap {
  width: min(1420px, calc(100% - 48px));
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1.03fr 0.97fr;
  gap: 14px;
}

.checkout-order-panel,
.checkout-form-panel {
  border: 1px solid #d7e4f7;
  border-radius: 10px;
  background: #ffffff;
  padding: 16px;
}

.checkout-pill {
  width: fit-content;
  margin: 0;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #b7d3fb;
  border-radius: 999px;
  background: #edf5ff;
  color: #1448a6;
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkout-order-panel h1 {
  margin: 12px 0 0;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.1;
}

.checkout-intro {
  margin: 8px 0 0;
  color: var(--checkout-muted);
  line-height: 1.55;
}

.checkout-plan-card {
  margin-top: 14px;
  border: 1px solid #c5daf8;
  border-radius: 10px;
  background: linear-gradient(180deg, #f9fcff 0%, #eef6ff 100%);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.checkout-plan-label {
  margin: 0;
  color: #335d9e;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkout-plan-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #123a80;
}

.checkout-plan-price {
  margin: 0;
  color: #0f62fe;
  font-size: 1.03rem;
  font-weight: 800;
}

.checkout-plan-sub {
  margin: 0;
  color: #5f7294;
  font-size: 0.84rem;
}

.checkout-feature-block {
  margin-top: 12px;
}

.checkout-feature-block h3 {
  margin: 0;
  font-size: 1rem;
}

.checkout-feature-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.checkout-feature-list li {
  position: relative;
  padding-left: 21px;
  color: #365172;
  font-size: 0.9rem;
}

.checkout-feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f62fe;
}

.checkout-totals {
  margin-top: 14px;
  border: 1px solid #d8e5f7;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.checkout-totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #365172;
  font-size: 0.92rem;
}

.checkout-totals strong {
  color: #113a7b;
  font-size: 0.95rem;
}

.checkout-totals .total-row {
  padding-top: 8px;
  border-top: 1px dashed #c8dcfa;
  font-size: 0.96rem;
  font-weight: 700;
}

.checkout-totals .total-row strong {
  color: #0f62fe;
  font-size: 1.08rem;
}

.checkout-trust-grid {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.checkout-trust-grid article {
  border: 1px solid #d7e4f7;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.checkout-trust-grid h4 {
  margin: 0;
  color: #123a80;
  font-size: 0.9rem;
}

.checkout-trust-grid p {
  margin: 6px 0 0;
  color: #5b6f91;
  font-size: 0.84rem;
  line-height: 1.45;
}

.checkout-form-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.back-link {
  width: fit-content;
  text-decoration: none;
  color: #1c4fae;
  font-weight: 700;
  font-size: 0.9rem;
}

.back-link:hover {
  color: #0b3e98;
}

.plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #c5daf8;
  border-radius: 10px;
  background: linear-gradient(180deg, #f9fcff 0%, #eef6ff 100%);
  padding: 12px;
}

.plan-name,
.plan-price {
  margin: 0;
}

.plan-name {
  font-size: 1rem;
  font-weight: 800;
  color: #123a80;
}

.plan-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f62fe;
}

.payment-form {
  display: grid;
  gap: 12px;
}

.card-fields {
  display: grid;
  gap: 12px;
}

.no-card-note {
  margin: 0;
  border: 1px solid #bfe2f1;
  border-radius: 10px;
  background: #edf9ff;
  color: #1b5f7c;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.payment-form label {
  display: grid;
  gap: 7px;
  color: #335173;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-status {
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-status.error {
  border-color: #f4b9be;
  background: #fff1f2;
  color: #8f1d2c;
}

.form-status.success {
  border-color: #92e0bc;
  background: #ecfff5;
  color: #1b5f43;
}

.payment-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c5daf8;
  border-radius: 10px;
  background: #fbfdff;
  color: #0f213e;
  padding: 0 12px;
  font-size: 0.96rem;
}

.payment-form input:focus {
  outline: 2px solid rgba(15, 98, 254, 0.2);
  border-color: #80b3fc;
}

#payNowButton[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.payment-form input.invalid {
  border-color: #e34d59;
  background: #fff6f7;
}

.field-error {
  margin-top: -2px;
  color: #b42334;
  font-size: 0.8rem;
  line-height: 1.3;
}

.row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.payment-success {
  border: 1px solid #92e0bc;
  border-radius: 12px;
  background: #ecfff5;
  color: #1b5f43;
  padding: 14px 16px;
}

.payment-success strong {
  display: block;
  font-size: 0.95rem;
}

.payment-success p {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.success-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.success-actions .btn {
  min-height: 42px;
}

@media (max-width: 1020px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .checkout-wrap {
    width: min(1420px, calc(100% - 30px));
  }

  .checkout-page {
    padding-top: 16px;
  }

  .row-fields {
    grid-template-columns: 1fr;
  }

  .success-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .plan-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}
