/* =====================================================================
   TENNET promotions: homepage hero carousel, /promotii listing and detail.
   Loaded after site.css. Brand tokens from tennet.css (--tn-*).
   Spec: docs/research/competitor-ux.md §9.
   ===================================================================== */

/* ---------- Carousel shell ---------- */
.tn-carousel { position: relative; background: var(--tn-surface); }
.tn-carousel__track {
  position: relative; display: flex; align-items: stretch;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.tn-carousel.is-ready .tn-carousel__track { scrollbar-width: none; }
.tn-carousel.is-ready .tn-carousel__track::-webkit-scrollbar { display: none; }
.tn-carousel__slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.tn-carousel__track:focus-visible { outline: 3px solid var(--tn-red); outline-offset: -3px; }

/* Controls: reserved in the layout from the first paint (no shift), revealed once JS is ready. */
.tn-carousel__controls { visibility: hidden; }
.tn-carousel.is-ready .tn-carousel__controls { visibility: visible; }
.tn-carousel__bar {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--tn-border); border-radius: 999px;
  box-shadow: 0 10px 28px rgba(18, 7, 8, .22);
}
.tn-carousel__dots { display: inline-flex; align-items: center; }
.tn-carousel__btn, .tn-carousel__dot {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--tn-ink); cursor: pointer;
}
.tn-carousel__btn:hover { background: var(--tn-soft); color: var(--tn-red-dark); }
.tn-carousel__btn:focus-visible, .tn-carousel__dot:focus-visible { outline: 3px solid var(--tn-red); outline-offset: -2px; }
.tn-carousel__dot { width: 34px; }
.tn-carousel__dot::before {
  content: ""; width: 10px; height: 10px; border-radius: 999px;
  background: #9aa1ab; transition: width .2s ease, background-color .2s ease;
}
.tn-carousel__dot:hover::before { background: var(--tn-ink); }
.tn-carousel__dot[aria-current="true"]::before { width: 24px; background: var(--tn-red); }
.tn-carousel__icon-play { display: none; }
.tn-carousel__toggle.is-paused .tn-carousel__icon-pause { display: none; }
.tn-carousel__toggle.is-paused .tn-carousel__icon-play { display: block; }
.tn-carousel__toggle { border-left: 1px solid var(--tn-border); border-radius: 0 999px 999px 0; margin-left: 2px; }

