/* ------------------------------------------------------------------
   Riffs Yoga & Wellness — Staff Training
   Visual language matched to the Riffs Front Desk Console.
   Brand colors:
     Ocean Blue  #0A273F    Blue       #9CBFDC   Sky Blue   #E1F0F9
     Orange      #EFA016    Sunshine   #FEC016
     Light Beige #FFFAEF    Sand       #DCC59F   White      #FFFFFF
   Fonts: P22 Mackinac Pro (title), Soléa (header), Hamburg Hand (script),
          Heebo (body, Google Fonts)
   -------------------------------------------------------------------*/

@font-face {
  font-family: "Mackinac";
  src: url("/static/fonts/p22-mackinac-pro-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Solea";
  src: url("/static/fonts/solea-regular-webfont.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HamburgHand";
  src: url("/static/fonts/hamburghand-light-webfont.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --ocean: #0A273F;
  --blue: #9CBFDC;
  --sky: #E1F0F9;
  --orange: #EFA016;
  --sunshine: #FEC016;
  --beige: #FFFAEF;
  --sand: #DCC59F;
  --ink: #13243a;
  --soft-ink: #3b4a5e;
  --line: rgba(10, 39, 63, 0.12);
  --ok: #3a8a5e;
  --ok-bg: #e9f5ee;
  --bad: #b84444;
  --bad-bg: #fbeaea;
  --shadow-card: 0 20px 60px -20px rgba(10, 39, 63, 0.22);
  --font-title: "Mackinac", "Playfair Display", Georgia, serif;
  --font-header: "Solea", "Mackinac", Georgia, serif;
  --font-script: "HamburgHand", "Caveat", cursive;
  --font-body: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--beige);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.paper-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--beige) url("/static/textures/paper-beige.png") center / cover;
  opacity: 0.55;
  pointer-events: none;
}
.paper-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.35), transparent 55%),
              radial-gradient(ellipse at bottom right, rgba(254, 192, 22, 0.08), transparent 55%);
}

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--ocean);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
a { color: var(--ocean); }

.script {
  font-family: var(--font-script);
  color: var(--orange);
  letter-spacing: 0.02em;
  line-height: 1;
}

/* ------------------------------------------------------------------
   TOP BAR — transparent over paper, centered logo (console style)
   ------------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px 6px;
  position: relative;
  min-height: 92px;
}
.topbar .logo-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 16px;
  line-height: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 4px 8px;
}
.topbar .logo-primary {
  height: 72px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 0 rgba(10,39,63,0.02));
}
.topbar .who {
  font-size: 0.9rem;
  color: var(--soft-ink);
}
.topbar .row { margin-left: auto; }

/* ------------------------------------------------------------------
   LAYOUT
   ------------------------------------------------------------------ */
.wrap { max-width: 860px; margin: 0 auto; padding: 18px 18px 90px; }
.wrap.wide { max-width: 1100px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  padding: 26px 28px;
  margin-bottom: 18px;
}

/* ------------------------------------------------------------------
   BUTTONS — pill style
   ------------------------------------------------------------------ */
button, .btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  background: var(--ocean);
  color: var(--beige);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
button:hover { background: #0e3559; }
button:active { transform: scale(0.98); }
button.gold { background: var(--sunshine); color: var(--ocean); }
button.gold:hover { background: var(--orange); color: #fff; }
button.ghost {
  background: transparent;
  color: var(--ocean);
  border: 1px solid var(--line);
}
button.ghost:hover { background: var(--ocean); color: var(--beige); border-color: var(--ocean); }
button.danger { background: transparent; border: 1px solid var(--line); color: var(--bad); }
button.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
button.small { padding: 7px 14px; font-size: 0.84rem; }
button:disabled { opacity: 0.45; cursor: default; }

input, select, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  outline: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--ocean); }
input::placeholder, textarea::placeholder { color: #98a4b5; font-weight: 300; }
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft-ink);
  margin: 14px 0 5px;
}

.error { color: var(--bad); font-size: 0.9rem; margin-top: 10px; min-height: 18px; }
.notice {
  background: var(--sky);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--ocean);
  margin: 10px 0;
}
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.88rem; background: var(--sky); padding: 2px 8px; border-radius: 6px; }
.muted { color: var(--soft-ink); font-size: 0.88rem; opacity: 0.85; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------
   LOGIN — console staff-gate style
   ------------------------------------------------------------------ */
.admin-corner {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 10;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ocean);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  padding: 9px 16px;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.admin-corner:hover { background: var(--ocean); color: var(--beige); border-color: var(--ocean); }
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  padding: 40px 36px 34px;
  text-align: center;
}
.login-card .gate-logo {
  width: 200px;
  max-width: 72%;
  margin: 0 auto 12px;
  display: block;
}
.login-card .script { font-size: 1.6rem; margin: 0 0 4px; }
.login-card h2 {
  font-size: 1.7rem;
  margin: 0 0 8px;
}
.login-card .gate-sub {
  color: var(--soft-ink);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 14px;
}
.login-card form { text-align: left; }
.login-card button { width: 100%; justify-content: center; margin-top: 20px; }

/* ------------------------------------------------------------------
   WELCOME / COURSE
   ------------------------------------------------------------------ */
