:root {
  --b4e-bg: #eef6fb;
  --b4e-surface: #ffffff;
  --b4e-text: #101827;
  --b4e-muted: #5f6b7a;
  --b4e-border: #d8e4ee;
  --b4e-accent: #0f766e;
  --b4e-blue: #0b5f99;
  --b4e-danger: #b42318;
  --b4e-warning: #92400e;
  --b4e-soft: #ecfdf5;
  --b4e-warn-soft: #fff7ed;
  --b4e-shadow: 0 22px 70px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background: var(--b4e-bg);
  color: var(--b4e-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .64; }
.b2c-app { min-height: 100vh; }

.checkout-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: 24px;
  align-items: center;
  padding: 18px clamp(18px, 3vw, 48px);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--b4e-border);
  box-shadow: 0 8px 30px rgba(15,23,42,.05);
}
.brand-lockup { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 14px; align-items: center; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; overflow: hidden; border-radius: 10px; background: #0f766e; color: #fff; font-weight: 900; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-title { margin: 0; font-size: 16px; font-weight: 900; }
.brand-subtitle { margin: 2px 0 0; color: var(--b4e-muted); font-size: 14px; line-height: 1.25; }
.progress { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: center; }
.progress:before { content: ""; position: absolute; left: 0; right: 0; top: 16px; height: 7px; border-radius: 999px; background: #e5edf4; }
.progress:after { content: ""; position: absolute; left: 0; top: 16px; height: 7px; border-radius: 999px; background: linear-gradient(90deg, var(--b4e-accent), var(--b4e-blue)); width: 33%; }
.progress.step-2:after { width: 66%; }
.progress.step-3:after { width: 100%; }
.step { position: relative; z-index: 1; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: start; color: #7a8798; font-weight: 900; }
.step-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: #e8eef5; color: #718096; }
.step.active .step-number { background: var(--b4e-accent); color: #fff; }
.step span:last-child { display: block; font-size: 13px; font-weight: 800; color: #7a8798; line-height: 1.1; }

.page-shell { width: min(1120px, calc(100% - 64px)); margin: 0 auto; padding: 56px 0; }
.journey-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 42px; align-items: start; }
.main-panel { min-width: 0; }
.page-title, .section-title { margin: 0 0 24px; font-size: clamp(36px, 5vw, 58px); line-height: 1.03; letter-spacing: -.04em; font-weight: 950; }
.hero-logo { width: 138px; height: 138px; object-fit: contain; border-radius: 12px; display: block; margin: 0 0 22px; background: #fff; box-shadow: var(--b4e-shadow); }
.guide-card, .product-card, .form-card, .review-card, .state-card, .notice-card, .b2c-review-section, .b2c-lifecycle-panel, .safe-stop {
  background: var(--b4e-surface);
  border: 1px solid var(--b4e-border);
  border-radius: 12px;
  box-shadow: var(--b4e-shadow);
}
.guide-card { padding: 24px; position: sticky; top: 112px; }
.guide-badge { display: inline-block; padding: 6px 10px; border-radius: 999px; background: #e0f2fe; color: #0b5f99; text-transform: uppercase; font-size: 12px; font-weight: 950; letter-spacing: .03em; }
.guide-card h2 { margin: 14px 0 6px; font-size: 24px; line-height: 1.15; }
.guide-card p { color: var(--b4e-muted); margin: 0 0 16px; }
.guide-list { list-style: none; padding: 14px 0 0; margin: 0; border-top: 1px solid var(--b4e-border); }
.guide-list li { position: relative; padding: 9px 0 9px 28px; color: #344054; border-bottom: 1px solid #edf2f7; }
.guide-list li:before { content: "✓"; position: absolute; left: 0; color: var(--b4e-accent); font-weight: 900; }
.time-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; margin-top: 14px; padding: 7px 12px; border-radius: 999px; background: #fff1c2; color: #7c4a03; font-weight: 950; }
.notice-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; margin-bottom: 22px; background: var(--b4e-soft); border-color: #bbf7d0; box-shadow: none; }
.notice-card strong { display: block; color: var(--b4e-accent); text-transform: uppercase; font-size: 13px; }
.notice-card p { margin: 4px 0 0; font-weight: 800; }

.billing-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; margin-bottom: 18px; background: #fff; border: 1px solid var(--b4e-border); border-radius: 12px; }
.billing-row label { font-weight: 900; }
select, input, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; color: var(--b4e-text); padding: 12px 13px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: var(--b4e-blue); box-shadow: 0 0 0 3px rgba(11,95,153,.12); }
.billing-row select { max-width: 260px; }
.product-list { display: grid; gap: 18px; }
.product-card { display: grid; grid-template-columns: 96px minmax(0,1fr) auto; gap: 20px; align-items: center; padding: 20px; }
.product-card.selected { border-color: var(--b4e-accent); box-shadow: 0 20px 60px rgba(15,118,110,.16); }
.product-logo { width: 96px; height: 96px; object-fit: contain; border-radius: 12px; background: #f8fafc; border: 1px solid var(--b4e-border); }
.product-logo-fallback { display: grid; place-items: center; font-size: 22px; font-weight: 950; color: #fff; background: var(--b4e-accent); }
.product-copy h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; }
.premium { margin: 0 0 8px; font-size: 22px; font-weight: 950; color: var(--b4e-blue); }
.description { margin: 0; color: var(--b4e-muted); }
.card-action { justify-self: end; }
.button-primary, .button-secondary { border: 0; border-radius: 9px; padding: 13px 18px; font-weight: 950; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; }
.button-primary { background: var(--b4e-blue); color: #fff; box-shadow: 0 12px 28px rgba(11,95,153,.18); }
.button-primary:hover { filter: brightness(.96); }
.button-secondary { background: #fff; color: var(--b4e-blue); border: 1px solid var(--b4e-border); box-shadow: none; }
.benefits, .requirements { grid-column: 1 / -1; border-top: 1px solid var(--b4e-border); padding-top: 16px; }
.benefits h3, .requirements h3 { margin: 0 0 10px; font-size: 16px; }
.benefits ol, .requirements ul { margin: 0; padding-left: 20px; color: #344054; }
.benefits li { margin-bottom: 8px; }
.benefits small { display: block; color: var(--b4e-muted); }

.application-form { display: grid; gap: 18px; }
.form-card, .review-card { padding: 22px; }
.form-card h2, .review-card h2 { margin: 0 0 16px; font-size: 22px; }
.field { display: grid; gap: 8px; margin: 0 0 16px; font-weight: 900; }
.field small, .helper-text { color: #475569; font-weight: 700; }
.form-two, .beneficiary-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.checkbox-field { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.checkbox-field input { width: auto; }
.form-error, .b2c-inline-error { background: #fef3f2; border: 1px solid #fecaca; color: var(--b4e-danger); border-radius: 10px; padding: 14px; font-weight: 800; }
.loading-state, .error-state { min-height: calc(100vh - 94px); display: grid; place-items: center; padding: 32px; }
.state-card { width: min(480px, 100%); padding: 28px; text-align: center; }
.spinner, .mini-spinner { display: inline-block; border-radius: 999px; border: 4px solid #e5e7eb; border-top-color: #a21caf; animation: spin .8s linear infinite; }
.spinner { width: 44px; height: 44px; }
.mini-spinner { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.review-card dl, .b2c-summary-list { margin: 0; border: 1px solid var(--b4e-border); border-radius: 10px; overflow: hidden; }
.review-card dl div, .b2c-summary-list div { display: grid; grid-template-columns: 240px minmax(0,1fr); border-bottom: 1px solid var(--b4e-border); }
.review-card dl div:last-child, .b2c-summary-list div:last-child { border-bottom: 0; }
dt, dd, .b2c-summary-list span, .b2c-summary-list strong { padding: 12px 14px; margin: 0; }
dt, .b2c-summary-list span { background: #f8fafc; color: #475569; font-weight: 900; }
dd, .b2c-summary-list strong { font-weight: 900; word-break: break-word; }
.b2c-lifecycle-panel, .safe-stop { margin-top: 18px; padding: 18px; background: var(--b4e-soft); border-color: #bbf7d0; box-shadow: none; }
.b2c-review-section { margin-top: 14px; padding: 16px; box-shadow: none; }
.b2c-review-section h3 { margin: 0 0 10px; }
.b2c-review-section label { display: grid; gap: 8px; margin: 0 0 14px; font-weight: 900; }
.b2c-payment-actions, .action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.inline-loading { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inline-loading p { flex-basis: 100%; margin: 0; color: var(--b4e-muted); }

.post-payment-success { width: min(640px, calc(100% - 32px)); padding-top: 42px; padding-bottom: 56px; }
.post-payment-success .confirmation-card { width: 100%; max-width: 560px; margin: 0 auto; padding: 34px 34px 30px; border-radius: 18px; }
.post-payment-success .success-mark { width: 34px; height: 34px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 999px; background: var(--b4e-soft); color: var(--b4e-accent); font-weight: 950; }
.post-payment-success h1 { max-width: 420px; margin: 0 auto 16px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.03em; }
.post-payment-success .confirmation-card > p { max-width: 440px; margin: 0 auto 18px; color: #334155; }
.post-payment-success .b2c-summary-list { margin: 20px 0 14px; text-align: left; }
.post-payment-success .certificate-actions { margin-top: 22px; padding: 22px; background: #f8fbff; border-color: #cfe1f1; }
.post-payment-success .certificate-actions h2,
.post-payment-success .claims-next-steps h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.2; }
.post-payment-success .certificate-actions .helper-text { margin: 0 auto; max-width: 410px; }
.post-payment-success .certificate-actions [data-certificate-email-status] { margin-top: 12px; color: var(--b4e-accent); }
.post-payment-success .certificate-actions .action-row { justify-content: center; }
.post-payment-success .claims-next-steps { margin-top: 18px; padding: 22px; }
.post-payment-success .claims-next-steps ol { text-align: left; max-width: 430px; margin: 0 auto; padding-left: 22px; color: #334155; }
.post-payment-success .claims-next-steps li { margin-bottom: 8px; }

@media (max-width: 1024px) {
  .journey-grid { grid-template-columns: 1fr; }
  .guide-card { position: static; order: -1; }
}
@media (max-width: 760px) {
  .checkout-header { position: static; grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .progress { grid-template-columns: 1fr; gap: 8px; }
  .progress:before, .progress:after { display: none; }
  .step { display: none; }
  .step.active { display: grid; }
  .page-shell { width: calc(100% - 24px); padding: 24px 0; }
  .product-card { grid-template-columns: 74px minmax(0,1fr); }
  .product-logo { width: 74px; height: 74px; }
  .card-action, .benefits, .requirements { grid-column: 1 / -1; justify-self: stretch; }
  .button-primary, .button-secondary { width: 100%; }
  .form-two, .beneficiary-grid { grid-template-columns: 1fr; }
  .review-card dl div, .b2c-summary-list div { grid-template-columns: 1fr; }
  .billing-row { display: grid; }
  .billing-row select { max-width: none; }
  .post-payment-success .confirmation-card { padding: 28px 18px; }
}
