/* ============================================================
   Checkout page — extends styles.css
   ============================================================ */

body { background: var(--surface-2); }

/* Stepper */
.checkout-progress {
  padding: 28px 0 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.checkout-progress .container {
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  padding-bottom: 24px;
}
.cp-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-4);
}
.cp-step.done .cp-num,
.cp-step.active .cp-num {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
}
.cp-step.active { color: var(--ink-1); }
.cp-step.done { color: var(--ink-3); }
.cp-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--ink-4);
  font-weight: 700;
  font-family: var(--font-display);
}
.cp-sep {
  width: 40px; height: 1px;
  background: var(--line);
}
.cp-step.done + .cp-sep { background: var(--brand-purple); }

/* Layout */
.checkout-section { padding: 48px 0 80px; }
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 36px;
  align-items: start;
}

/* Card */
.co-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.co-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-1);
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.co-card h3 .num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--brand-purple);
  font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
  flex: none;
}
.co-card .lede {
  font-size: 13.5px;
  color: var(--ink-4);
  margin: 0 0 20px 36px;
  line-height: 1.5;
}

/* Plan picker */
.plan-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.plan-opt {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 18px 14px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  text-align: left;
}
.plan-opt:hover { border-color: var(--brand-purple); transform: translateY(-1px); }
.plan-opt.selected {
  border-color: var(--brand-purple);
  background: linear-gradient(180deg, rgba(101,46,186,0.06), rgba(101,46,186,0.02));
  box-shadow: 0 0 0 3px rgba(101, 46, 186, 0.12);
}
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt .ring {
  position: absolute;
  top: 14px; right: 14px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
}
.plan-opt.selected .ring {
  border-color: var(--brand-purple);
  background: var(--brand-purple);
  box-shadow: inset 0 0 0 3px #fff;
}
.plan-name { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.plan-price { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--ink-1); margin: 4px 0 2px; letter-spacing: -0.02em; }
.plan-price sup { font-size: 14px; vertical-align: top; line-height: 1.6; margin-right: 2px; }
.plan-price .per { font-size: 11px; color: var(--ink-4); font-weight: 500; margin-left: 2px; }
.plan-strike { font-size: 11px; color: var(--ink-4); text-decoration: line-through; }
.plan-sites { font-size: 12px; color: var(--ink-3); margin-top: 6px; font-weight: 500; }
.plan-badge {
  position: absolute;
  top: -10px; left: 14px;
  background: var(--brand-pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Form */
.fld { margin-bottom: 18px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fld label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.fld label .req { color: var(--brand-pink); }
.fld label .tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  background: var(--surface-2);
  border-radius: 50%;
  font-size: 10px;
  color: var(--ink-4);
  font-weight: 700;
  cursor: help;
  position: relative;
}
.fld label .tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink-1);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  letter-spacing: 0;
}
.fld input[type=text],
.fld input[type=email],
.fld input[type=tel],
.fld input[type=password],
.fld input[type=number],
.fld input[type=url],
.fld select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: 15px var(--bs-body-font-family);
  color: var(--ink-1);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fld input::placeholder { color: #b8bdcc; }
.fld input:focus, .fld select:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(101, 46, 186, 0.12);
}
.fld input.valid {
  border-color: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}
.fld input.invalid {
  border-color: var(--danger);
}
.fld .help {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 6px;
  line-height: 1.4;
}
.fld .err {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  font-weight: 500;
  display: none;
}
.fld.has-error .err { display: block; }
.fld.has-error input { border-color: var(--danger); }
.fld.has-error input:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }

/* Searchable country select */
.country-select { position: relative; }
.country-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
.country-options[hidden] { display: none; }
.country-options li {
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-1);
  cursor: pointer;
}
.country-options li:hover,
.country-options li.is-active {
  background: var(--surface-2);
}
.country-options li mark {
  background: none;
  color: var(--brand-purple);
  font-weight: 700;
  padding: 0;
}
.country-options li.is-empty {
  color: var(--ink-4);
  cursor: default;
}
.country-options li.is-empty:hover { background: none; }

