/* Template discount sign-up (.tpo).
   Loaded ONLY on the template store, the templates lander and the individual
   template sales pages (+ their /us/ and /eu/ clones) — never on build/service
   pages, so full-build buyers don't see a discount. Markup lives in each page;
   behaviour (expiry, countdown, submit) in js/template-offer.js.

   Two looks:
   - .tpo-feature  dark, centred panel on the store + lander (numeral | copy | form)
   - .tpo-inline   light card inside a template page's white purchase panel   */

.tpo{position:relative;display:grid;gap:1.25rem;align-items:center;border-radius:1.5rem;padding:1.5rem;}
.tpo[hidden]{display:none;}
#offer{scroll-margin-top:6rem;}

/* ---------- Live dot: red, softly breathing ---------- */
@keyframes tpo-pulse{
  0%{box-shadow:0 0 0 0 rgba(239,68,68,0.55),0 0 6px rgba(239,68,68,0.6);}
  70%{box-shadow:0 0 0 8px rgba(239,68,68,0),0 0 10px rgba(239,68,68,0.35);}
  100%{box-shadow:0 0 0 0 rgba(239,68,68,0),0 0 6px rgba(239,68,68,0.6);}
}
.tpo-tag::before,.tpo-hero-tag::before{content:"";flex:none;width:7px;height:7px;border-radius:50%;background:#ef4444;animation:tpo-pulse 2.4s cubic-bezier(.4,0,.6,1) infinite;}
/* Same motion gate as main.css: decorative loops wait for the first interaction. */
html:not(.motion-ready) .tpo-tag::before,html:not(.motion-ready) .tpo-hero-tag::before{animation-play-state:paused;}
@media (prefers-reduced-motion:reduce){.tpo-tag::before,.tpo-hero-tag::before{animation:none;box-shadow:0 0 6px rgba(239,68,68,0.6);}}

.tpo-tag{display:inline-flex;align-items:center;gap:0.5rem;font-size:0.68rem;font-weight:600;letter-spacing:0.1em;text-transform:uppercase;border-radius:100px;padding:0.35rem 0.75rem;margin-bottom:0.85rem;white-space:nowrap;}
.tpo-title{font-weight:600;letter-spacing:-0.02em;line-height:1.2;margin:0 0 0.4rem;}
.tpo-text{font-size:0.9rem;line-height:1.6;margin:0;}
.tpo-when{white-space:nowrap;font-weight:600;}

/* ---------- Form (shared) ---------- */
.tpo-row{display:flex;flex-wrap:wrap;gap:0.5rem;}
.tpo-input{flex:999 1 13rem;min-width:0;height:50px;padding:0 1.15rem;border-radius:100px;font:inherit;font-size:16px;transition:border-color .2s ease,box-shadow .2s ease,background .2s ease;}
.tpo-input:focus{outline:none;}
.tpo-btn{flex:1 0 auto;height:50px;padding:0 1.4rem;border:0;border-radius:100px;font:inherit;font-size:0.875rem;font-weight:600;white-space:nowrap;cursor:pointer;transition:background .2s ease,transform .2s ease;}
.tpo-btn:hover{transform:translateY(-1px);}
.tpo-btn[disabled]{opacity:0.6;cursor:default;transform:none;}
.tpo-fine{font-size:0.75rem;line-height:1.5;margin:0.7rem 0 0;}
.tpo-fine a{color:inherit;text-decoration:underline;text-underline-offset:2px;}
.tpo-msg{font-size:0.85rem;line-height:1.5;margin:0.6rem 0 0;}
.tpo-msg:empty{display:none;}
.tpo-done{display:flex;align-items:flex-start;gap:0.6rem;font-size:0.95rem;line-height:1.5;margin:0;}
.tpo-done svg{flex:none;margin-top:0.2rem;}
.tpo-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.tpo-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden;}