.course-script { font-size: 2rem; margin: 14px 0 2px; text-align: center; }
.course-title { text-align: center; font-size: clamp(2rem, 4.5vw, 2.9rem); margin: 0 0 20px; }

.video-frame {
  position: relative;
  padding-top: 56.25%;
  border-radius: 22px;
  overflow: hidden;
  background: var(--ocean);
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--blue);
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.video-placeholder img { width: 150px; opacity: 0.9; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 26px 0 4px;
}
.section-head h2 { margin: 0; font-size: 1.6rem; }

.progress-track {
  height: 10px;
  background: rgba(10, 39, 63, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 20px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sunshine), var(--orange));
  border-radius: 999px;
  transition: width 0.4s;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: all 0.18s ease;
}
.lesson-item[style*="cursor"]:hover { border-color: var(--ocean); transform: translateY(-1px); box-shadow: 0 8px 24px -12px rgba(10,39,63,0.25); }
.lesson-item.locked { opacity: 0.5; }
.lesson-num {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 0.95rem;
  background: var(--sky);
  color: var(--ocean);
}
.lesson-item.completed .lesson-num { background: var(--sunshine); }
.lesson-title { font-weight: 400; font-size: 1.02rem; color: var(--ink); }
.state-chip {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.state-chip.completed { background: var(--ok-bg); color: var(--ok); }
.state-chip.available { background: var(--sky); color: var(--ocean); }
.state-chip.reread { background: #fdf1d7; color: #8a6100; }
.state-chip.locked { background: rgba(10,39,63,0.06); color: var(--soft-ink); }

/* ------------------------------------------------------------------
   LESSON CONTENT
   ------------------------------------------------------------------ */
.lesson-content { font-size: 1.05rem; line-height: 1.65; }
.lesson-content p { margin: 0 0 14px; }
.lesson-content ul, .lesson-content ol { margin: 0 0 14px; padding-left: 24px; }
.lesson-content li { margin-bottom: 6px; }
.lesson-content strong { font-weight: 600; color: var(--ocean); }
.lesson-content h3, .lesson-content h4 {
  font-family: var(--font-header);
  margin: 22px 0 8px;
  font-size: 1.25rem;
}

/* ------------------------------------------------------------------
   QUIZ — console quiz-choice style with letter circles
   ------------------------------------------------------------------ */
.quiz-head { text-align: center; margin-bottom: 24px; }
.quiz-head .mini-mark { width: 46px; margin: 0 auto 8px; display: block; opacity: 0.9; }
.quiz-head h1 { margin: 0; font-size: 1.9rem; }
.quiz-head .script { font-size: 1.35rem; margin: 6px 0 0; display: block; }

.q-block { margin-bottom: 26px; }
.q-text {
  font-weight: 400;
  font-size: 1.12rem;
  color: var(--ocean);
  margin-bottom: 12px;
}
.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
  font-size: 0.98rem;
  transition: all 0.18s ease;
}
.opt:hover { border-color: var(--ocean); transform: translateY(-1px); }
.opt.sel { border-color: var(--ocean); background: var(--sky); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); color: #1f5a3c; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); color: #7a2626; }
.opt .letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--sky);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--ocean);
  flex-shrink: 0;
  margin-top: 1px;
}
.opt.sel .letter { background: var(--ocean); color: #fff; }
.opt.right .letter { background: var(--ok); color: #fff; }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.explain {
  margin: 6px 2px 0;
  padding: 12px 16px;
  background: var(--sky);
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ocean);
}

.score-banner { text-align: center; padding: 30px 18px; }
.score-banner .big {
  font-size: 3.2rem;
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--ocean);
}
.score-banner.pass .big { color: var(--ok); }
.score-banner.fail .big { color: var(--bad); }
.score-banner .script { font-size: 1.7rem; display: block; margin-bottom: 4px; }
.score-banner h2 { margin: 4px 0 8px; }

/* ------------------------------------------------------------------
   ADMIN
   ------------------------------------------------------------------ */
.tabs { display: flex; gap: 8px; margin: 4px 0 22px; flex-wrap: wrap; justify-content: center; }
.tabs button {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ocean);
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 18px;
}
.tabs button:hover { background: var(--ocean); color: var(--beige); border-color: var(--ocean); }
.tabs button.active { background: var(--ocean); color: var(--beige); border-color: var(--ocean); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-weight: 500;
  color: var(--soft-ink);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.on { background: var(--ok); }
.dot.off { background: #ccc; }
.cell-done { color: var(--ok); font-weight: 600; }
.cell-todo { color: var(--sand); }

.src-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sky);
  color: var(--ocean);
}
.badge.warn { background: #fdf1d7; color: #8a6100; }
.badge.err { background: var(--bad-bg); color: var(--bad); }

details { margin-bottom: 8px; }
details > summary { cursor: pointer; padding: 8px 0; color: var(--ocean); }
.q-admin {
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 8px 0;
  font-size: 0.92rem;
}
.q-admin .correct { color: var(--ok); font-weight: 500; }

@media (max-width: 720px) {
  .topbar { padding: 16px 16px 4px; min-height: 76px; }
  .topbar .logo-primary { height: 54px; }
  .card { padding: 18px; border-radius: 18px; }
  .wrap { padding: 12px 12px 70px; }
}
