/* Product pay pages (/website-build/, /care-plan/) and their thanks/ pages.
   Sits on top of category-fonts.css, styles.css and category-page.css. */

/* Lets one page carry copy for two plans (no page uses this today) */
html:not(.is-care) [data-show="care"], html.is-care [data-show="build"] { display: none !important; }

body { background: var(--char); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > .cp-header, body > .footer { flex: none; }
.pay { position: relative; flex: 1 0 auto; display: flex; align-items: center; padding: clamp(2.2rem, 5vw, 4rem) 0 clamp(3.5rem, 7vw, 5.5rem); overflow: hidden; }
.pay > .container { width: 100%; position: relative; z-index: 1; }
.pay__grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }

.pay__kicker { font-family: var(--font-mono); font-size: .74rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--cp-green-text); display: inline-flex; align-items: center; gap: .55rem; }
.pay__kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(28, 164, 80, .16); }
.pay h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); line-height: 1.04; letter-spacing: -.04em; margin: .9rem 0 1rem; max-width: 14ch; text-wrap: balance; }
.pay h1 em { font-style: normal; color: var(--teal); }
.pay__lede { font-size: clamp(1.05rem, 1.5vw, 1.18rem); line-height: 1.6; color: var(--cp-soft); max-width: 36rem; }

/* Project ticket */
.ticket { margin-top: 2.2rem; background: #fff; border: 1px solid var(--line-l); border-radius: 20px; box-shadow: var(--shadow-md); overflow: hidden; }
.ticket__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line-l); background: #FCFBF8; }
.ticket__id { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cp-note); }
.ticket__id b { color: var(--ink); font-weight: 500; }
.ticket__status { font-size: .75rem; font-weight: 600; color: var(--cp-green-text); background: rgba(28, 164, 80, .1); border-radius: 999px; padding: .3rem .75rem; white-space: nowrap; }

.track { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 1.6rem 1.4rem 1.4rem; position: relative; }
.track::before { content: ""; position: absolute; left: calc(1.4rem + 9px); right: calc(33.33% - 9px); top: calc(1.6rem + 9px); height: 2px; background: linear-gradient(90deg, var(--teal) 0 50%, var(--line-l) 50% 100%); }
.track li { position: relative; padding-top: 2.1rem; padding-right: 1rem; }
.track li::before { content: ""; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--line-l); box-sizing: border-box; }
.track li.is-now::before { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 5px rgba(28, 164, 80, .15); }
.track li.is-next::before { border-color: var(--teal); }
.track__when { display: block; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cp-note); margin-bottom: .3rem; }
.track__what { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); }

.ticket__body { padding: 1.3rem 1.4rem 1.5rem; border-top: 1px dashed #D9D3C5; }
.ticket__label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cp-note); margin-bottom: .9rem; }
.ticket .cp-tier__list { margin-bottom: 0; }

.pay__team { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-top: 1.6rem; flex-wrap: wrap; }
.pay__team .cp-team { margin-top: 0; }

