/* ==========================================================================
   CloserCheck signup components (DRAFT v1, not built)
   Two self-contained components, prefixed .cc- so nothing collides with the
   site's .signup / .card / .grade classes.
     1. .cc-gift    Lead-magnet strip INSIDE the hero: last child of .hero .wrap
                    (after .hero-side), and MOVE div.stats out of the left
                    column to sit right after the strip. Add class "has-gift"
                    to section.hero; that modifier tightens the hero and, on
                    phones, puts the strip right under the buttons, so the
                    form is on the first screen at 1440x900 and 390x844.
     2. .cc-inline  Compact card inside .listings .grid (spans both columns),
                    after the 6th article.card.
   Uses the homepage tokens from styles.css (--primary, --border-strong ...),
   with hard fallbacks so it also works standalone. Manrope is already loaded.

   STATES (all keyboard reachable)
   - Field    default  border #2f3a55 on rgba(7,9,15,.7)
              focus    border #22e47a + 4px green ring rgba(34,228,122,.16)
                       (desktop: on the whole pill via :focus-within;
                        mobile: on the input itself)
              error    form[data-state=error]: border #f87171 + red ring,
                       .cc-msg shown in #fca5a5, input gets aria-invalid=true
   - Button   hover    brightness 1.08, lifts 1px, stronger green glow,
                       arrow nudges 3px right
              active   drops back to 0
              focus-visible  2px #22E47A outline, 3px offset (site's focus colour)
              loading  [aria-busy=true]: label dims, cursor progress
   - Success  form[data-state=success]: field + button hide, .cc-msg shows
              green check line (role=status, polite)
   - Reduced motion: transitions off under prefers-reduced-motion.
   ========================================================================== */

