/* View at Home offer module + payment modal + thank-you page.
   Synced from vah-affiliate-shared - edit there, then run sync.sh.
   Uses the page's existing tokens: --black, --white, --off-white, --mid, --muted, --font, --sans, --radius, --radius-lg */

.vah-offer { --vah-err: #c0392b; --vah-text-2: #5f5e59; max-width: 600px; margin: 0 auto; }

/* ── Header ── */
.vah-head { text-align: center; margin-bottom: 2rem; }
.vah-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.75rem;
}
.vah-title {
  font-family: var(--font); font-weight: 400; color: var(--black);
  font-size: clamp(28px, 6vw, 40px); line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}
.vah-sub {
  font-size: clamp(15px, 3vw, 17px); color: var(--vah-text-2); line-height: 1.6;
  max-width: 440px; margin: 0 auto; text-wrap: balance;
}

/* ── Card ── */
.vah-card {
  background: var(--white);
  border: 1px solid var(--mid);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 1.75rem;
  text-align: left;
}
.vah-step + .vah-step { border-top: 1px solid var(--mid); margin-top: 1.75rem; padding-top: 1.75rem; }
.vah-step-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: 17px; font-weight: 600; color: var(--black);
  line-height: 1.3; margin-bottom: 1.1rem;
}
.vah-num {
  width: 26px; height: 26px; min-width: 26px; border-radius: 50%;
  background: var(--black); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}