/* Checkout card */
/* Neutral frame, so the black pay button is the strongest thing on the card */
.checkout { position: sticky; top: calc(var(--nav-height) + 1.2rem); background: #fff; border-radius: 22px; border: 1px solid #E6E2D9; box-shadow: 0 18px 50px rgba(20, 24, 31, .10), 0 2px 6px rgba(20, 24, 31, .05); overflow: hidden; }

/* Receipt-style summary */
.receipt { background: var(--ink); color: #fff; padding: 1.4rem 1.5rem 1.7rem; position: relative; }
.receipt__top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.receipt__top img { height: 26px; width: auto; filter: brightness(0) invert(1); opacity: .9; }
.receipt__item { margin-top: 1.1rem; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.receipt__price { display: flex; align-items: baseline; gap: .5rem; margin-top: .35rem; }
.receipt__price b { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 4vw, 3.2rem); letter-spacing: -.04em; line-height: 1; color: #7FD39C; }
.receipt__price span { font-size: .9rem; color: rgba(255, 255, 255, .7); }
.receipt__rows { margin-top: 1rem; display: grid; gap: .45rem; font-family: var(--font-mono); font-size: .76rem; color: rgba(255, 255, 255, .75); }
.receipt__rows div { display: flex; align-items: baseline; gap: .5rem; }
.receipt__rows div::after { content: ""; order: 2; flex: 1; border-bottom: 1px dotted rgba(255, 255, 255, .25); transform: translateY(-3px); }
.receipt__rows span:last-child { order: 3; color: #fff; }

.form { padding: 1.7rem 1.5rem 1.5rem; }
.form__step { display: flex; align-items: center; gap: .6rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cp-note); margin-bottom: .8rem; }
.form__step b { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--ink); color: #fff; font-size: .68rem; letter-spacing: 0; }
.form__step + .fields { margin-bottom: 1.4rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.field { display: grid; gap: .3rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .8rem; font-weight: 600; color: var(--cp-soft); }
.field label small { font-weight: 500; color: var(--cp-note); }
.field input, .field textarea {
  width: 100%; font: 500 .95rem/1.2 var(--font-body); color: var(--ink);
  background: #FCFBF8; border: 1px solid var(--line-l); border-radius: 10px; padding: .78rem .9rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.field textarea { resize: vertical; line-height: 1.45; min-height: 3.2rem; }
.field input::placeholder, .field textarea::placeholder { color: #9AA1AB; }
.field input:focus, .field textarea:focus { outline: none; background: #fff; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(28, 164, 80, .14); }
.field input[aria-invalid="true"] { border-color: var(--color-danger, #d9594e); }

/* Stripe's card form mounts in here, styled through Stripe's appearance settings in pay.js */
.stripe { border: 1px solid var(--line-l); border-radius: 12px; padding: .8rem; background: #fff; min-height: 9.5rem; }
.stripe__loading { font-size: .86rem; color: var(--cp-note); padding: .4rem .2rem; }

.form__error { margin-top: .9rem; font-size: .88rem; line-height: 1.45; color: #B3392F; background: #FDF1EF; border: 1px solid #F3CFC9; border-radius: 10px; padding: .65rem .8rem; }

/* Pay button: solid black, white text, green arrow (option 1, chosen by Rob after
   NEMESIS's review). Selectors carry .btn:not(.btn--outline) to beat the shared
   green .btn hover in styles.css. It stays full strength until clicked; pay.js
   explains what is missing instead of greying it out. */
.pay-btn { width: 100%; margin-top: 1.2rem; font-size: 1.02rem; padding: 1.05rem 1.5rem; gap: .6rem; }
.pay-btn.btn:not(.btn--outline) { background: var(--ink); color: #fff; box-shadow: 0 2px 6px rgba(20, 24, 31, .16); }
.pay-btn.btn:not(.btn--outline):hover { background: #000; color: #fff; box-shadow: 0 10px 28px rgba(20, 24, 31, .28); transform: translateY(-1px); }
.pay-btn.btn:not(.btn--outline):active { transform: translateY(1px); box-shadow: 0 1px 3px rgba(20, 24, 31, .2); }
.pay-btn.btn:focus-visible { outline: 3px solid #12753A; outline-offset: 3px; }
.pay-btn svg { width: 18px; height: 18px; color: #7FD39C; transition: transform .25s var(--ease); }
.pay-btn:hover svg { transform: translateX(3px); }
.pay-btn.is-busy { cursor: progress; opacity: .8; }
.form__fine { margin-top: .9rem; display: grid; gap: .45rem; }
.form__fine p { display: flex; gap: .5rem; align-items: flex-start; font-size: .8rem; line-height: 1.45; color: var(--cp-note); }
.form__fine svg { width: 14px; height: 14px; flex: none; margin-top: .15rem; color: var(--cp-green-text); }

.pay-header .cp-header__help { font-size: .86rem; color: var(--cp-note); }
.pay-header .cp-header__help a { color: var(--ink); font-weight: 600; text-decoration: none; }

/* Thank-you page */
.done { max-width: 38rem; margin: 0 auto; text-align: center; }
.done__mark { width: 64px; height: 64px; margin: 0 auto 1.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #fff; box-shadow: 0 0 0 8px rgba(28, 164, 80, .14); }
.done__mark svg { width: 30px; height: 30px; }
.done h1 { margin-left: auto; margin-right: auto; }
.done .pay__lede { margin: 0 auto; }
.done .btn { margin-top: 1.8rem; }
.done__next { list-style: none; counter-reset: next; display: grid; gap: .95rem; max-width: 30rem; margin: 2.6rem auto 0; padding: 1.4rem 0 0; border-top: 1px solid var(--line-l); text-align: left; }
.done__next li { counter-increment: next; position: relative; padding-left: 2.5rem; line-height: 1.55; color: var(--cp-soft); }
.done__next li::before { content: counter(next); position: absolute; left: 0; top: 0; width: 1.65rem; height: 1.65rem; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #fff; font-family: var(--font-mono); font-size: .78rem; }
.done__next b { color: var(--ink); }
.done__next a, .done__refer a { color: var(--ink); font-weight: 600; }
.done__refer { margin: 2rem auto 0; font-size: .95rem; color: var(--cp-note); }
.done [data-state] { display: none; }
.done[data-status="loading"] [data-state="loading"],
.done[data-status="complete"] [data-state="complete"],
.done[data-status="open"] [data-state="open"],
.done[data-status="error"] [data-state="error"] { display: block; }

@media (max-width: 960px) {
  /* Phone and tablet order: headline, subheadline, team, order form, project card */
  .pay__grid { display: flex; flex-direction: column; gap: 0; }
  .pay__grid > section { display: contents; }
  .pay__kicker { order: 1; align-self: flex-start; }
  .pay h1 { order: 2; }
  .pay__lede { order: 3; }
  .pay__team { order: 4; margin-top: 1.1rem; }
  .checkout { order: 5; position: static; margin-top: 1.4rem; }
  .ticket { order: 6; }
}
@media (max-width: 560px) {
  .track { grid-template-columns: 1fr; gap: 1.1rem; }
  .track::before { display: none; }
  .track li { padding: 0 0 0 2rem; }
  .fields { grid-template-columns: 1fr; }
  .cp-tier__list--2col { grid-template-columns: 1fr; }
}

/* Thank-you page: "Tell us what you want" brief, saved to the order (api/build-brief) */
.brief { max-width: 34rem; margin: 2.2rem auto 0; text-align: left; background: #fff; border: 1px solid var(--line-l); border-radius: 18px; box-shadow: var(--shadow-sm); }
.fields--one { grid-template-columns: 1fr; }
.done .brief .pay-btn { margin-top: 1.2rem; }
.brief__fine { margin-top: .8rem; font-size: .82rem; color: var(--cp-note); text-align: center; }
.brief__done { max-width: 34rem; margin: 2.2rem auto 0; padding: 1rem 1.2rem; border-radius: 14px; background: #EAF6EE; border: 1px solid #BFE3CB; color: #12753A; font-weight: 600; }
