/* Senior-friendly checkout — large type, high contrast */
:root {
  --st-brand: #2fadb1;
  --st-brand-dark: #1e7a7d;
  --st-accent: #fe5780;
  --st-bg: #f4f8f8;
  --st-card: #ffffff;
  --st-text: #1a1a1a;
  --st-muted: #4a4a4a;
  --st-border: #b8c4c4;
  --st-error: #b42318;
  --st-success: #1d6b3a;
  --st-radius: 14px;
  --st-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --st-focus: #005fcc;
}

html {
  font-size: 16px;
}

body.checkout-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--st-font);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--st-text);
  background: var(--st-bg);
}

.checkout-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 1.25rem;
}

.checkout-header {
  text-align: center;
  margin-bottom: 0.6rem;
}

.checkout-header h1 {
  font-size: 1.35rem;
  margin: 0 0 0.2rem;
  font-weight: 700;
}

.checkout-header p {
  margin: 0;
  color: var(--st-muted);
  font-size: 0.9rem;
}

.flow-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  background: var(--st-card);
  border: 2px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 0.3rem;
}

.flow-tab {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--st-muted);
  cursor: pointer;
  min-height: 40px;
}

.flow-tab.is-active {
  background: var(--st-brand);
  color: #fff;
}

.flow-tab:focus-visible {
  outline: 3px solid var(--st-focus);
  outline-offset: 2px;
}

.checkout-stepper {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  list-style: none;
  padding: 0;
}

.checkout-stepper li {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--st-muted);
  position: relative;
  padding-top: 1.6rem;
}

.checkout-stepper li::before {
  content: attr(data-step-num);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  border-radius: 50%;
  background: #e8ecec;
  color: var(--st-text);
  font-weight: 700;
  font-size: 0.8rem;
}

.checkout-stepper li.is-active::before,
.checkout-stepper li.is-done::before {
  background: var(--st-brand);
  color: #fff;
}

.checkout-stepper li.is-active {
  color: var(--st-brand-dark);
}

.checkout-card {
  background: var(--st-card);
  border: 2px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Prevent display overriding the HTML hidden attribute on step sections */
.checkout-card[hidden] {
  display: none !important;
}

.checkout-card h2 {
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
}

.benefits-list {
  margin: 0 0 0.65rem;
  padding: 0;
  list-style: none;
}

.benefits-list li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.benefit-check {
  color: var(--st-success);
  font-weight: 700;
  flex-shrink: 0;
}

.tier-grid {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
}

.tier-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 3px solid var(--st-border);
  border-radius: var(--st-radius);
  background: #fff;
  cursor: pointer;
  color: inherit;
}

.tier-card.is-selected {
  border-color: var(--st-brand);
  box-shadow: 0 0 0 2px rgba(47, 173, 177, 0.35);
}

.tier-card:focus-visible {
  outline: 3px solid var(--st-focus);
  outline-offset: 2px;
}

.tier-featured .tier-badge {
  background: var(--st-accent);
}

.tier-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--st-brand);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
}

.tier-name {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
}

.tier-price {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--st-brand-dark);
}

.tier-duration {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--st-muted);
}

.tier-desc {
  margin: 0.25rem 0 0;
  color: var(--st-muted);
  font-size: 0.875rem;
}

.form-hint {
  color: var(--st-muted);
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.test-payment-help {
  margin: 1rem 0 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid #b8e6e8;
  background: #f0fafb;
  font-size: 0.98rem;
  color: #1a4a4d;
}

.test-payment-help p {
  margin: 0 0 0.5rem;
}

.test-payment-help ul {
  margin: 0;
  padding-left: 1.2rem;
}

.test-payment-help li {
  margin: 0.25rem 0;
}

.test-payment-help code {
  font-size: 0.92em;
  background: #e3f4f5;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.form-field {
  margin-bottom: 1.1rem;
}

.form-field label {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid var(--st-border);
  border-radius: 10px;
  min-height: 52px;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 3px solid var(--st-focus);
  border-color: var(--st-focus);
}

.field-error,
.st-field-error {
  color: #d32f2f;
  font-size: 1rem;
  margin: 0.35rem 0 0;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.profile-readonly {
  background: #f0f6f6;
  border-radius: 10px;
  padding: 1rem;
  font-size: 1.05rem;
}

.profile-readonly p {
  margin: 0.35rem 0;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.1rem;
}

.summary-table th {
  text-align: left;
  font-weight: 600;
  padding: 0.5rem 0;
  color: var(--st-muted);
}

.summary-table td {
  text-align: right;
  padding: 0.5rem 0;
  font-weight: 600;
}

.summary-total td {
  font-size: 1.35rem;
  color: var(--st-brand-dark);
  border-top: 2px solid var(--st-border);
  padding-top: 0.75rem;
}

.gift-summary-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--st-border);
}

.gift-summary-block h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-checkout {
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  min-height: 44px;
  min-width: 120px;
}

.btn-checkout-primary {
  background: var(--st-brand);
  color: #fff;
  flex: 1;
}

.btn-checkout-primary:hover:not(:disabled) {
  background: var(--st-brand-dark);
}

.btn-checkout-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-checkout-secondary {
  background: #fff;
  color: var(--st-text);
  border: 2px solid var(--st-border);
}

.btn-checkout:focus-visible {
  outline: 3px solid var(--st-focus);
  outline-offset: 2px;
}

.error-banner {
  background: #fdecea;
  border: 2px solid var(--st-error);
  color: var(--st-error);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.checkout-footer {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--st-muted);
}

.checkout-footer a {
  color: var(--st-brand-dark);
  font-weight: 600;
}

/* Success pages */
.success-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
}

.success-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.success-page h1 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
}

.member-id-box {
  display: inline-block;
  background: #e8f6f6;
  border: 3px solid var(--st-brand);
  border-radius: var(--st-radius);
  padding: 1rem 1.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 1rem 0 1.5rem;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.voucher-print {
  max-width: 520px;
  margin: 1.5rem auto;
  text-align: left;
  border: 3px dashed var(--st-brand);
  border-radius: var(--st-radius);
  padding: 1.5rem;
  background: #fff;
}

.voucher-print h2 {
  color: var(--st-brand-dark);
  margin-top: 0;
}

@media (min-width: 600px) {
  .tier-grid {
    grid-template-columns: 1fr 1fr;
  }
  .checkout-actions {
    justify-content: flex-end;
  }
  .btn-checkout-primary {
    flex: 0 1 auto;
    min-width: 220px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }
  .voucher-print,
  .voucher-print * {
    visibility: visible;
  }
  .voucher-print {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
  }
  .no-print {
    display: none !important;
  }
}
