:root {
  --bg: #05060b;
  --bg-soft: #0b0f19;
  --panel: rgba(14, 18, 31, 0.9);
  --panel-strong: rgba(17, 23, 39, 0.96);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(83, 255, 205, 0.3);
  --text: #f5f7ff;
  --muted: #97a6c6;
  --cyan: #53ffcd;
  --blue: #59a7ff;
  --red: #ff5c7a;
  --amber: #ffd166;
  --green: #21c07a;
  --radius: 28px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
  --maxw: 1220px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Rajdhani, sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(83, 255, 205, 0.08), transparent 23%),
    radial-gradient(circle at 85% 10%, rgba(89, 167, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #05060b 0%, #080c14 45%, #05060c 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.28;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 90%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.checkout-container {
  width: min(var(--maxw), calc(100% - 40px));
  margin: 0 auto;
}

.checkout-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 11, 0.82);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.back-link {
  color: #d4dced;
  font-weight: 700;
}

.brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Orbitron, sans-serif;
  letter-spacing: 0.16em;
  font-size: 13px;
}

.checkout-shell {
  padding: 26px 0 70px;
}

.checkout-hero {
  display: grid;
  gap: 18px;
  margin-bottom: 26px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: var(--shadow);
}

.checkout-hero::before {
  content: "";
  position: absolute;
  inset: 0;
}

.hero-kicker,
.panel-label,
.label,
.total-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-kicker {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

.hero-copy h1,
.plan-title,
.form-title,
.price-final {
  font-family: Orbitron, sans-serif;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  max-width: 760px;
}

.hero-copy p:last-child {
  margin: 14px 0 0;
  max-width: 760px;
  color: #c8d3e8;
  font-size: 21px;
  line-height: 1.45;
}

.hero-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rule-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(83, 255, 205, 0.22);
  background: rgba(83, 255, 205, 0.07);
  color: #dffff5;
  font-weight: 700;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.02fr);
  gap: 24px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(83, 255, 205, 0.05), transparent 34%),
    radial-gradient(circle at 85% 15%, rgba(89, 167, 255, 0.12), transparent 24%);
  pointer-events: none;
}

.panel-label {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.plan-title,
.form-title {
  margin: 10px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
}

.form-subtitle {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.4;
}

.plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.plan-meta span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d8e2f4;
  font-weight: 600;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metric-box,
.summary-breakdown,
.coupon-box,
.compliance-box,
.card-pay-section {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.metric-box {
  padding: 14px;
}

.metric-box span,
.section-note,
.addon-description,
.terms-check,
.terms-error,
.compliance-box {
  color: var(--muted);
}

.metric-box span {
  display: block;
  font-size: 13px;
}

.metric-box strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-family: Orbitron, sans-serif;
}

.metric-counter {
  position: relative;
  display: inline-block;
  min-width: 92px;
}

.metric-counter.counter-loaded {
  animation: counterTurbo 0.6s ease;
}

.summary-breakdown {
  margin-top: 20px;
  padding: 16px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0;
  color: #c9d4e8;
}

.price-row.positive {
  color: #86f0b7;
}

.price-row.total {
  font-weight: 700;
}

.price-row.total span:first-child {
  color: #eef4ff;
}

.subtotal-value {
  color: #8fdcff;
}

.divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

.total-box {
  margin-top: 20px;
}

.total-label {
  color: #98a9ca;
  font-size: 12px;
  font-weight: 700;
}

.price-final {
  margin-top: 8px;
  font-size: clamp(30px, 4vw, 38px);
  color: #53ffcd;
  text-shadow: 0 0 18px rgba(83, 255, 205, 0.12);
  transition: 0.2s ease;
}

.coupon-feedback {
  margin-top: 12px;
  min-height: 20px;
  font-size: 15px;
}

.coupon-feedback.success {
  color: var(--green);
  font-weight: 700;
}

.price-final.price-loaded {
  animation: totalPulse 0.7s ease;
}

.subtotal-value.price-subtle-loaded {
  animation: subtotalPulse 0.55s ease;
}

.addons-section {
  margin-top: 26px;
}

.section-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-title-small {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
}

.section-note {
  font-size: 14px;
}

.addons-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.addon-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.addon-card:hover {
  transform: translateY(-2px);
  border-color: rgba(83, 255, 205, 0.2);
}

.addon-card.active {
  border-color: rgba(83, 255, 205, 0.34);
  background: rgba(83, 255, 205, 0.08);
  box-shadow: 0 0 18px rgba(83, 255, 205, 0.08);
}

.addon-check {
  display: none;
}

.addon-inner {
  display: flex;
  gap: 12px;
  align-items: start;
}

.addon-copy {
  flex: 1;
}

.addon-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.addon-name {
  font-size: 16px;
  font-weight: 800;
  color: #eef4ff;
}

.addon-price {
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.addon-description {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
}

.exclusive-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid rgba(255, 209, 102, 0.28);
  color: #ffe39a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.label {
  display: block;
  margin-bottom: 8px;
  color: #dce4f5;
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  padding: 14px 15px;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #eef4ff;
  font: inherit;
  font-size: 16px;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(83, 255, 205, 0.34);
  box-shadow: 0 0 0 3px rgba(83, 255, 205, 0.08);
}

.terms-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.terms-check input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
}

