/* SkyLock Media — Part 107 Study Guide
   Brand palette pulled from the SkyLock Media logo. */

:root {
  --navy: #142a4f;
  --navy-dark: #0c1c38;
  --sky: #7ea6d8;
  --sky-light: #eaf1fb;
  --teal: #1f6f5c;
  --teal-light: #e6f3ef;
  --ink: #1c2430;
  --paper: #ffffff;
  --bg: #f6f8fb;
  --border: #dbe3ee;
  --danger: #b3261e;
  --danger-bg: #fbeceb;
  --good: #1f6f5c;
  --good-bg: #e6f3ef;
  --radius: 10px;
  --maxw: 960px;
}

* { box-sizing: border-box; }

html {
  background: #e3eefb;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #e8f2fd;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.38), rgba(220,235,250,.52)),
    url("assets/img/drone-pattern.svg");
  background-attachment: fixed;
  background-position: center top;
  background-size: 100% 100%, 280px 193px;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------- Header ---------- */

.site-header {
  background: linear-gradient(110deg, var(--navy-dark), var(--navy) 58%, #204c7b);
  color: #fff;
  border-bottom: 4px solid var(--sky);
}

.site-header .header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 6px 14px;
  border-radius: 8px;
}

.brand img { height: 40px; width: auto; display: block; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text .name { font-weight: 700; font-size: 1.05rem; color: #fff; }
.brand-text .sub { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--sky); text-transform: uppercase; }

.top-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.top-nav a {
  color: #dfe9fa;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
}

.top-nav a:hover, .top-nav a.active {
  background: rgba(255,255,255,0.12);
  text-decoration: none;
  color: #fff;
}

.top-nav .sg-admin-preview-toggle {
  background: #f5b942;
  color: var(--navy-dark);
  font-weight: 700;
}

.top-nav .sg-admin-preview-toggle:hover {
  background: #ffd678;
  color: var(--navy-dark);
}

.sg-admin-preview-banner {
  background: #fff3cd;
  border-bottom: 1px solid #e2bd58;
  color: #5c4300;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px 20px;
  text-align: center;
}

.sg-admin-preview-exit {
  appearance: none;
  background: var(--navy);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 7px 12px;
  white-space: nowrap;
}

.sg-admin-preview-exit:hover {
  background: var(--navy-dark);
}

@media (max-width: 700px) {
  .sg-admin-preview-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
}

/* ---------- Layout ---------- */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

.page.no-sidebar { grid-template-columns: 1fr; max-width: var(--maxw); }

@media (max-width: 800px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .content { order: 1; }
}

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 16px;
  box-shadow: 0 12px 30px rgba(20, 42, 79, .1);
}

.sidebar h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
  margin: 4px 6px 8px;
}

.sidebar ol, .sidebar ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.sidebar li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.9rem;
}

.sidebar li a:hover { background: var(--sky-light); text-decoration: none; }
.sidebar li a.current { background: var(--teal-light); color: var(--teal); font-weight: 600; }

.sidebar .status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
  flex: 0 0 auto;
}

.sidebar .status-dot.done { background: var(--good); }

.sidebar .divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

.sidebar .tool-links a { font-weight: 600; }

/* ---------- Content ---------- */

.content {
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 4px solid var(--sky);
  border-radius: var(--radius);
  padding: 30px 34px;
  min-width: 0;
  box-shadow: 0 18px 46px rgba(20, 42, 79, .11);
}

.content h1 { color: var(--navy); margin-top: 0; font-size: 1.7rem; }
.content h2 { color: var(--navy); margin-top: 2em; border-top: 1px solid var(--border); padding-top: 0.9em; font-size: 1.3rem; }
.content h3 { color: var(--navy); font-size: 1.08rem; margin-top: 1.6em; }

.module-meta {
  display: inline-block;
  background: var(--sky-light);
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.table-wrap { overflow-x: auto; margin: 1em 0; }

table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
table caption { text-align: left; font-size: 0.85rem; color: #555; margin-bottom: 4px; }
th, td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: var(--sky-light); color: var(--navy); }
tr:nth-child(even) td { background: #fbfcfe; }

figure { margin: 1.4em 0; text-align: center; }
figure img { border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 8px; }
.study-image-zoom {
  cursor: zoom-in;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.study-image-zoom:hover,
.study-image-zoom:focus-visible {
  box-shadow: 0 0 0 3px rgba(25, 99, 155, 0.28);
  outline: none;
  transform: translateY(-1px);
}
.study-image-hint {
  display: table;
  margin: 0.55rem auto 0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--sky-light);
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 700;
  pointer-events: none;
}
.image-lightbox[hidden] { display: none !important; }
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 1rem;
  background: rgba(4, 15, 30, 0.92);
}
.image-lightbox-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(96vw, 1600px);
  height: calc(100vh - 5rem);
  max-width: min(96vw, 1400px);
  max-height: calc(100vh - 5rem);
  gap: 0.75rem;
}
.image-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.image-lightbox-toolbar button {
  min-width: 2.6rem;
  min-height: 2.6rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.image-lightbox-toolbar button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}
