/* ============================================================
 *  TANTRA PLATFORM — shared chrome
 *
 *  This file styles four things the five sites have in common:
 *  the consent bar, the form reply line, the exit panel and the
 *  film lightbox.
 *
 *  It deliberately declares no colours of its own. Each site
 *  maps its own tokens onto the eight variables below in its
 *  `tokens.css`, so the consent bar on geniespay.com is a
 *  rounded coral object and the one on tnetroute.com is a
 *  square slate one — same markup, same behaviour, nothing
 *  that looks like a shared template.
 *
 *      /*  NOTE: this file declares NO :root block on purpose.
 *  Each site maps its own tokens onto these variables inside its
 *  own tokens.css (the "PLATFORM BRIDGE" block), and this sheet
 *  loads afterwards — so a :root here would override the brand.
 *  Every use below therefore carries its own fallback. */

/* ---------- shared button shape ---------- */
.tp-btn {
  font: inherit;
  font-family: var(--tp-font, system-ui, sans-serif);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 10px 18px;
  border-radius: var(--tp-radius, 8px);
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  transition: transform .16s ease, opacity .16s ease, background .16s ease;
}
.tp-btn:focus-visible { outline: 2px solid var(--tp-accent, #4EA8FF); outline-offset: 3px; }
.tp-btn:active { transform: translateY(1px); }
.tp-btn--solid { background: var(--tp-accent, #4EA8FF); color: var(--tp-on-accent, #05070B); }
.tp-btn--ghost {
  background: transparent; color: var(--tp-dim, #94A3B8);
  border-color: var(--tp-line, rgba(255,255,255,.16));
}
.tp-btn--ghost:hover { color: var(--tp-ink, #E8EEF5); border-color: var(--tp-ink, #E8EEF5); }

/* ============================================================
 *  CONSENT
 *  Sits at the bottom, never covers the whole page, and the two
 *  answers are given equal visual weight — a decline button
 *  hidden in grey is not a choice.
 * ========================================================== */
/*  While the consent bar is up, the document reserves its height so the
 *  bar never covers a footer link or the last button on a phone.
 *  --tp-consent-h is set by the script and returns to 0 on dismissal. */
body { padding-bottom: var(--tp-consent-h, 0px); }

.tp-consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 900;
  padding: 0 16px 16px;
  transform: translateY(120%);
  transition: transform .34s cubic-bezier(.22,.8,.3,1);
}
.tp-consent.is-in { transform: translateY(0); }

.tp-consent__in {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: var(--tp-bg, #101418);
  color: var(--tp-ink, #E8EEF5);
  border: 1px solid var(--tp-line, rgba(255,255,255,.16));
  border-radius: var(--tp-radius, 8px);
  box-shadow: var(--tp-shadow, 0 18px 48px rgba(0,0,0,.42));
  padding: 16px 20px;
}
.tp-consent__txt { flex: 1 1 380px; min-width: 0; }
.tp-consent__txt strong {
  display: block;
  font-family: var(--tp-font, system-ui, sans-serif);
  font-size: .96rem;
  margin-bottom: 4px;
}
.tp-consent__txt p {
  margin: 0;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--tp-dim, #94A3B8);
  max-width: 62ch;
}
.tp-consent__act { display: flex; gap: 10px; flex: 0 0 auto; }

@media (max-width: 620px) {
  .tp-consent__in { padding: 14px 16px; }
  .tp-consent__act { width: 100%; }
  .tp-consent__act .tp-btn { flex: 1; }
}

/* ============================================================
 *  FORMS
 * ========================================================== */
.tp-hp {                       /* the honeypot — never visible, never read out */
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.tp-formmsg {
  margin: 12px 0 0;
  font-size: .85rem;
  line-height: 1.5;
  min-height: 1.2em;
}
.tp-formmsg[data-kind="ok"]  { color: var(--ok, #2FE0A8); }
.tp-formmsg[data-kind="err"] { color: var(--stop, #FF5C5C); }

/* ============================================================
 *  EXIT PANEL
 *  Markup lives in the page — this only positions it.
 * ========================================================== */
/*  The `hidden` attribute sets display:none from the UA stylesheet, which
 *  an attribute selector here would outrank — leaving a transparent
 *  full-screen layer over the page that swallows every click. This rule
 *  restores it, and must stay above the block below. */
[data-tp-exit][hidden] { display: none !important; }

[data-tp-exit] {
  position: fixed;
  inset: 0;
  z-index: 880;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 4, 8, .62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .28s ease;
}
[data-tp-exit].is-in { opacity: 1; }
[data-tp-exit] > * {
  background: var(--tp-bg, #101418);
  border: 1px solid var(--tp-line, rgba(255,255,255,.16));
  border-radius: var(--tp-radius, 8px);
  box-shadow: var(--tp-shadow, 0 18px 48px rgba(0,0,0,.42));
  max-width: 520px;
  padding: 28px;
  transform: translateY(12px) scale(.98);
  transition: transform .3s cubic-bezier(.22,.8,.3,1);
}
[data-tp-exit].is-in > * { transform: none; }

/* ============================================================
 *  FILM
 * ========================================================== */
.tp-film {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 40px);
  opacity: 0;
  transition: opacity .26s ease;
}
.tp-film.is-in { opacity: 1; }
.tp-film__scrim { position: absolute; inset: 0; background: rgba(2,3,6,.86); }
.tp-film__box {
  position: relative;
  width: min(1100px, 100%);
  background: var(--tp-bg, #101418);
  border: 1px solid var(--tp-line, rgba(255,255,255,.16));
  border-radius: var(--tp-radius, 8px);
  box-shadow: var(--tp-shadow, 0 18px 48px rgba(0,0,0,.42));
  overflow: hidden;
  transform: scale(.97);
  transition: transform .3s cubic-bezier(.22,.8,.3,1);
}
.tp-film.is-in .tp-film__box { transform: none; }
.tp-film__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tp-line, rgba(255,255,255,.16));
}
.tp-film__title {
  font-family: var(--tp-font, system-ui, sans-serif);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tp-dim, #94A3B8);
}
.tp-film__x {
  background: none; border: 0; cursor: pointer;
  color: var(--tp-dim, #94A3B8);
  font-size: 1.5rem; line-height: 1;
  padding: 2px 8px;
  border-radius: var(--tp-radius, 8px);
}
.tp-film__x:hover { color: var(--tp-ink, #E8EEF5); }
.tp-film__x:focus-visible { outline: 2px solid var(--tp-accent, #4EA8FF); outline-offset: 2px; }
.tp-film__v {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #000;
}
.tp-film__cap {
  margin: 0;
  padding: 12px 16px;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--tp-dim, #94A3B8);
}
.tp-film__cap:empty { display: none; }

/* ============================================================
 *  BACKGROUND FILM LAYER
 *  The poster does the work until the file is decoded, and does
 *  all of the work under reduced motion.
 * ========================================================== */
[data-tp-loop] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
 *  READING PROGRESS
 *  --tp-progress is set by the script; the site decides what
 *  the bar looks like. This is only the fallback.
 * ========================================================== */
[data-tp-progress] {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 800;
  background: transparent;
  pointer-events: none;
}
[data-tp-progress]::after {
  content: "";
  display: block; height: 100%;
  width: var(--tp-progress, 0%);
  background: var(--tp-accent, #4EA8FF);
  transition: width .12s linear;
}

/* ============================================================
 *  MOTION
 * ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .tp-consent, .tp-film, .tp-film__box, [data-tp-exit], [data-tp-exit] > *,
  [data-tp-progress]::after, .tp-btn {
    transition: none !important;
  }
  .tp-consent { transform: none; }
}