/* ---------- Feature panel (store + lander) ---------- */
.tpo-feature{
  overflow:hidden;color:#fff;padding:2rem 1.5rem;border-radius:1.5rem;
  background:
    radial-gradient(520px circle at 0% 0%,rgba(239,68,68,0.16),transparent 60%),
    radial-gradient(560px circle at 100% 100%,rgba(90,110,220,0.18),transparent 60%),
    #0b1220;
  box-shadow:0 24px 60px -24px rgba(15,23,42,0.45);
}
.tpo-num{margin:0;font-size:4.25rem;font-weight:600;letter-spacing:-0.06em;line-height:0.85;color:#fff;}
.tpo-num span{font-size:0.5em;letter-spacing:-0.02em;margin-left:0.04em;color:rgba(255,255,255,0.75);vertical-align:0.6em;}
.tpo-feature .tpo-tag{color:#fff;background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.14);}
.tpo-feature .tpo-title{font-size:1.4rem;color:#fff;}
.tpo-feature .tpo-text{color:rgba(255,255,255,0.68);}
.tpo-feature .tpo-when{color:#fff;}
.tpo-feature .tpo-input{background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.18);color:#fff;}
.tpo-feature .tpo-input::placeholder{color:rgba(255,255,255,0.45);}
.tpo-feature .tpo-input:focus{border-color:rgba(255,255,255,0.7);background:rgba(255,255,255,0.1);box-shadow:0 0 0 3px rgba(255,255,255,0.08);}
.tpo-feature .tpo-input[aria-invalid="true"]{border-color:#fca5a5;}
.tpo-feature .tpo-btn{background:#fff;color:#0f172a;}
.tpo-feature .tpo-btn:hover{background:#f1f5f9;}
.tpo-feature .tpo-btn:focus-visible{outline:2px solid #fff;outline-offset:2px;}
.tpo-feature .tpo-fine{color:rgba(255,255,255,0.5);}
.tpo-feature .tpo-msg.is-error{color:#fca5a5;}
.tpo-feature .tpo-done{color:#fff;}
@media (min-width:640px){
  .tpo-feature{grid-template-columns:auto minmax(0,1fr);column-gap:2rem;padding:2.25rem 2.5rem;}
  .tpo-feature form{grid-column:1 / -1;}
  .tpo-num{font-size:5rem;}
}
/* Desktop: numeral | copy | form, as one centred group — no empty middle. */
@media (min-width:1024px){
  .tpo-feature{grid-template-columns:auto minmax(0,27rem) minmax(0,25rem);justify-content:center;column-gap:3rem;padding:2.75rem 3rem;border-radius:2rem;}
  .tpo-feature form{grid-column:auto;}
  .tpo-num{font-size:6rem;padding-right:3rem;border-right:1px solid rgba(255,255,255,0.12);}
  .tpo-feature .tpo-title{font-size:1.6rem;}
}

/* ---------- Inline card (template pages' purchase panel) ---------- */
.tpo-inline{grid-template-columns:1fr;gap:1rem;background:#f8fafc;border:1px solid rgba(15,23,42,0.06);border-radius:1.25rem;padding:1.25rem;margin-bottom:1.5rem;}
.tpo-inline .tpo-tag{color:#0f172a;background:#fff;border:1px solid rgba(15,23,42,0.1);margin-bottom:0.6rem;}
.tpo-inline .tpo-title{font-size:1.05rem;color:#0f172a;}
.tpo-inline .tpo-text{color:#475569;}
.tpo-inline .tpo-when{color:#0f172a;}
.tpo-inline .tpo-input{background:#fff;border:1px solid #e2e8f0;color:#0f172a;}
.tpo-inline .tpo-input::placeholder{color:#94a3b8;}
.tpo-inline .tpo-input:focus{border-color:#0f172a;box-shadow:0 0 0 3px rgba(15,23,42,0.08);}
.tpo-inline .tpo-input[aria-invalid="true"]{border-color:#b91c1c;}
.tpo-inline .tpo-btn{background:#0f172a;color:#fff;}
.tpo-inline .tpo-btn:hover{background:#334155;}
.tpo-inline .tpo-btn:focus-visible{outline:2px solid #0f172a;outline-offset:2px;}
.tpo-inline .tpo-fine{color:#64748b;}
.tpo-inline .tpo-msg.is-error{color:#b91c1c;}
.tpo-inline .tpo-done{color:#0f172a;}

/* ---------- Hero link on template pages (dark hero) → #offer ---------- */
.tpo-hero{display:flex;flex-wrap:wrap;align-items:center;gap:0.4rem 0.65rem;width:fit-content;max-width:100%;margin-top:1.25rem;color:rgba(255,255,255,0.85);font-size:0.875rem;line-height:1.45;text-decoration:none;transition:color .2s ease;}
.tpo-hero[hidden]{display:none;}
.tpo-hero:hover{color:#fff;}
.tpo-hero:focus-visible{outline:2px solid #fff;outline-offset:4px;border-radius:4px;}
.tpo-hero-tag{flex:none;display:inline-flex;align-items:center;gap:0.45rem;font-size:0.65rem;font-weight:600;letter-spacing:0.08em;text-transform:uppercase;color:#0f172a;background:#fff;border-radius:100px;padding:0.28rem 0.65rem;white-space:nowrap;}
.tpo-hero-text u{text-underline-offset:3px;text-decoration-thickness:1px;}

/* Time-limited FAQ entry (store) */
.tpo-faq[hidden]{display:none;}