/* Card payment */
.card-input-wrap {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr 90px 70px;
  gap: 12px;
  align-items: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card-input-wrap:focus-within {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(101, 46, 186, 0.12);
}
.card-brand {
  width: 36px; height: 24px;
  border-radius: 4px;
  background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: var(--ink-4);
  letter-spacing: -0.5px;
  transition: background .15s ease, color .15s ease;
}
.card-brand[data-brand=visa] { background: #1a1f71; color: #fff; }
.card-brand[data-brand=mastercard] { background: linear-gradient(90deg, #eb001b 50%, #f79e1b 50%); color: #fff; }
.card-brand[data-brand=amex] { background: #2671b9; color: #fff; }
.card-brand[data-brand=discover] { background: #ff6000; color: #fff; }
.card-input-wrap input {
  border: 0; outline: 0; padding: 0; font-size: 15px;
  background: transparent; width: 100%;
  font-family: var(--bs-body-font-family);
  color: var(--ink-1);
  letter-spacing: 0.5px;
}
.card-input-wrap input::placeholder { color: #b8bdcc; letter-spacing: 0; }
.payefb-stripe-element { min-width: 0; min-height: 24px; padding: 3px 0; }
.payefb-card-number { width: 100%; }
.payefb-card-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.payefb-checkout-status { min-height: 1.25em; margin: 12px 0 0; font-size: 13px; font-weight: 600; }
.payefb-checkout-status.is-error { color: var(--danger); }
.payefb-checkout-status.is-success { color: var(--success); }
.payefb-checkout-bridge { display: none; }

/* Promo code */
.promo-row {
  display: flex; gap: 8px;
  margin-top: 4px;
}
.promo-row input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  outline: none;
}
.promo-row input:focus { border-color: var(--brand-purple); box-shadow: 0 0 0 3px rgba(101, 46, 186, 0.1); }
.promo-row button {
  background: var(--ink-1);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.promo-row button:hover { background: var(--brand-purple); }
.promo-row button:disabled { opacity: 0.55; cursor: not-allowed; }
.summary-promo {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.summary-promo > label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 2px;
}
.summary-promo .promo-row { margin-top: 6px; }

.promo-applied {
  display: none;
  margin-top: 8px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--success);
  font-weight: 600;
  align-items: center;
  gap: 8px;
}
.promo-applied.active { display: flex; }
.promo-applied .x {
  margin-left: auto;
  background: transparent; border: 0;
  color: var(--success);
  cursor: pointer;
  font-size: 16px;
}

/* Renewal reassurance note (above terms) */
.renew-note {
  display: flex; align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(101, 46, 186, 0.04), rgba(255, 75, 147, 0.04));
  border: 1px solid rgba(101, 46, 186, 0.15);
  border-left: 3px solid var(--brand-purple);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.renew-note .renew-ico {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--brand-gradient);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.renew-note .renew-ico svg { width: 16px; height: 16px; }
.renew-note strong {
  display: block;
  font-family: var(--font-display);
  color: var(--ink-1);
  font-size: 14.5px;
  margin-bottom: 3px;
  font-weight: 600;
}
.renew-note a {
  color: var(--brand-purple);
  text-decoration: underline;
  font-weight: 600;
}
.renew-note a:hover { color: var(--accent-ink); }

/* Terms */
.terms-row {
  display: flex; align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.terms-row input[type=checkbox] {
  margin-top: 3px;
  width: 18px; height: 18px;
  accent-color: var(--brand-purple);
  cursor: pointer;
  flex: none;
}
.terms-row a { color: var(--brand-purple); text-decoration: underline; font-weight: 600; }
.terms-row .req { color: var(--brand-pink); }

/* Submit */
.submit-bar {
  margin-top: 24px;
}
.btn-pay {
  width: 100%;
  background: var(--brand-gradient);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 18px 24px;
  font: 600 17px var(--font-display);
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
}
.btn-pay:hover { transform: translateY(-1px); box-shadow: 0 18px 40px rgba(101, 46, 186, 0.4); }
.btn-pay:disabled { opacity: 0.65; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-pay svg { width: 18px; height: 18px; }
.btn-pay .lock {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
}
.submit-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-4);
}
.submit-meta strong { color: var(--ink-2); }
.submit-meta .pipe { color: var(--line); }

/* ============================================================
   Order summary (right column, sticky)
   ============================================================ */
.summary {
  position: sticky;
  top: 90px;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.summary-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.summary-head h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-1);
  margin: 0;
}
.summary-head .count {
  background: var(--accent-soft);
  color: var(--brand-purple);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.summary-item {
  display: flex; align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
}
.summary-item .ico {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--brand-gradient);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  flex: none;
}
.summary-item .body { flex: 1; min-width: 0; }
.summary-item h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  margin: 0 0 2px;
}
.summary-item .meta { font-size: 12px; color: var(--ink-4); }
.summary-item .price {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-1);
  font-size: 16px;
}
.summary-item .price .strike { display: block; font-size: 11px; color: var(--ink-4); text-decoration: line-through; font-weight: 500; }

.summary-list {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.s-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--ink-3);
}
.s-row strong { color: var(--ink-1); font-weight: 600; }
.s-row.discount { color: var(--success); }
.s-row.discount strong { color: var(--success); }
.s-row.total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 14px;
  font-size: 15px;
  color: var(--ink-1);
  font-weight: 600;
}
.s-row.total .amount {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  display: flex; align-items: baseline; gap: 6px;
}
.s-row.total .amount sup { font-size: 14px; line-height: 1.4; }
.s-row.total .amount small { font-size: 12px; color: var(--ink-4); font-weight: 500; }

/* Trust strip below summary */
.trust-list {
  display: flex; flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}
.trust-row-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex; gap: 14px;
  align-items: flex-start;
}
.trust-row-card .ico {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--brand-purple);
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.trust-row-card .ico svg { width: 18px; height: 18px; }
.trust-row-card h5 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  margin: 0 0 2px;
}
.trust-row-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-4);
  line-height: 1.5;
}