.image-lightbox-toolbar button:disabled {
  cursor: default;
  opacity: 0.42;
}
.image-lightbox-toolbar button:focus-visible {
  outline: 3px solid #7cc7ff;
  outline-offset: 2px;
}
.image-lightbox-scale {
  min-width: 4.25rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.image-lightbox-viewport {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  cursor: default;
  touch-action: none;
}
.image-lightbox-viewport.is-zoomed { cursor: grab; }
.image-lightbox-viewport.is-dragging { cursor: grabbing; }
.image-lightbox-viewport img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: #fff;
  user-select: none;
  transform-origin: center;
  will-change: transform;
}
.image-lightbox-caption {
  max-width: 70ch;
  margin: 0 auto;
  color: #fff;
  text-align: center;
}
.image-lightbox-close {
  min-width: 2.75rem;
  min-height: 2.75rem;
  font-size: 2rem;
  line-height: 1;
}
.image-lightbox-open { overflow: hidden; }
figcaption { font-size: 0.85rem; color: #555; margin-top: 8px; }

@media (max-width: 600px) {
  .image-lightbox {
    padding: 1rem 0.5rem 0.5rem;
  }
  .image-lightbox-panel {
    width: 100%;
    height: calc(100vh - 1.5rem);
    max-width: none;
    max-height: none;
  }
  .image-lightbox-toolbar {
    flex-wrap: wrap;
  }
}

blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 4px solid var(--sky);
  background: var(--sky-light);
  border-radius: 0 6px 6px 0;
}

.exam-trap {
  margin: 1.2em 0;
  padding: 14px 16px;
  border-left: 4px solid #c47f00;
  background: #fff6e6;
  border-radius: 0 6px 6px 0;
}

