:root {
  --panel: rgba(255, 255, 255, 0.96);
  --soft: #f6f8fc;
  --success: #116b3b;
  --success-bg: #edf9f2;
  --danger: #a52626;
  --danger-bg: #fff1f1;
}

body {
  min-height: 100vh;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

.hero {
  padding: 42px 0 30px;
}

.topbar {
  margin-bottom: 34px;
}

.nav a {
  color: rgba(255, 255, 255, 0.9);
}

.hero-copy p {
  color: rgba(255, 255, 255, 0.84);
}

.footer {
  padding: 32px 0 50px;
  color: rgba(255, 255, 255, 0.7);
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.page-card,
.order-card {
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.page-card {
  padding: 34px;
}

.order-card {
  padding: 26px;
  position: sticky;
  top: 18px;
}

.section-title {
  margin: 0 0 8px;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-copy {
  margin: 0 0 26px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-weight: 800;
  font-size: 14px;
}

.required {
  color: var(--danger);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--text);
  background: white;
  border: 1px solid #bcc8da;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(27, 108, 255, 0.12);
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.terms-box {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.terms-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.terms-line input {
  margin-top: 5px;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  padding: 12px 20px;
  border-radius: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
}

.primary-button {
  width: 100%;
  margin-top: 20px;
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--brand), #2c7bff);
  box-shadow: 0 14px 30px rgba(27, 108, 255, 0.26);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.secondary-button {
  border: 1px solid #b9c7db;
  color: var(--text);
  background: white;
}

.order-card h2 {
  margin: 0 0 14px;
  font-size: 21px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.price-row:last-of-type {
  border-bottom: 0;
}

.price-label {
  color: var(--muted);
}

.price-value {
  text-align: right;
  font-weight: 800;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #cbd6e6;
  font-size: 20px;
  font-weight: 900;
}

.license-note {
  margin: 18px 0 0;
  padding: 14px;
  border-radius: 14px;
  background: #f0f8ff;
  border: 1px solid #cce8ff;
  color: #12324f;
  font-size: 14px;
}

.status-box {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
}

.status-box.visible {
  display: block;
}

.status-box.info {
  color: #12324f;
  background: #f0f8ff;
  border: 1px solid #cce8ff;
}

.status-box.error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #ffcaca;
}

.status-box.success {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #bee8cf;
}

.checkout-panel {
  display: none;
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.checkout-panel.visible {
  display: block;
}

.checkout-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.checkout-heading h2 {
  margin: 0;
  font-size: 23px;
}

#stripe-checkout {
  min-height: 420px;
}

.success-panel {
  display: none;
  padding: 24px;
  border-radius: 18px;
  background: var(--success-bg);
  border: 1px solid #bee8cf;
  color: #124d30;
}

.success-panel.visible {
  display: block;
}

.success-panel h2 {
  margin: 0 0 10px;
}

.success-panel p {
  margin: 8px 0;
}

.secure-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.action-row .primary-button,
.action-row .secondary-button {
  width: auto;
  margin-top: 0;
  min-width: 170px;
}

.license-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.license-detail {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.license-detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.license-detail strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

@media (max-width: 880px) {
  .purchase-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .order-card {
    position: relative;
    top: auto;
  }

  .page-card {
    padding: 24px;
  }

  .field.full {
    grid-column: auto;
  }

  .license-details {
    grid-template-columns: 1fr;
  }
}
