/* =========================
   TERMS GATE
   ========================= */

/* LOCK PAGE + BLUR BACKGROUND */
html.gate-open body {
  overflow: hidden;
  pointer-events: none;
}

html.gate-open body > *:not(#termsGate) {
  filter: blur(14px) saturate(0.75) contrast(0.85);
}

/* allow interaction ONLY inside the gate */
html.gate-open #termsGate,
html.gate-open #termsGate * {
  pointer-events: auto;
}

/* OVERLAY */
.terms-gate {
  position: fixed;
  inset: 0;
  display: none; /* JS sets to flex on open */
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 24px;

  background: rgba(0,0,0,0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* CARD (also sets up layout for scrollable body + sticky actions) */
.terms-card {
  width: min(82vw, 1040px);
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 26px 28px 22px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);
  border: 1px solid rgba(0,0,0,0.15);

  display: flex;
  flex-direction: column;
}

/* HEADER */
.terms-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  text-align: center;
  border-bottom: 2px solid #111;
  padding-bottom: 10px;
}

/* TEXT */
#termsGate .terms-card p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(0,0,0,0.85);

  /* override global typography constraints */
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

#termsGate .terms-card p strong {
  font-weight: 800;
}

/* SCROLLABLE CONTENT AREA */
.terms-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
}

/* LIST (BULLETS) — strong overrides for reset/framework CSS */
#termsGate ul {
  display: block !important;
  width: 100%;
  max-width: 100%;
  list-style: disc outside !important;
  list-style-position: outside !important;
  margin: 10px 0 14px 0 !important;
  padding-left: 22px !important;
}

#termsGate li {
  display: list-item !important;
  list-style: disc !important;
  margin: 0 0 8px 0 !important;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(0,0,0,0.85);
}

/* ACTIONS (sticky footer) */
.terms-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;

  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.12);
}

/* BUTTONS */
.btn {
  appearance: none;
  min-width: 220px;
  padding: 14px 18px;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* PRIMARY (ENTER) */
#termsGate .btn-primary {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

#termsGate .btn-primary:hover {
  background-color: #1e40af !important;
}

/* GHOST (DISAGREE) */
#termsGate .btn-ghost {
  background: #fff;
  color: #111;
  border: 2px solid #111;
}

#termsGate .btn-ghost:hover {
  background: rgba(0,0,0,0.05);
}

/* LARGE SCREENS */
@media (min-width: 1200px) {
  #termsGate .terms-card p,
  #termsGate li {
    font-size: 15px;
  }

  .terms-card h2 {
    font-size: 22px;
  }
}

/* MOBILE (general) */
@media (max-width: 700px) {
  .terms-gate { padding: 12px; }

  .terms-card {
    width: 100%;
    border-radius: 10px;
    padding: 16px 16px 14px;
  }

  .terms-card h2 {
    font-size: 15px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    letter-spacing: 0.06em;
  }

  #termsGate .terms-card p {
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 10px;
  }

  #termsGate ul {
    margin: 8px 0 12px 0 !important;
    padding-left: 18px !important;
  }

  #termsGate li {
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 6px !important;
  }

  .terms-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
  }

  .btn {
    min-width: 0;
    width: 100%;
    padding: 12px 12px;
    font-size: 13px;
  }
}

/* MOBILE (extra-tight: ensure fits on small phones) */
@media (max-width: 600px) {
  .terms-card {
    max-height: calc(100vh - 20px);
    padding: 14px 14px 12px;
  }

  .terms-body {
    max-height: calc(100vh - 230px);
  }

  .terms-actions {
    padding-top: 10px;
  }
}

/* === FORCE MODAL FONT (FINAL OVERRIDE) === */

#termsGate {
  font-family: "Lato", Arial, Helvetica, sans-serif;
}

/* Kill all font shorthands */
#termsGate button,
#termsGate a,
#termsGate .btn,
#termsGate input,
#termsGate select,
#termsGate textarea {
  font: inherit !important;
  font-family: "Lato", Arial, Helvetica, sans-serif !important;
}

#termsGate .terms-body a {
  color: inherit;
  text-decoration: underline;
}

/* === TERMS GATE LINK STYLE (PUbA-style) === */
#termsGate .terms-body a,
#termsGate .terms-body a:link,
#termsGate .terms-body a:visited {
  color: #007EFF;
  text-decoration: none;
  font-weight: 600;
}

#termsGate .terms-body a:hover,
#termsGate .terms-body a:focus {
  color: #0066cc; /* slightly darker on hover */
  text-decoration: none;
}

#termsGate .terms-body a:active {
  color: #005bb5;
}