.exam-trap strong.label {
  display: inline-block;
  color: #8a5700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

hr.section { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

.disclaimer {
  font-size: 0.82rem;
  color: #555;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { background: #175346; text-decoration: none; color: #fff; }
.btn.secondary { background: var(--navy); }
.btn.secondary:hover { background: var(--navy-dark); }
.btn.ghost { background: transparent; color: var(--teal); border: 1px solid var(--teal); }
.btn:disabled { background: #b7bfca; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

/* ---------- Cards / dashboard ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 16px 0 28px;
}

.card {
  background: rgba(255,255,255,.97);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 7px 18px rgba(20, 42, 79, .07);
}

.card:hover {
  border-color: #afc6e3;
  box-shadow: 0 10px 24px rgba(20, 42, 79, .11);
}

.card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--navy); }
.card p { margin: 0; font-size: 0.86rem; color: #555; }

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar > div { height: 100%; background: var(--teal); }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sky-light);
  color: var(--navy);
}
.badge.done { background: var(--good-bg); color: var(--good); }

/* ---------- Quiz / exam UI ---------- */

.quiz-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}

.quiz-progress { font-size: 0.85rem; color: #555; margin-bottom: 12px; }

.stem { font-weight: 600; font-size: 1.05rem; margin-bottom: 14px; }

.choice {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--paper);
}
.choice:hover { border-color: var(--sky); }
.choice input { margin-right: 10px; }
.choice.correct { border-color: var(--good); background: var(--good-bg); }
.choice.incorrect { border-color: var(--danger); background: var(--danger-bg); }
.choice.disabled { cursor: default; }

.rationale {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--sky-light);
  font-size: 0.92rem;
}

.exam-trap-note {
  margin-top: 10px;
  font-size: 0.88rem;
  color: #8a5700;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}
.timer.low { color: var(--danger); }

.flag-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  color: #555;
}
.flag-btn.flagged { background: #fff6e6; border-color: #c47f00; color: #8a5700; }

.qnav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 6px;
  margin: 14px 0;
}
.qnav-grid button {
  padding: 6px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  font-size: 0.8rem;
}
.qnav-grid button.answered { background: var(--sky-light); }
.qnav-grid button.flagged { border-color: #c47f00; }
.qnav-grid button.current { outline: 2px solid var(--teal); }

.score-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.score-summary .stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}
.score-summary .stat .num { font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.score-summary .stat .label { font-size: 0.78rem; color: #555; text-transform: uppercase; letter-spacing: 0.04em; }

.pass { color: var(--good); }
.fail { color: var(--danger); }

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 24px 20px 40px;
  font-size: 0.8rem;
  color: #667;
  background: linear-gradient(180deg, rgba(246,248,251,0), rgba(218,231,246,.82));
}

.site-footer strong { color: var(--navy); }

/* ---------- Misc ---------- */

.pill-select {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.pill-select button {
  border: 1px solid var(--border);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9rem;
}
.pill-select button.selected { background: var(--navy); color: #fff; border-color: var(--navy); }

.notice.danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #7a1a14;
}

/* ---------- Auth (login/signup) ---------- */

.auth-wrap {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 20px;
}

.auth-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: 0 18px 45px rgba(20, 42, 79, .12);
}

.auth-card h1 { margin-top: 0; color: var(--navy); font-size: 1.4rem; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus { outline: 2px solid var(--sky); border-color: var(--sky); }

.auth-card .btn { width: 100%; margin-top: 6px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.9rem; }
.checkbox-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 9px;
}
.checkbox-field input { width: auto; margin-top: 3px; }
.checkbox-field label { font-weight: 400; line-height: 1.45; }
.account-danger-zone {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.account-danger-zone h2 { margin-top: 0; font-size: 1.05rem; }
.legal-page { max-width: 820px; }
.legal-page h2 { margin-top: 30px; }
.legal-page li { margin: 8px 0; }
.sg-legal-links { margin-top: 8px; }

.notice {
  background: var(--sky-light);
  border: 1px solid var(--sky);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  margin: 14px 0;
}

.locked-card {
  position: relative;
  border-color: #c9d4e7;
  background: linear-gradient(145deg, #f7f9fc, #eef2f8);
}
.locked-card::after {
  content: "PRO";
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #142a4f;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.sales-strip {
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid #f0b64d;
  border-radius: 12px;
  background: linear-gradient(120deg, #fff7df, #fff);
  color: #3f3218;
}
.upgrade-page, .pay-page {
  width: min(1120px, calc(100% - 32px));
  margin: 36px auto 70px;
}
.upgrade-hero {
  padding: clamp(36px, 7vw, 82px);
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 15%, rgba(56, 153, 255, .35), transparent 30%),
    linear-gradient(135deg, #091a37, #173f73);
  color: #fff;
  box-shadow: 0 24px 65px rgba(10, 31, 64, .2);
}
.upgrade-hero h1 {
  max-width: 850px;
  margin: 10px 0 18px;
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.05;
}
.upgrade-lead { max-width: 760px; font-size: 1.2rem; color: #dceaff; }
.eyebrow { font-weight: 800; letter-spacing: .14em; color: #61b1ff; }
.price-lockup { display: flex; align-items: baseline; gap: 12px; margin: 24px 0; }
.price { font-size: 2.6rem; font-weight: 850; }
.upgrade-cta { background: #f5a623; border-color: #f5a623; color: #13213a; }
.small-note { font-size: .84rem; opacity: .8; }
.upgrade-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 28px 0;
}
.upgrade-benefits article, .upgrade-story, .upgrade-final, .pay-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(20, 42, 79, .08);
}
.benefit-number { font-size: 2.5rem; font-weight: 850; color: #176fc1; }
.upgrade-story { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin: 28px 0; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding: 9px 0 9px 30px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: #16834a; font-weight: 900; }
.check-list.compact { margin: 24px 0; }
.upgrade-final { text-align: center; }
.upgrade-final .btn-row { justify-content: center; }
.pay-page { max-width: 720px; }
.pay-card { padding: clamp(28px, 6vw, 56px); }

.offer-logo {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(12, 28, 56, 0.1);
  margin-bottom: 14px;
  padding: 8px 16px;
}

.offer-logo:hover {
  box-shadow: 0 8px 24px rgba(12, 28, 56, 0.16);
  text-decoration: none;
}

.offer-logo img {
  display: block;
  height: 52px;
  width: auto;
}
.public-offer {
  max-width: 760px;
  margin: 0 auto 56px;
  padding: clamp(24px, 5vw, 44px);
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(20, 42, 79, .12);
}
.public-offer h2 { margin-top: 0; }

@media (max-width: 700px) {
  body {
    background-attachment: scroll;
    background-size: 100% 100%, 240px 166px;
  }
}
@media (max-width: 760px) {
  .upgrade-benefits, .upgrade-story { grid-template-columns: 1fr; }
}