.cc-gift,.cc-inline{
  --cc-green:var(--primary,#22e47a);--cc-on:var(--on-primary,#0A0E15);--cc-purple:var(--accent,#22E47A);
  --cc-line:var(--border-strong,#2f3a55);--cc-text:var(--text,#e6e9f2);--cc-soft:var(--soft,#c6cbe0);--cc-muted:var(--muted,#8b93a7);
  --cc-field:rgba(7,9,15,.72);
  font-family:Manrope,system-ui,-apple-system,sans-serif;color:var(--cc-text);-webkit-font-smoothing:antialiased
}
.cc-gift *,.cc-inline *{box-sizing:border-box;margin:0;padding:0}

/* ---------- shared: eyebrow, headline highlight, form ---------- */
.cc-eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--cc-green)}
.cc-eyebrow:before{content:"";width:8px;height:8px;border-radius:50%;background:var(--cc-green);box-shadow:0 0 12px var(--cc-green)}
.cc-hl{background:var(--grad-head,linear-gradient(90deg,#22e47a,#a3ff6b 40%,#22E47A));-webkit-background-clip:text;background-clip:text;color:transparent}
.cc-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

.cc-form{display:flex;align-items:center;gap:6px;background:var(--cc-field);border:1px solid var(--cc-line);border-radius:999px;padding:6px;transition:border-color .15s,box-shadow .15s}
.cc-form:focus-within{border-color:var(--cc-green);box-shadow:0 0 0 4px rgba(34,228,122,.16)}
.cc-input{flex:1;min-width:0;height:48px;background:transparent;border:0;outline:0;color:var(--cc-text);font:500 16px/1.2 Manrope,system-ui,sans-serif;padding:0 18px;border-radius:999px}
.cc-input::placeholder{color:#6b7390;opacity:1}
.cc-btn{flex:none;height:48px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 24px;border:0;border-radius:999px;background:var(--cc-green);color:var(--cc-on);font:800 15px/1 Manrope,system-ui,sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;box-shadow:0 10px 30px -12px rgba(34,228,122,.7);transition:filter .15s,transform .15s,box-shadow .15s}
.cc-btn:hover{filter:brightness(1.08);transform:translateY(-1px);box-shadow:0 14px 34px -10px rgba(34,228,122,.9)}
.cc-btn:active{transform:translateY(0)}
.cc-btn:focus-visible{outline:2px solid var(--cc-purple);outline-offset:3px}
.cc-btn[aria-busy=true]{cursor:progress;color:rgba(4,20,10,.55)}
.cc-arrow{display:inline-block;transition:transform .15s}
.cc-btn:hover .cc-arrow{transform:translateX(3px)}
.cc-fine{font-size:13px;line-height:1.4;color:var(--cc-muted);margin-top:12px}
.cc-msg{display:none;font-size:14px;font-weight:600;margin-top:10px}
.cc-form[data-state=error]{border-color:#f87171;box-shadow:0 0 0 4px rgba(248,113,113,.14)}
.cc-form[data-state=error]~.cc-msg{display:block;color:#fca5a5}
.cc-form[data-state=success]{display:none}
.cc-form[data-state=success]~.cc-msg{display:flex;align-items:center;gap:10px;color:var(--cc-green);font-size:16px;min-height:60px}
.cc-form[data-state=success]~.cc-msg:before{content:"✓";display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--cc-green);color:var(--cc-on);font-weight:900;font-size:15px}
.cc-form[data-state=success]~.cc-fine{display:none}

/* ---------- shared: tilted PDF / book mockup of the guide cover ---------- */
.cc-book{position:relative;width:var(--cc-book-w,190px);aspect-ratio:1275/1650;transform:perspective(1100px) rotateY(-20deg) rotateX(5deg) rotateZ(-3deg);transform-origin:50% 50%}
.cc-book img{position:relative;z-index:1;display:block;width:100%;height:100%;object-fit:cover;border-radius:3px 7px 7px 3px;outline:1px solid rgba(255,255,255,.09);outline-offset:-1px;
  box-shadow:
    4px 3px 0 -1px #d9deea,7px 6px 0 -2px #aab2c5,10px 9px 0 -3px #7d869c, /* page edges */
    30px 40px 60px -10px rgba(0,0,0,.75),0 0 80px -10px rgba(34,228,122,.25)}
.cc-book:before{content:"";position:absolute;z-index:2;left:0;top:0;bottom:0;width:7%;border-radius:3px 0 0 3px;pointer-events:none;
  background:linear-gradient(90deg,rgba(255,255,255,.14),rgba(0,0,0,.35) 45%,rgba(255,255,255,.08) 70%,transparent)} /* spine */
.cc-book:after{content:"";position:absolute;z-index:2;inset:0;border-radius:3px 7px 7px 3px;pointer-events:none;
  background:linear-gradient(115deg,rgba(255,255,255,.16) 0%,rgba(255,255,255,.04) 28%,transparent 45%)} /* sheen */
.cc-art{position:relative;display:grid;place-items:center}
.cc-art:before{content:"";position:absolute;inset:-20%;background:radial-gradient(closest-side,rgba(34,228,122,.22),transparent 70%);pointer-events:none}

/* ---------- 1. hero strip (inside .hero .wrap) ---------- */
.hero.has-gift{padding:64px 0 56px}
.hero.has-gift .wrap{row-gap:44px}
.hero.has-gift .scale-row{padding:7px 0}
.hero.has-gift .stats{grid-column:1/-1;margin-top:-12px}
.cc-gift{grid-column:1/-1;position:relative}
.cc-gift__card{position:relative;display:grid;grid-template-columns:150px minmax(0,1fr) minmax(0,440px);gap:40px;align-items:center;padding:30px 36px 30px 32px;border-radius:24px;border:1px solid var(--cc-line);
  background:radial-gradient(40% 160% at 0% 50%,rgba(34,228,122,.17),transparent 62%),radial-gradient(40% 160% at 100% 0%,rgba(34,228,122,.24),transparent 62%),linear-gradient(180deg,#10141f,#0b0f19);
  box-shadow:0 40px 100px -50px rgba(34,228,122,.55),inset 0 1px 0 rgba(255,255,255,.05)}
.cc-gift__art{align-self:stretch}
.cc-gift .cc-book{--cc-book-w:124px;position:absolute;left:50%;top:50%;margin:-112px 0 0 -62px} /* overhangs the strip's top edge */
.cc-gift__copy{display:block}
.cc-gift__title{margin:10px 0 8px;font-size:28px;line-height:1.1;font-weight:900;letter-spacing:-.03em;color:#fff}
.cc-gift__sub{font-size:15px;line-height:1.5;color:var(--cc-soft);max-width:34em}
.cc-gift__points{display:none} /* kept in markup for later; hidden to keep the strip slim */
.cc-gift__formcol .cc-fine{padding-left:20px}

/* ---------- 2. inline card between listings ---------- */
.cc-inline{grid-column:1/-1;position:relative;display:grid;grid-template-columns:72px minmax(0,1fr) minmax(320px,460px);gap:28px;align-items:center;padding:22px 26px 22px 30px;border-radius:var(--r-card,18px);
  border:1px solid rgba(34,228,122,.26);background:radial-gradient(60% 160% at 0% 50%,rgba(34,228,122,.12),transparent 60%),linear-gradient(135deg,rgba(15,61,38,.45),rgba(29,22,80,.45)),var(--surface,#10141f);
  box-shadow:0 24px 60px -36px rgba(34,228,122,.45)}
.cc-inline .cc-book{--cc-book-w:64px}
.cc-inline .cc-book img{box-shadow:2px 2px 0 -1px #d9deea,4px 4px 0 -2px #7d869c,12px 16px 24px -6px rgba(0,0,0,.7)}
.cc-inline__title{margin-top:6px;font-size:19px;line-height:1.3;font-weight:800;letter-spacing:-.015em;color:#fff}
.cc-inline__sub{margin-top:4px;font-size:14px;line-height:1.45;color:var(--cc-soft)}
.cc-inline .cc-eyebrow{font-size:11px}
.cc-inline .cc-fine{margin-top:8px;padding-left:18px;font-size:12px}
.cc-inline .cc-input{height:44px}
.cc-inline .cc-btn{height:44px;padding:0 20px;font-size:14px}

/* ---------- breakpoints ---------- */
@media (max-width:1024px){
  .hero.has-gift .hero-side{order:3}
  .cc-gift{order:2}
  .hero.has-gift .stats{order:4;margin-top:0}
  .cc-gift__card{grid-template-columns:120px minmax(0,1fr);gap:20px 32px;padding:28px 32px}
  .cc-gift__formcol{grid-column:2}
  .cc-inline{grid-template-columns:64px minmax(0,1fr);row-gap:16px}
  .cc-inline__form{grid-column:1/-1}
}
@media (max-width:760px){
  /* mobile: art sits top-right beside the headline, form stacks, 52px targets */
  .hero.has-gift{padding:32px 0 48px}
  .hero.has-gift .wrap{row-gap:26px}
  .hero.has-gift .actions{margin-top:20px}
  .cc-gift__card{grid-template-columns:minmax(0,1fr) 84px;grid-template-areas:"head art" "sub sub" "form form";gap:16px 14px;padding:24px 20px 22px;border-radius:22px;
    background:radial-gradient(90% 60% at 100% 0%,rgba(34,228,122,.26),transparent 65%),radial-gradient(80% 60% at 0% 100%,rgba(34,228,122,.14),transparent 65%),linear-gradient(180deg,#10141f,#0b0f19)}
  .cc-gift__art{grid-area:art;align-self:start}
  .cc-gift__copy{display:contents}
  .cc-gift__head{grid-area:head}
  .cc-gift__sub{grid-area:sub}
  .cc-gift__formcol{grid-area:form}
  .cc-gift .cc-book{--cc-book-w:80px;position:relative;left:auto;top:auto;margin:-2px 0 0 0}
  .cc-gift .cc-book img{box-shadow:2px 2px 0 -1px #d9deea,4px 4px 0 -2px #aab2c5,6px 6px 0 -3px #7d869c,14px 20px 30px -8px rgba(0,0,0,.75),0 0 50px -10px rgba(34,228,122,.3)}
  .cc-gift__title{font-size:25px;margin:10px 0 0}
  .cc-gift__sub{font-size:16px}
  .cc-gift__formcol .cc-fine{padding-left:0}
  .cc-form{flex-direction:column;align-items:stretch;gap:10px;background:none;border:0;padding:0;border-radius:0}
  .cc-form:focus-within{box-shadow:none}
  .cc-input,.cc-inline .cc-input{flex:none;width:100%;height:52px;padding:0 16px;font-size:16px;background:var(--cc-field);border:1px solid var(--cc-line);border-radius:14px;transition:border-color .15s,box-shadow .15s}
  .cc-input:focus{border-color:var(--cc-green);box-shadow:0 0 0 4px rgba(34,228,122,.16)}
  .cc-form[data-state=error]{box-shadow:none}
  .cc-form[data-state=error] .cc-input{border-color:#f87171;box-shadow:0 0 0 4px rgba(248,113,113,.14)}
  .cc-btn,.cc-inline .cc-btn{width:100%;height:52px;border-radius:14px;font-size:16px}
  .cc-fine{text-align:center}
  .cc-inline{grid-template-columns:56px minmax(0,1fr);gap:16px 16px;padding:20px 18px}
  .cc-inline .cc-book{--cc-book-w:52px}
  .cc-inline__title{font-size:18px}
  .cc-inline .cc-fine{padding-left:0}
}
@media (prefers-reduced-motion:reduce){.cc-gift *,.cc-inline *{transition:none!important}}

/* ---- CloserCheck site additions (build.py) ---- */
.cc-gift{scroll-margin-top:96px}
.cc-gift__title .cc-hl{white-space:nowrap}
/* keep the whole guide card clear of the fixed sponsor bar on the first screen (desktop 1440x900, mobile 390x844) */
@media (min-width:1025px){.hero.has-gift{padding-top:44px}.hero.has-gift .wrap{row-gap:36px}.cc-gift__card{padding-top:24px;padding-bottom:24px}}
@media (max-width:760px){.hero.has-gift{padding-top:22px}}
/* Beehiiv embed box (Oct 26 fix): our "Get the free guide" button shows in every state except ready (Beehiiv's form sized and on
   screen), so nobody sees an empty box: no JS, idle, loading, failed (+ under Beehiiv's bot check in "challenge"). */
.cc-embed{position:relative;width:100%}
.cc-embed__slot iframe{max-width:100%;color-scheme:normal}
/* Beehiiv's form needs ~442px to keep "Send me the guide" on one line (input and button shrink together below that); widen the desktop hero form column 440 -> 460 like the inline card */
@media (min-width:1025px){.cc-gift__card{grid-template-columns:150px minmax(0,1fr) minmax(0,460px)}}
.cc-embed__fallback{display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;min-height:52px}
.cc-embed[data-state=ready] .cc-embed__fallback{display:none}
.cc-embed[data-state=failed] .cc-embed__slot{display:none}
.cc-embed[data-state=challenge] .cc-embed__fallback{margin-top:12px}
@media (max-width:760px){.cc-embed__fallback{width:100%}}