/* ── Fields ── */
.vah-field { margin-bottom: 1.1rem; }
.vah-field:last-child { margin-bottom: 0; }
.vah-label { display: block; font-size: 14px; font-weight: 500; color: var(--black); margin-bottom: 6px; }
.vah-input {
  display: block; width: 100%; min-height: 48px;
  padding: 12px 14px;
  font: 16px/1.4 var(--sans); color: var(--black);
  background: var(--white);
  border: 1px solid var(--mid); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.vah-input::placeholder { color: #a9a8a2; }
.vah-input:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(17,17,16,.08); }
.vah-input[aria-invalid="true"] { border-color: var(--vah-err); }
.vah-help { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 6px; }

/* ── Billing details in the payment window ── */
.vah-billing-title { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 1.25rem 0 .6rem; }
.vah-taxid { margin: 12px 0 0; }
.vah-taxid-label { display: block; font-size: 14px; color: #30313d; margin-bottom: 4px; }
.vah-taxid-input { min-height: 44px; padding: 10px 12px; border-color: #e8e6e1; }
.vah-taxid-input[aria-invalid="true"] { border-color: #c0392b; }
.vah-input:disabled { background: var(--off-white, #f5f4f0); color: var(--muted); }
.vah-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--black); cursor: pointer; line-height: 1.4; }
.vah-check input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--black); cursor: pointer; }
.vah-taxid-error { font-size: 13px; color: #c0392b; margin-top: 6px; }
.vah-taxid-error[hidden] { display: none; }
.vah-error { font-size: 13px; color: var(--vah-err); line-height: 1.4; margin-top: 6px; }
.vah-error[hidden], .vah-help[hidden] { display: none; }

/* ── Platform pills (native radios) ── */
.vah-pills { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.vah-pills legend { padding: 0; }
.vah-pill { position: relative; }
.vah-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vah-pill span {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--mid); border-radius: 100px;
  font-size: 15px; color: var(--black); background: var(--white);
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer; user-select: none;
}
.vah-pill input:hover + span { border-color: #c9c7c0; }
.vah-pill input:checked + span { background: var(--black); color: var(--white); border-color: var(--black); }
.vah-pill input:focus-visible + span { outline: 2px solid var(--black); outline-offset: 2px; }
.vah-pills.is-invalid .vah-pill span { border-color: var(--vah-err); }
.vah-other { margin-top: 12px; }
.vah-note {
  margin-top: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  color: var(--vah-text-2); background: var(--off-white); border-radius: 8px;
}
.vah-other[hidden], .vah-note[hidden] { display: none; }

/* ── What happens next ── */
.vah-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.vah-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.55; color: var(--black); }
.vah-list svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--black); }
.vah-list strong { font-weight: 600; }

/* ── Plan tiles (native radios) ── */
.vah-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; margin: 0; min-width: 0; }
.vah-plans.is-single { grid-template-columns: 1fr; }
.vah-plan { position: relative; display: block; }
.vah-plan input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vah-plan-box {
  display: block; height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--mid); border-radius: var(--radius-lg);
  background: var(--white); color: var(--black);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.vah-plan input:hover + .vah-plan-box { border-color: #c9c7c0; }
.vah-plan input:checked + .vah-plan-box { background: var(--black); color: var(--white); border-color: var(--black); }
.vah-plan input:focus-visible + .vah-plan-box { outline: 2px solid var(--black); outline-offset: 2px; }
.vah-plan-price { font-family: var(--font); font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; }
.vah-plan-period { font-family: var(--sans); font-size: 15px; opacity: .75; letter-spacing: 0; }
.vah-plan-note { display: block; font-size: 14px; margin-top: 6px; opacity: .85; }
.vah-plan-renew { display: block; font-size: 12px; margin-top: 2px; opacity: .65; }
.vah-callout {
  margin-top: 14px; padding: 14px 16px;
  background: var(--off-white); border-radius: var(--radius-lg);
  font-size: 14px; line-height: 1.5; text-align: center; color: var(--black);
}
.vah-callout strong { font-weight: 600; }
.vah-plan-was { font-size: .6em; margin-right: 8px; opacity: .55; text-decoration-thickness: 1.5px; letter-spacing: 0; }
.vah-callout-promo { background: #fbf1ea; border: 1px solid #ecd2c0; }
.vah-callout-promo strong { display: block; color: var(--terra, #a8653f); font-size: 15px; }
.vah-callout-promo span { display: block; margin-top: 2px; }

/* ── CTA ── */
.vah-cta-area { margin-top: 1.75rem; text-align: center; }
.vah-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 14px 20px;
  background: var(--black); color: var(--white);
  border: none; border-radius: 8px;
  font: 500 17px/1.2 var(--sans); letter-spacing: 0.01em;
  cursor: pointer; transition: opacity .15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.vah-btn:hover { opacity: .85; }
.vah-btn:active { opacity: .7; }
.vah-btn:disabled { opacity: .55; cursor: default; }
.vah-btn:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }
.vah-btn-secondary { background: var(--white); color: var(--black); border: 1px solid var(--black); }
.vah-secure { font-size: 13px; color: var(--muted); margin-top: 12px; }
.vah-unsure { font-size: 14px; color: var(--black); margin-top: 8px; }
.vah-link { color: var(--black); text-decoration: underline; text-underline-offset: 2px; }
.vah-link:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; border-radius: 2px; }
.vah-form-error { margin-top: 12px; font-size: 14px; color: var(--vah-err); }
.vah-form-error[hidden] { display: none; }
.vah-gallery { text-align: center; font-size: 13px; color: var(--muted); margin-top: 1.25rem; line-height: 1.5; }
.vah-gallery a { color: var(--black); text-decoration: underline; }

/* ── Payment modal ── */
.vah-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem; background: rgba(0,0,0,.45); overflow-y: auto;
}
.vah-modal[hidden] { display: none; }
.vah-modal-inner {
  position: relative; width: 100%; max-width: 420px; margin: auto;
  background: var(--white); border-radius: var(--radius-lg);
  padding: 2rem 1.5rem 1.5rem; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.vah-close {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px;
  background: none; border: none; border-radius: 50%;
  font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer;
}
.vah-close:focus-visible { outline: 2px solid var(--black); }
.vah-modal-price { font-family: var(--font); font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; color: var(--black); }
.vah-modal-price span { font-family: var(--sans); font-size: 16px; color: var(--muted); letter-spacing: 0; }
.vah-modal-sub { font-size: 13px; color: var(--muted); margin: 6px 0 1.25rem; }
.vah-stripe { min-height: 60px; margin-bottom: .75rem; overflow: hidden; }
.vah-loading { display: flex; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: .75rem; }
.vah-loading[hidden] { display: none; }
.vah-spinner {
  width: 16px; height: 16px; margin-right: 8px; flex-shrink: 0;
  border: 2px solid var(--mid); border-top-color: var(--black); border-radius: 50%;
  animation: vah-spin .7s linear infinite;
}
@keyframes vah-spin { to { transform: rotate(360deg); } }
.vah-pay-error { font-size: 13px; color: var(--vah-err); margin-bottom: .75rem; padding: .5rem .75rem; background: #fdf0f0; border-radius: 6px; }
.vah-pay-error[hidden] { display: none; }
.vah-or { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; font-size: 12px; color: var(--muted); }
.vah-or::before, .vah-or::after { content: ''; flex: 1; height: 1px; background: var(--mid); }
.vah-modal-secure {
  display: flex; align-items: center; gap: 8px;
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--mid);
  font-size: 12px; color: var(--muted); line-height: 1.5;
}
body.vah-modal-open { overflow: hidden; position: fixed; width: 100%; }

/* ── Thank-you page ── */
.vah-ty-check {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 1.25rem;
  background: var(--black); color: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.vah-timeline { list-style: none; counter-reset: vah; display: flex; flex-direction: column; gap: 14px; }
.vah-timeline li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.55; }
.vah-timeline .vah-num { margin-top: 0; }
.vah-box { margin-top: 1.5rem; padding: 18px 20px; background: var(--off-white); border-radius: var(--radius-lg); }
.vah-box-title { font-family: var(--font); font-size: 20px; font-weight: 400; margin-bottom: 6px; color: var(--black); }
.vah-box p { font-size: 14px; line-height: 1.55; color: var(--black); margin-bottom: 14px; }
.vah-code-row { display: flex; gap: 8px; }
.vah-code-row .vah-input { max-width: 140px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.vah-code-row .vah-btn { width: auto; min-height: 48px; font-size: 15px; padding: 10px 18px; }
.vah-success { font-size: 14px; color: var(--black); }

/* ── Mobile ── */
@media (max-width: 480px) {
  .vah-card { padding: 1.5rem 1.1rem 1.25rem; }
  .vah-plan-box { padding: 14px 14px; }
  .vah-plan-price { font-size: 26px; }
  .vah-plan-period { font-size: 13px; }
  .vah-pill span { padding: 0 15px; font-size: 14px; }
  .vah-modal-inner { padding: 1.75rem 1.1rem 1.25rem; }
}
@media (max-width: 340px) {
  .vah-plans { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .vah-spinner { animation-duration: 1.5s; }
}