.terms-check input:checked + .checkmark {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-color: transparent;
}

.terms-check input:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  color: #041018;
  font-size: 12px;
  font-weight: 900;
}

.terms-check a {
  color: #edf5ff;
  text-decoration: underline;
}

.terms-error {
  margin-top: 10px;
  font-size: 14px;
  color: #ff8f9f;
}

.coupon-box {
  margin-top: 22px;
  padding: 18px;
}

.coupon-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.coupon-input {
  margin-bottom: 0;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary,
.btn-accent,
.coupon-btn {
  color: #041018;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 22px rgba(83, 255, 205, 0.18);
}

.btn-small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
}

.coupon-remove {
  margin-top: 10px;
  color: #eef5ff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.compliance-box {
  margin-top: 16px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
}

.payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.payment-btn {
  width: 100%;
}

.card-pay-section {
  margin-top: 24px;
  padding: 18px;
}

.card-element-shell {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.card-confirm {
  margin-top: 20px;
}

.card-result {
  margin-top: 14px;
  font-weight: 700;
  color: var(--green);
}

.checkout-footer {
  padding: 0 20px 28px;
  text-align: center;
  color: var(--muted);
}

.shake {
  animation: shake 0.35s;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

@keyframes counterTurbo {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(83, 255, 205, 0);
    color: var(--text);
  }
  40% {
    transform: scale(1.12);
    text-shadow: 0 0 24px rgba(83, 255, 205, 0.55);
    color: #ffffff;
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(83, 255, 205, 0);
    color: var(--text);
  }
}

@keyframes totalPulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(83, 255, 205, 0);
  }
  42% {
    transform: scale(1.08);
    text-shadow: 0 0 28px rgba(83, 255, 205, 0.55);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 18px rgba(83, 255, 205, 0.12);
  }
}

@keyframes subtotalPulse {
  0% {
    color: #8fdcff;
  }
  45% {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(89, 167, 255, 0.35);
  }
  100% {
    color: #8fdcff;
    text-shadow: none;
  }
}

@media (max-width: 980px) {
  .checkout-grid,
  .metric-strip,
  .payment-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .checkout-container {
    width: min(var(--maxw), calc(100% - 24px));
  }

  .topbar,
  .section-row,
  .coupon-row,
  .addon-head {
    flex-direction: column;
    align-items: start;
  }

  .checkout-hero,
  .card {
    padding: 20px;
  }

  .hero-copy p:last-child {
    font-size: 18px;
  }
}
