/* ══════════════════════════════════════════════════════════
   TICL Academy — Limited-Time Offer Top Bar + Form Lightbox
   Loaded on every page. Markup is injected by js/offer-bar.js
   ══════════════════════════════════════════════════════════ */

:root { --ob-h: 0px; }

/* When the bar is on screen, push the fixed nav + page content down */
html.ob-visible body      { padding-top: var(--ob-h); }
html.ob-visible nav#navbar,
html.ob-visible nav       { top: var(--ob-h); }

/* The open mobile menu is also fixed-positioned (top: 68px), so it has to
   clear the bar too — otherwise it slides underneath the navbar. */
html.ob-visible .nav-links.open { top: calc(68px + var(--ob-h)); }

/* ─── The bar ─────────────────────────────────────────── */
.offer-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: linear-gradient(90deg, #F59E0B 0%, #FB923C 55%, #F59E0B 100%);
  color: #170F02;
  box-shadow: 0 1px 0 rgba(0,0,0,0.18);
  display: none;
}
html.ob-visible .offer-bar { display: block; }

.offer-bar-inner {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: 9px 46px 9px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.offer-bar-btn {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  cursor: pointer;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.offer-bar-btn:hover .offer-bar-cta { text-decoration-thickness: 2px; }
.offer-bar-btn:focus-visible { outline: 2px solid #170F02; outline-offset: 3px; border-radius: 6px; }

.offer-bar-tag {
  background: rgba(0,0,0,0.16);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.offer-bar-text { font-weight: 700; }
.offer-bar-cta  {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.offer-bar-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(0,0,0,0.12);
  color: #170F02;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.offer-bar-close:hover { background: rgba(0,0,0,0.25); }

/* ─── Lightbox holding the Google Form ────────────────── */
.ob-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2,5,12,0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.25s;
}
.ob-lightbox.open { display: flex; opacity: 1; }

.ob-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  margin: auto;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

.ob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: #0C1526;
  color: #F0F4FF;
}
.ob-head-title { font-size: 15px; font-weight: 800; line-height: 1.35; margin: 0; }
.ob-head-sub   { font-size: 12px; color: #8B9BB4; margin-top: 3px; line-height: 1.4; }

.ob-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #13203A;
  border: 1px solid rgba(255,255,255,0.08);
  color: #8B9BB4;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.ob-close:hover { color: #F0F4FF; background: #050914; }

/* The iframe fills a fixed-height viewport and scrolls its OWN content.
   Do not give the iframe a hardcoded pixel height — Google Forms renders
   much taller on narrow screens and the Submit button would be cut off. */
.ob-frame-wrap {
  background: #fff;
  height: calc(100vh - 150px);
  max-height: 900px;
  min-height: 420px;
  overflow: hidden;
}
.ob-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ─── Mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .offer-bar-inner { padding: 8px 40px 8px 14px; }
  .offer-bar-btn   { font-size: 12.5px; gap: 6px; }
  .offer-bar-tag   { font-size: 9.5px; padding: 2px 8px; }
}

@media (max-width: 640px) {
  .ob-lightbox { padding: 0; align-items: stretch; overflow: hidden; }
  .ob-box {
    border-radius: 0;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;      /* excludes the mobile address bar */
    overflow: hidden;
  }
  .ob-head { flex: 0 0 auto; }
  /* min-height:0 lets the flex child shrink so the iframe gets exactly
     the space left over — the form then scrolls inside the iframe and
     the Submit button is always reachable, however tall the form is. */
  .ob-frame-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
  }
}

@media (max-width: 420px) {
  .offer-bar-btn  { font-size: 12px; line-height: 1.4; }
  .offer-bar-tag  { display: none; }
}
