/* ============================================================
   LearnETRM — shared.css
   Global UI layer: modal, scroll-to-top, page transitions,
   focus ring, locked-content visual treatment.
   Injected on every page via <link rel="stylesheet">.
   ============================================================ */

/* ── Page entrance (fade-in + subtle rise) ─────────────────── */
@keyframes le-page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}
body {
  animation: le-page-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* When JS triggers exit before navigation */
body.le-exiting {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  body, body.le-exiting {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── Workshop modal — overlay ──────────────────────────────── */
.wm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.wm-overlay.wm-open {
  opacity: 1;
  visibility: visible;
}
.wm-overlay.wm-open .wm-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Workshop modal — card ─────────────────────────────────── */
.wm-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #111113;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 40px 36px 32px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 64px rgba(0,0,0,0.6),
    0 0 80px rgba(255,159,10,0.05);
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
  text-align: center;
}

/* ── Modal close ×  ────────────────────────────────────────── */
.wm-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.wm-x:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}
.wm-x:focus-visible {
  outline: 2px solid rgba(255,159,10,0.7);
  outline-offset: 2px;
}

/* ── Modal icon ────────────────────────────────────────────── */
.wm-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(255,159,10,0.10);
  border: 1px solid rgba(255,159,10,0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #ff9f0a;
  box-shadow: 0 0 32px rgba(255,159,10,0.12);
}

/* ── Modal text ────────────────────────────────────────────── */
.wm-title {
  font-size: 19px;
  font-weight: 700;
  color: #f5f5f7;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-family: inherit;
}
.wm-body-text {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,0.55);
  margin-bottom: 28px;
}
.wm-body-text strong {
  color: rgba(255,255,255,0.75);
  font-weight: 600;
}

/* ── Modal pill (tag) ──────────────────────────────────────── */
.wm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(255,159,10,0.08);
  border: 1px solid rgba(255,159,10,0.18);
  font-size: 12px;
  font-weight: 600;
  color: #ff9f0a;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.wm-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff9f0a;
  box-shadow: 0 0 6px rgba(255,159,10,0.6);
}

/* ── Modal button ──────────────────────────────────────────── */
.wm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 28px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  letter-spacing: -0.01em;
}
.wm-btn:active { transform: scale(0.97); }
.wm-btn-primary {
  background: rgba(255,255,255,0.08);
  color: #f5f5f7;
  border: 1px solid rgba(255,255,255,0.12);
  width: 100%;
}
.wm-btn-primary:hover {
  background: rgba(255,255,255,0.13);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}
.wm-btn-primary:focus-visible {
  outline: 2px solid rgba(255,159,10,0.7);
  outline-offset: 2px;
}

/* ── Scroll-to-top button ──────────────────────────────────── */
.le-scroll-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 8000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.15s ease, border-color 0.15s ease;
}
.le-scroll-top.le-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.le-scroll-top:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.18);
  color: #f5f5f7;
}
.le-scroll-top:active { transform: scale(0.93); }
.le-scroll-top:focus-visible {
  outline: 2px solid rgba(41,151,255,0.7);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .le-scroll-top { transition: opacity 0.15s ease; transform: none !important; }
}

/* ── Focus ring — global improvement ──────────────────────── */
:focus-visible {
  outline: 2px solid rgba(41,151,255,0.7);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Remove outline for mouse-driven clicks (covered by :focus-visible) */
:focus:not(:focus-visible) { outline: none; }

/* ── Mobile touch — eliminate 300ms tap delay globally ─────── */
/* Removes the grey flash on tap and makes interactive elements
   respond instantly on iOS/Android (no double-tap-zoom delay). */
* {
  -webkit-tap-highlight-color: transparent;
}
button, a,
input[type="button"], input[type="submit"], input[type="reset"],
select, label {
  touch-action: manipulation;
}

/* ── Locked-content card visual treatment (index cards) ────── */
/* Adds a "Workshop" pill badge to any locked card via CSS */
a[href="https://checker.learnetrm.com/check-eligibility"].card,
a[href="https://checker.learnetrm.com/check-eligibility"].featured-card {
  position: relative;
  overflow: hidden;
}
a[href="https://checker.learnetrm.com/check-eligibility"].card::after,
a[href="https://checker.learnetrm.com/check-eligibility"].featured-card::after {
  content: 'Workshop';
  position: absolute;
  top: 11px;
  right: 11px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  background: rgba(255,159,10,0.10);
  color: rgba(255,159,10,0.85);
  border: 1px solid rgba(255,159,10,0.22);
  border-radius: 100px;
  pointer-events: none;
  line-height: 1.5;
}
/* Cursor: pointer is fine so users know to click */
a[href="https://checker.learnetrm.com/check-eligibility"] {
  cursor: pointer;
}
/* Dim the arrow on locked index cards slightly */
a[href="https://checker.learnetrm.com/check-eligibility"].card .card-arrow {
  opacity: 0.4;
}

/* ── Inline locked-link styling (content-page text links) ──── */
/* The lock SVG + text links inside body text */
.env-card a[href="https://checker.learnetrm.com/check-eligibility"],
.footer-cta a[href="https://checker.learnetrm.com/check-eligibility"],
p a[href="https://checker.learnetrm.com/check-eligibility"] {
  opacity: 0.75;
  text-decoration-style: dashed;
}
.env-card a[href="https://checker.learnetrm.com/check-eligibility"]:hover,
.footer-cta a[href="https://checker.learnetrm.com/check-eligibility"]:hover,
p a[href="https://checker.learnetrm.com/check-eligibility"]:hover {
  opacity: 1;
}