.stripe-banner {
  background: linear-gradient(135deg, #635bff 0%, #5046e4 100%);
  color: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.stripe-banner .ico {
  background: rgba(255,255,255,0.18);
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.stripe-banner .ico svg { width: 18px; height: 18px; }
.stripe-banner h5 { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin: 0 0 2px; color: #fff; }
.stripe-banner p { margin: 0; font-size: 12px; color: rgba(255,255,255,0.85); line-height: 1.5; }

.cards-strip {
  display: flex; gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.cards-strip .c {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 34px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800;
  color: var(--ink-3);
  letter-spacing: -0.5px;
}
.cards-strip .c[data-c=visa] { background: #1a1f71; color: #fff; }
.cards-strip .c[data-c=mc] { background: linear-gradient(90deg, #eb001b 50%, #f79e1b 50%); color: #fff; }
.cards-strip .c[data-c=amex] { background: #2671b9; color: #fff; }
.cards-strip .c[data-c=apple] { background: #000; color: #fff; font-size: 10px; }
.cards-strip .c[data-c=gpay] { background: #fff; color: #5f6368; border-color: var(--line); }

/* Reviews block */
.tiny-review {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 14px;
}
.tiny-review .stars { color: #f59e0b; letter-spacing: 1px; font-size: 13px; }
.tiny-review blockquote {
  margin: 8px 0;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.5;
}
.tiny-review .who { font-size: 11px; color: var(--ink-4); }
.tiny-review .who strong { color: var(--ink-2); font-weight: 600; }

/* Success screen */
.success-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 14, 28, 0.65);
  backdrop-filter: blur(8px);
  z-index: 4000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.success-overlay.open { display: flex; }
.success-card {
  background: var(--surface);
  border-radius: 24px;
  max-width: 460px;
  width: 100%;
  padding: 40px 32px 32px;
  text-align: center;
  box-shadow: 0 40px 100px rgba(10, 14, 28, 0.6);
  animation: wsx-pop .35s cubic-bezier(.34,1.56,.64,1);
}
.success-check {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  margin: 0 auto 20px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 40px rgba(101, 46, 186, 0.45);
}
.success-check svg { width: 40px; height: 40px; stroke-width: 3; }
.success-card h2 { font-family: var(--font-display); font-size: 26px; margin: 0 0 10px; }
.success-card p { color: var(--ink-3); font-size: 15px; line-height: 1.6; margin: 0 0 24px; }
.success-card .key-row {
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font: 600 14px ui-monospace, monospace;
  color: var(--ink-1);
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.success-card .key-row button {
  background: var(--ink-1); color: #fff;
  border: 0; border-radius: 6px;
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 991px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .plan-picker { grid-template-columns: 1fr; }
  .fld-row { grid-template-columns: 1fr; }
  .card-input-wrap {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
  }
  .card-input-wrap .card-num-wrap,
  .card-input-wrap .payefb-card-number { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
  .card-input-wrap .card-expiry,
  .card-input-wrap .payefb-card-expiry { grid-column: 1; }
  .card-input-wrap .card-cvc,
  .card-input-wrap .payefb-card-cvc { grid-column: 2; }
}