/* ---------- Promo slide (reuses the .tn-hero layout of the brand slide) ---------- */
.tn-promo-slide__copy { max-width: 600px; }
.tn-promo-chip {
  display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; margin: 0 0 14px; padding: 5px 13px;
  border-radius: 999px; background: var(--tn-red); color: #fff;
  font-family: var(--tn-font-display); font-size: .8rem; font-weight: 700; line-height: 1.4;
}
.tn-promo-slide__title {
  margin: 0 0 14px; color: var(--tn-ink); font-family: var(--tn-font-display);
  font-size: clamp(2rem, 3.6vw, 3.1rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.08;
  text-wrap: balance;
}
.tn-promo-slide__lead { max-width: 540px; margin: 0 0 18px; color: var(--tn-text); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.55; }
.tn-promo-slide .tn-hero__actions { margin-top: 4px; }

/* Price: small prefix, big Manrope amount, small unit, note on its own line */
.tn-price { margin: 0 0 22px; color: var(--tn-ink); line-height: 1.1; }
.tn-price__main { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.tn-price__prefix, .tn-price__unit { font-family: var(--tn-font-display); font-size: 1rem; font-weight: 600; }
.tn-price__amount { color: var(--tn-red); font-family: var(--tn-font-display); font-size: 2.75rem; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.tn-price__note { display: block; margin-top: 7px; color: var(--tn-text); font-size: .9rem; line-height: 1.4; }

.tn-promo-benefits { display: grid; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.tn-promo-benefits li { display: flex; align-items: flex-start; gap: 10px; color: var(--tn-ink); font-weight: 500; line-height: 1.45; }
.tn-promo-benefits .tn-icon { flex: 0 0 18px; margin-top: 3px; color: var(--tn-red); }

.tn-promo-legal { max-width: 560px; margin: 18px 0 0; color: var(--tn-text); font-size: .8125rem; line-height: 1.55; }
.tn-promo-legal a { color: var(--tn-red-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tn-promo-legal a:hover { color: var(--tn-red); }

/* Visual: same diagonal frame as the brand fiber visual */
.tn-promo-art { display: block; }
.tn-hero-media img.tn-promo-art { object-position: 74% 50%; }
.tn-promo-slide__media { background: linear-gradient(160deg, var(--tn-red) 0%, var(--tn-red-dark) 100%); }

/* Theme: dark (graphite) */
.tn-promo-slide--dark { background: linear-gradient(100deg, #231f1d 0%, #2a2523 55%, #342d2b 100%); }
.tn-promo-slide--dark .tn-promo-slide__title, .tn-promo-slide--dark .tn-price,
.tn-promo-slide--dark .tn-promo-benefits li { color: #fff; }
.tn-promo-slide--dark .tn-promo-slide__lead { color: #eae7e6; }
.tn-promo-slide--dark .tn-price__amount { color: #ff6b6f; }
.tn-promo-slide--dark .tn-price__note, .tn-promo-slide--dark .tn-promo-legal { color: #d9d5d4; }
.tn-promo-slide--dark .tn-promo-benefits .tn-icon { color: #ff6b6f; }

/* Theme: red */
.tn-promo-slide--red { background: linear-gradient(100deg, var(--tn-red) 0%, #d50d16 55%, var(--tn-red-dark) 100%); }
.tn-promo-slide--red .tn-promo-chip { background: #fff; color: var(--tn-red-dark); }
.tn-promo-slide--red .tn-promo-slide__title, .tn-promo-slide--red .tn-price, .tn-promo-slide--red .tn-price__amount,
.tn-promo-slide--red .tn-promo-slide__lead, .tn-promo-slide--red .tn-price__note, .tn-promo-slide--red .tn-promo-legal,
.tn-promo-slide--red .tn-promo-benefits li, .tn-promo-slide--red .tn-promo-benefits .tn-icon { color: #fff; }
.tn-promo-slide--red .tn-promo-slide__media { background: var(--tn-graphite); }

/* Dark + red: light buttons, links and focus rings */
.tn-promo-slide--dark .tn-promo-legal a, .tn-promo-slide--red .tn-promo-legal a { color: #fff; }
.tn-promo-slide--dark .tn-promo-legal a:hover, .tn-promo-slide--red .tn-promo-legal a:hover { color: #ffd2d3; }
.tn-promo-slide--dark .tn-btn--outline, .tn-promo-slide--red .tn-btn--outline { background: transparent; border-color: #fff; color: #fff; }
.tn-promo-slide--dark .tn-btn--outline:hover, .tn-promo-slide--red .tn-btn--outline:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.tn-promo-slide--red .tn-btn--primary { background: #fff; border-color: #fff; color: var(--tn-red-dark); }
.tn-promo-slide--red .tn-btn--primary:hover { background: var(--tn-red-tint); border-color: var(--tn-red-tint); color: var(--tn-red-dark); }
.tn-promo-slide--dark :focus-visible, .tn-promo-slide--red :focus-visible { outline-color: #fff; }

/* ---------- Desktop / tablet ---------- */
@media (min-width: 768px) {
  /* Fixed minimum height for every slide: no layout shift when slides change. */
  .tn-carousel .tn-hero__grid { min-height: 540px; }
  .tn-promo-slide .tn-hero__copy { padding-block: 56px 64px; }
  .tn-promo-slide .tn-promo-art { clip-path: polygon(22% 0, 100% 0, 100% 100%, 6.5% 100%); }
  .tn-promo-slide--no-art .tn-hero__spacer { display: none; }
  .tn-promo-slide--no-art .tn-hero__grid { grid-template-columns: minmax(0, 1fr); }

  /* Controls float over the decorative visual (bottom right), never over the text column. */
  .tn-carousel__controls {
    position: absolute; z-index: 5; bottom: 22px;
    right: max(24px, calc((100% - var(--tn-container)) / 2));
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .tn-carousel .tn-hero__grid { min-height: 500px; }
  .tn-promo-slide__title { font-size: clamp(1.8rem, 4vw, 2.3rem); }
  .tn-carousel__controls { right: 16px; bottom: 16px; }
}

/* ---------- Mobile: text on a solid panel, visual below, controls below everything ---------- */
@media (max-width: 767px) {
  .tn-carousel__slide { display: flex; flex-direction: column; }
  .tn-carousel .tn-hero-media { flex: 1 0 200px; height: auto; min-height: 200px; }
  .tn-hero-media img.tn-promo-art { object-position: 68% 45%; }
  .tn-promo-slide .tn-hero__copy { padding-block: 36px 28px; }
  .tn-promo-slide .tn-hero__actions { flex-direction: column; }
  .tn-promo-slide .tn-hero__actions .tn-btn { width: 100%; }
  .tn-promo-slide__title { font-size: clamp(1.75rem, 7.6vw, 2.25rem); }
  .tn-price__amount { font-size: 2.5rem; }
  .tn-carousel__controls {
    display: flex; justify-content: center; padding: 12px 16px;
    background: var(--tn-soft); border-bottom: 1px solid var(--tn-border);
  }
  .tn-carousel__bar { box-shadow: 0 4px 14px rgba(18, 7, 8, .08); }
}

@media (prefers-reduced-motion: reduce) {
  .tn-carousel__dot::before { transition: none; }
}

/* ---------- /promotii listing ---------- */
.tn-promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.tn-promo-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: 14px; box-shadow: var(--tn-shadow);
}
.tn-promo-card__media { position: relative; aspect-ratio: 16 / 7; overflow: hidden; background: radial-gradient(120% 90% at 70% 40%, #6d1117 0%, #2f0a0e 45%, #120708 100%); }
.tn-promo-card__media::before { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 4px; background: var(--tn-red); }
.tn-promo-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tn-promo-card__body { display: flex; flex: 1; flex-direction: column; padding: 24px 24px 22px; }
.tn-promo-card__title { margin: 0 0 10px; color: var(--tn-ink); font-family: var(--tn-font-display); font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.tn-promo-card__lead { margin: 0 0 18px; color: var(--tn-text); }
.tn-promo-card .tn-price { margin-bottom: 18px; }
.tn-promo-card .tn-price__amount { font-size: 2.4rem; }
.tn-promo-benefits--compact { margin-bottom: 18px; }
.tn-promo-benefits--compact li { font-size: .95rem; font-weight: 400; color: var(--tn-text); }
.tn-promo-card__footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--tn-border); }
.tn-promo-card__legal { margin: 0 0 14px; color: var(--tn-text); font-size: .8125rem; line-height: 1.5; }
.tn-promo-card__validity { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--tn-ink); }
.tn-promo-card__validity .tn-icon { color: var(--tn-red); }
.tn-promo-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tn-promo-card__actions .tn-link-arrow { min-height: 44px; }

.tn-promo-empty { max-width: 640px; margin: 0 auto; padding: 40px 32px; text-align: center; background: var(--tn-soft); border: 1px solid var(--tn-border); border-radius: 14px; }
.tn-promo-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; background: var(--tn-red-tint); color: var(--tn-red); }
.tn-promo-empty__title { margin: 0 0 8px; color: var(--tn-ink); font-family: var(--tn-font-display); font-size: 1.35rem; font-weight: 800; }
.tn-promo-empty p { margin: 0 0 22px; color: var(--tn-text); }
.tn-promo-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- /promotii/{slug} detail ---------- */
.tn-promo-preview { margin-bottom: 28px; }
.tn-promo-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 48px; align-items: start; }
.tn-promo-detail__main .tn-h3 { margin: 0 0 14px; color: var(--tn-ink); font-size: 1.45rem; }
.tn-promo-detail__file { margin: 20px 0 0; }
.tn-promo-detail__aside {
  position: sticky; top: 24px; display: flex; flex-direction: column; gap: 4px;
  padding: 26px; background: var(--tn-surface); border: 1px solid var(--tn-border); border-top: 4px solid var(--tn-red);
  border-radius: 14px; box-shadow: var(--tn-shadow);
}
.tn-promo-detail__aside .tn-price { margin: 4px 0 14px; }
.tn-promo-detail__validity { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--tn-ink); font-weight: 600; }
.tn-promo-detail__validity .tn-icon { color: var(--tn-red); }
.tn-promo-detail__legal { margin: 0 0 12px; color: var(--tn-text); font-size: .8125rem; line-height: 1.5; }
.tn-promo-detail__cta { width: 100%; margin-top: 8px; }
@media (max-width: 900px) {
  .tn-promo-detail { grid-template-columns: 1fr; gap: 32px; }
  .tn-promo-detail__aside { position: static; order: -1; }
}
@media (max-width: 767px) {
  .tn-promo-grid { grid-template-columns: 1fr; gap: 20px; }
  .tn-promo-card__body { padding: 20px; }
  .tn-promo-empty { padding: 32px 20px; }
  .tn-promo-empty__actions .tn-btn { width: 100%; }
}

/* ---------- Offer showcase on the right of a promo slide (plans linked to the promotion) ---------- */
.tn-showcase { display: none; }
@media (min-width: 1024px) {
  .tn-showcase {
    position: absolute; z-index: 3; top: 50%; right: max(32px, calc((100vw - var(--tn-container, 1200px)) / 2));
    display: block; width: min(372px, 52%); padding: 22px 22px 18px; transform: translateY(-56%);
    background: rgba(255, 255, 255, .97); border: 1px solid rgba(255, 255, 255, .6); border-radius: 20px;
    box-shadow: 0 30px 60px rgba(18, 7, 8, .45), 0 0 0 8px rgba(255, 255, 255, .08);
    color: var(--tn-ink);
  }
  .tn-showcase__head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--tn-border); }
  .tn-showcase__icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 56px; height: 56px; border-radius: 16px; background: var(--tn-red); color: #fff; box-shadow: 0 10px 22px rgba(233, 15, 24, .35); }
  .tn-showcase__kicker { margin: 0; color: var(--tn-muted); font-size: .8125rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
  .tn-showcase__big { margin: 0; color: var(--tn-ink); font-family: var(--tn-font-display); font-size: 2.125rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; }
  .tn-showcase__big small { color: var(--tn-red); font-size: .55em; font-weight: 700; letter-spacing: 0; }
  .tn-showcase__list { margin: 0; padding: 0; list-style: none; }
  .tn-showcase__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; margin: 0 -10px; border-radius: 10px; }
  .tn-showcase__list li + li { border-top: 1px dashed var(--tn-border); }
  .tn-showcase__list li.is-featured { background: var(--tn-red-tint); border-top-color: transparent; }
  .tn-showcase__list li.is-featured + li { border-top-color: transparent; }
  .tn-showcase__name { display: flex; flex-direction: column; min-width: 0; font-family: var(--tn-font-display); font-size: .9375rem; font-weight: 700; line-height: 1.25; }
  .tn-showcase__name small { color: var(--tn-muted); font-family: var(--tn-font); font-size: .8125rem; font-weight: 500; }
  .tn-showcase__price { flex: 0 0 auto; color: var(--tn-red); font-family: var(--tn-font-display); font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
  .tn-showcase__price small { color: var(--tn-ink); font-size: .75rem; font-weight: 600; letter-spacing: 0; }
  .tn-showcase__note { margin: 10px 0 0; color: var(--tn-muted); font-size: .8125rem; text-align: right; }
  /* the abstract art becomes a backdrop behind the banner */
  .tn-promo-slide__media:has(.tn-showcase) .tn-promo-art { opacity: .3; filter: blur(2px); }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .tn-showcase { width: 320px; padding: 18px 18px 14px; }
  .tn-showcase__big { font-size: 1.75rem; }
  .tn-showcase__list li { padding-block: 7px; }
}

/* Product-screenshot slides (visual = vyreon / guard / planner): dark stage, framed desktop screen, phone in front. */
.tn-promo-shots__bg { position: absolute; inset: 0; background: radial-gradient(60% 70% at 62% 48%, rgba(233, 15, 24, .32) 0%, rgba(233, 15, 24, 0) 70%), radial-gradient(90% 100% at 70% 40%, #4a0c11 0%, #26090c 55%, #110708 100%); }
.tn-hero-media .tn-promo-shots__screen img, .tn-hero-media .tn-promo-shots__phone img { position: static; inset: auto; display: block; width: 100%; height: auto; object-fit: initial; }
.tn-promo-shots__screen { position: absolute; z-index: 1; top: 50%; left: 25%; width: 64%; overflow: hidden; background: #fff; border-radius: 12px; box-shadow: 0 30px 70px rgba(0, 0, 0, .5); transform: translateY(-54%); }
.tn-promo-shots__bar { display: flex; gap: 6px; padding: 9px 12px; background: #f3f4f6; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.tn-promo-shots__bar i { width: 9px; height: 9px; border-radius: 50%; background: #d1d5db; }
.tn-promo-shots__bar i:first-child { background: var(--tn-red); }
.tn-promo-shots__phone { position: absolute; z-index: 2; right: 5%; bottom: 7%; width: 15%; min-width: 92px; overflow: hidden; padding: 5px; background: #0d0d0d; border-radius: 22px; box-shadow: 0 22px 50px rgba(0, 0, 0, .55); }
.tn-promo-shots__phone img { border-radius: 17px; }
@media (min-width: 768px) {
  .tn-promo-shots__bg { clip-path: polygon(22% 0, 100% 0, 100% 100%, 6.5% 100%); }
}
@media (max-width: 767px) {
  .tn-promo-shots__bg { clip-path: polygon(0 calc(14% + 6px), 100% 6px, 100% 100%, 0 100%); }
  .tn-promo-shots__screen { left: 8%; width: 70%; top: 58%; }
  .tn-promo-shots__phone { right: 6%; bottom: 6%; width: 21%; min-width: 0; border-radius: 14px; padding: 3px; }
  .tn-promo-shots__phone img { border-radius: 11px; }
}

/* Narrow phones (external audit 25.11.2026, point 6): the 7-dot bar was 392px wide and overflowed at 320px.
   Dots stay ≥24px targets (WCAG 2.2 AA), buttons 36px; the bar fits in 304px. */
@media (max-width: 419px) {
  .tn-carousel__controls { padding-inline: 8px; }
  .tn-carousel__bar { max-width: 100%; padding: 3px; gap: 0; }
  .tn-carousel__btn { width: 36px; height: 40px; }
  .tn-carousel__dot { width: 24px; height: 40px; }
  .tn-carousel__dot::before { width: 8px; height: 8px; }
  .tn-carousel__dot[aria-current="true"]::before { width: 16px; }
}
