/* Checkout nextgen — light panel contrast for AI package buy.
   Scoped under .checkout-nextgen; beats prod-parity light-on-dark text
   and product.css work-* inheritance without changing payment logic. */

.product-page .checkout-nextgen {
  --checkout-panel-bg: #ffffff;
  --checkout-heading: #102736;
  --checkout-text: #243846;
  --checkout-muted: #465a68;
  --checkout-border: color-mix(in srgb, var(--accent, #3d8bfd) 18%, #d5e1e8);
  --checkout-input-bg: #ffffff;
  --checkout-input-text: #102736;
  --checkout-input-border: color-mix(in srgb, var(--accent, #3d8bfd) 22%, #c9d7e0);
  --checkout-input-placeholder: #7a8f9c;
  --checkout-accent: var(--accent, #3d8bfd);
  --checkout-focus: color-mix(in srgb, var(--accent, #3d8bfd) 70%, #ffffff);
  --checkout-error: #d1242f;
  --checkout-error-soft: #fdeceb;
  --checkout-shadow: 0 16px 40px color-mix(in srgb, #173d50 10%, transparent);
  --checkout-cta-text: #ffffff;

  display: grid;
  place-items: center;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 0 48px;
  color: var(--checkout-text);
}

.site-scene[data-theme="poisoned"] .product-page .checkout-nextgen {
  --checkout-border: color-mix(in srgb, var(--accent, #b760ff) 28%, #d8cce8);
  --checkout-input-border: color-mix(in srgb, var(--accent, #b760ff) 30%, #d0c4e0);
  --checkout-accent: var(--accent, #b760ff);
  --checkout-focus: color-mix(in srgb, var(--accent, #b760ff) 72%, #fff);
  --checkout-shadow: 0 18px 42px rgba(40, 16, 64, 0.18);
}

.site-scene[data-theme="immolated"] .product-page .checkout-nextgen {
  --checkout-border: color-mix(in srgb, var(--accent, #ff8a3d) 28%, #e8d4c8);
  --checkout-input-border: color-mix(in srgb, var(--accent, #ff8a3d) 30%, #e0c8b8);
  --checkout-accent: var(--accent, #ff8a3d);
  --checkout-focus: color-mix(in srgb, var(--accent, #ff8a3d) 72%, #fff);
  --checkout-shadow: 0 18px 42px rgba(64, 24, 12, 0.16);
}

.site-scene[data-theme="flayed"] .product-page .checkout-nextgen {
  --checkout-panel-bg: #0d2e21;
  --checkout-heading: #f4faf5;
  --checkout-text: #e6eee8;
  --checkout-muted: #b7c6bc;
  --checkout-border: rgba(84, 177, 111, 0.3);
  --checkout-input-bg: #071a12;
  --checkout-input-text: #f4faf5;
  --checkout-input-border: #2d7048;
  --checkout-input-placeholder: #7d9285;
  --checkout-accent: #93f23f;
  --checkout-focus: #b1ff58;
  --checkout-cta-text: #07110a;
  --checkout-shadow: 0 20px 55px rgba(0, 0, 0, 0.34);
}

.product-page .checkout-nextgen .checkout-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 32px 28px;
  border-radius: 24px;
  border: 1px solid var(--checkout-border) !important;
  background: var(--checkout-panel-bg) !important;
  box-shadow: var(--checkout-shadow) !important;
  color: var(--checkout-text) !important;
  -webkit-text-fill-color: var(--checkout-text) !important;
  overflow: visible;
}

.product-page .checkout-nextgen .checkout-card::before,
.product-page .checkout-nextgen .checkout-card::after {
  display: none !important;
  content: none !important;
}

.product-page .checkout-nextgen .checkout-status:empty {
  display: none;
}

.product-page .checkout-nextgen .checkout-status:not(:empty) {
  margin: 14px 0 0;
  color: var(--checkout-muted) !important;
  -webkit-text-fill-color: var(--checkout-muted) !important;
  text-align: center;
  font-size: 15px;
}

.product-page .checkout-nextgen .checkout-lead,
.product-page .checkout-nextgen .checkout-helper,
.product-page .checkout-nextgen .checkout-receipt-preview,
.product-page .checkout-nextgen p {
  margin: 0 0 16px;
  color: var(--checkout-text) !important;
  -webkit-text-fill-color: var(--checkout-text) !important;
  background: none !important;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 550;
}

.product-page .checkout-nextgen .checkout-lead {
  margin-bottom: 22px;
}

.product-page .checkout-nextgen .checkout-helper,
.product-page .checkout-nextgen .checkout-receipt-preview {
  color: var(--checkout-muted) !important;
  -webkit-text-fill-color: var(--checkout-muted) !important;
  margin-bottom: 12px;
}

.product-page .checkout-nextgen .checkout-summary {
  display: grid;
  gap: 6px;
  margin: 0 0 22px;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--checkout-border);
  background: color-mix(in srgb, var(--checkout-accent) 6%, #ffffff);
}

.product-page .checkout-nextgen .checkout-summary__title {
  margin: 0;
  color: var(--checkout-heading) !important;
  -webkit-text-fill-color: var(--checkout-heading) !important;
  background: none !important;
  font-size: clamp(22px, 3.5vw, 26px);
  line-height: 1.2;
  font-weight: 840;
  letter-spacing: -0.3px;
}

.product-page .checkout-nextgen .checkout-summary__meta {
  margin: 0;
  color: var(--checkout-muted) !important;
  -webkit-text-fill-color: var(--checkout-muted) !important;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}

.product-page .checkout-nextgen .checkout-summary__price {
  margin: 4px 0 0;
  color: var(--checkout-heading) !important;
  -webkit-text-fill-color: var(--checkout-heading) !important;
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.1;
  font-weight: 880;
  letter-spacing: -0.5px;
}

.product-page .checkout-nextgen .checkout-field {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.product-page .checkout-nextgen .checkout-field label {
  margin: 0;
  color: var(--checkout-heading) !important;
  -webkit-text-fill-color: var(--checkout-heading) !important;
  font-size: 14px;
  font-weight: 750;
}

.product-page .checkout-nextgen .checkout-field input[type="email"],
.product-page .checkout-nextgen .checkout-field input {
  width: 100%;
  min-height: 48px;
  height: auto;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--checkout-input-border) !important;
  background: var(--checkout-input-bg) !important;
  color: var(--checkout-input-text) !important;
  -webkit-text-fill-color: var(--checkout-input-text) !important;
  font-size: 16px;
  box-shadow: none;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.product-page .checkout-nextgen .checkout-field input::placeholder {
  color: var(--checkout-input-placeholder);
  opacity: 0.9;
}

.product-page .checkout-nextgen .checkout-field input:hover {
  border-color: color-mix(in srgb, var(--checkout-accent) 42%, var(--checkout-input-border)) !important;
}

.product-page .checkout-nextgen .checkout-field input:focus,
.product-page .checkout-nextgen .checkout-field input:focus-visible {
  border-color: color-mix(in srgb, var(--checkout-accent) 70%, var(--checkout-input-border)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--checkout-accent) 18%, transparent);
}

.product-page .checkout-nextgen .checkout-field input:focus-visible {
  outline: 3px solid var(--checkout-focus) !important;
  outline-offset: 2px;
}

.product-page .checkout-nextgen .checkout-field input[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--checkout-error) 55%, var(--checkout-input-border)) !important;
}

.product-page .checkout-nextgen .checkout-field input:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.product-page .checkout-nextgen .checkout-error,
.product-page .checkout-nextgen .checkout-messages,
.product-page .checkout-nextgen .checkout-messages__item {
  color: var(--checkout-error) !important;
  -webkit-text-fill-color: var(--checkout-error) !important;
  background: var(--checkout-error-soft) !important;
  border: 1px solid color-mix(in srgb, var(--checkout-error) 34%, transparent);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.product-page .checkout-nextgen .checkout-docs {
  margin: 0 0 20px;
  color: var(--checkout-muted) !important;
  -webkit-text-fill-color: var(--checkout-muted) !important;
  font-size: 15px;
  line-height: 1.5;
}

.product-page .checkout-nextgen .checkout-docs a {
  display: inline !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--checkout-accent) !important;
  -webkit-text-fill-color: var(--checkout-accent) !important;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-page .checkout-nextgen .checkout-docs a:hover {
  text-decoration-thickness: 2px;
}

.product-page .checkout-nextgen .checkout-docs a:focus-visible,
.product-page .checkout-nextgen .checkout-cta:focus-visible,
.product-page .checkout-nextgen .checkout-secondary:focus-visible {
  outline: 3px solid var(--checkout-focus) !important;
  outline-offset: 2px;
}

.product-page .checkout-nextgen .checkout-cta,
.product-page .checkout-nextgen button.checkout-cta {
  width: 100%;
  min-height: 48px;
  height: auto;
  margin: 0;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--checkout-accent),
    color-mix(in srgb, var(--checkout-accent) 72%, #0b1c2a)
  ) !important;
  color: var(--checkout-cta-text) !important;
  -webkit-text-fill-color: var(--checkout-cta-text) !important;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--checkout-accent) 28%, transparent);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.product-page .checkout-nextgen .checkout-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: none;
  box-shadow: 0 16px 32px color-mix(in srgb, var(--checkout-accent) 34%, transparent);
}

.product-page .checkout-nextgen .checkout-cta:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.product-page .checkout-nextgen .checkout-secondary {
  display: inline !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--checkout-accent) !important;
  -webkit-text-fill-color: var(--checkout-accent) !important;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-page .checkout-nextgen .checkout-actions {
  margin: 14px 0 0;
  text-align: center;
}

.product-page .checkout-nextgen .checkout-field input:-webkit-autofill,
.product-page .checkout-nextgen .checkout-field input:-webkit-autofill:hover,
.product-page .checkout-nextgen .checkout-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--checkout-input-text) !important;
  caret-color: var(--checkout-input-text);
  box-shadow: 0 0 0 1000px var(--checkout-input-bg) inset !important;
  transition: background-color 99999s ease-out;
}

@media (max-width: 390px) {
  .product-page .checkout-nextgen {
    padding: 4px 0 40px;
  }

  .product-page .checkout-nextgen .checkout-card {
    padding: 24px 16px;
    border-radius: 20px;
  }

  .product-page .checkout-nextgen .checkout-lead,
  .product-page .checkout-nextgen .checkout-helper,
  .product-page .checkout-nextgen .checkout-receipt-preview,
  .product-page .checkout-nextgen .checkout-docs {
    font-size: 15px;
  }

  .product-page .checkout-nextgen .checkout-cta {
    min-height: 48px;
  }
}

@media (max-width: 320px) {
  .product-page .checkout-nextgen .checkout-card {
    padding: 20px 12px;
    border-radius: 16px;
  }

  .product-page .checkout-nextgen .checkout-summary__title {
    font-size: 20px;
  }

  .product-page .checkout-nextgen .checkout-summary__price {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-page .checkout-nextgen .checkout-cta,
  .product-page .checkout-nextgen .checkout-field input {
    transition: none !important;
  }
}
