*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  --bg: #0C1222;
  --surface: #151D2E;
  --border: rgba(255, 255, 255, 0.08);
  --text: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent: #3B82F6;
  --gold: #D4A853;
  --success: #34D399;
  --error: #F87171;
  --radius: 12px;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  max-width: 960px;
  margin: 0 auto;
}

.pay-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}

.pay-logo-accent {
  color: var(--gold);
}

.pay-secure-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--success);
  background: rgba(52, 211, 153, 0.12);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.pay-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.pay-loading,
.pay-error-panel,
.pay-success-panel {
  text-align: center;
  padding: 3rem 1rem;
}

.pay-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pay-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  font-size: 1.75rem;
  line-height: 56px;
  margin: 0 auto 1rem;
  font-weight: 700;
}

.pay-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .pay-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 2.5rem;
  }
}

.pay-eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pay-summary h1 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.pay-plan {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.pay-breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.pay-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.pay-breakdown-row dt {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.pay-breakdown-row dd {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.pay-breakdown-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.pay-breakdown-recurring dd {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
}

.pay-includes {
  list-style: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pay-includes li {
  padding: 0.35rem 0 0.35rem 1.25rem;
  position: relative;
}

.pay-includes li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.pay-form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.pay-terms-field {
  border: none;
  margin-bottom: 1.25rem;
}

.pay-terms-label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.pay-terms-label input {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--gold);
  flex-shrink: 0;
}

.pay-terms-label a {
  color: var(--accent);
}

.pay-card-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text-secondary);
}

.pay-checkout-wrap {
  margin-bottom: 1.25rem;
  min-height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
}

#checkout {
  min-height: 420px;
}

.pay-element-wrap {
  margin-bottom: 1.25rem;
}

#payment-element {
  min-height: 120px;
}

.pay-spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
  margin: 0;
}

.pay-element-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 0.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pay-contact-fields {
  margin-bottom: 1.25rem;
}

.pay-optional {
  color: var(--text-muted);
  font-weight: 400;
}

.pay-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.pay-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}

.pay-input::placeholder {
  color: var(--text-muted);
}

.pay-input:focus {
  outline: none;
  border-color: var(--gold);
}

@media (max-width: 520px) {
  .pay-contact-grid {
    grid-template-columns: 1fr;
  }
}

.pay-receipt {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem auto;
  max-width: 26rem;
  background: var(--surface);
}

.pay-receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.65rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.pay-receipt-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.pay-receipt-conf {
  font-size: 0.78rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.pay-receipt-rows {
  margin: 0;
}

.pay-receipt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
}

.pay-receipt-row dt {
  color: var(--text-muted);
}

.pay-receipt-row dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.pay-receipt-sent {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--success);
}

.pay-receipt-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 auto 0.5rem;
}

.pay-form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.pay-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pay-btn-primary {
  background: linear-gradient(135deg, var(--gold), #c9983f);
  color: #0C1222;
}

.pay-btn-primary:not(:disabled):hover {
  opacity: 0.92;
}

.pay-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  width: auto;
  margin-top: 1rem;
}

.pay-stripe-note {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.pay-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.pay-footer a {
  color: var(--text-secondary);
}

.pay-error-panel h1,
.pay-success-panel h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.pay-error-panel p,
.pay-success-panel p {
  color: var(--text-secondary);
  max-width: 28rem;
  margin: 0 auto;
}
