/* ============================================================
   KASHIO ACADEMY — main.css
   Variables, reset, layout shell, sidebar, topbar, login
   ============================================================ */

:root {
  --accent:        #0E97D9;
  --accent-light:  #38BDF8;
  --accent-dark:   #0B7CB4;
  --success:       #16A34A;
  --warning:       #F59E0B;
  --danger:        #DC2626;
  --sidebar-bg:    #0B2239;
  --sidebar-text:  #E6F0F8;
  --main-bg:       #EDF2F7;
  --card-bg:       #ffffff;
  --text-primary:  #13202E;
  --text-secondary:#56697C;
  --border:        #E2E9F0;
  --radius:        13px;
  --shadow:        0 2px 10px rgba(11,34,57,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--main-bg);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ── */
#sidebar {
  width: 292px; min-width: 292px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto; z-index: 100;
}

/* Sidebar Logo */
#sidebar-logo {
  padding: 22px 22px 16px;
  display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid #17324C;
}
.sidebar-k-badge {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.sidebar-brand-text { line-height: 1; }
.sidebar-brand-name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: 16px; color: #E6F0F8;
}
.sidebar-brand-sub {
  font-size: 10px; letter-spacing: 2.5px; color: #6B89A5;
  text-transform: uppercase; margin-top: 2px;
}

/* Progress */
#progress-wrap {
  padding: 14px 22px 18px;
  border-bottom: 1px solid #17324C;
}
#progress-label {
  font-size: 12px; font-weight: 600; color: #A9CDE6;
  letter-spacing: .3px; margin-bottom: 9px;
  display: flex; justify-content: space-between; align-items: center;
}
#progress-pct { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 700; color: var(--accent-light); }
#progress-bar-bg { background: #081A2D; border-radius: 99px; height: 8px; overflow: hidden; }
#progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  height: 8px; border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}
#progress-sub { font-size: 11.5px; color: #5A7C97; margin-top: 8px; }

/* Nav */
#sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }

.module-group { margin-bottom: 4px; }
.module-header {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 10px;
  cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: #C9DDEC; transition: background 0.15s; user-select: none;
}
.module-header:hover { background: #12314D; }
.module-header.open { background: #12314D; }
.module-header .mod-icon { color: #7FB9DE; flex-shrink: 0; }
.module-header .mod-info { flex: 1; min-width: 0; }
.module-header .mod-title { font-size: 13.5px; font-weight: 600; color: #C9DDEC; }
.module-header .mod-count { font-size: 11px; color: #5A7C97; margin-top: 1px; }
.module-header .mod-check { color: #22C55E; flex-shrink: 0; }
.module-header .arrow { font-size: 11px; color: #4F7090; transition: transform 0.2s; flex-shrink: 0; }
.module-header.open .arrow { transform: rotate(180deg); }

/* Active module group */
.module-group.active-module > .module-header { background: #12314D; }
.module-group-inner {
  background: #12314D; border-radius: 11px; padding: 4px;
  margin: 4px 0 6px; border-left: 3px solid var(--accent);
}
.module-group-inner .module-header {
  border-radius: 9px; background: transparent;
}
.module-group-inner .module-header:hover { background: rgba(255,255,255,.05); }
.module-group-inner .module-header .mod-icon { color: var(--accent-light); }
.module-group-inner .module-header .mod-title { color: #fff; }
.module-group-inner .module-header .mod-count { color: #7FB9DE; }

.module-lessons { display: none; padding: 2px 4px 6px; }
.module-lessons.open { display: block; }

.lesson-link {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 9px 6px 30px;
  font-size: 12.5px; color: #6E92AE;
  cursor: pointer; transition: color 0.15s; border-left: none;
  border-radius: 8px;
}
.lesson-link:hover { background: rgba(255,255,255,.04); color: #A9CDE6; }
.lesson-link.active {
  background: var(--accent); color: #fff;
  border-radius: 8px; font-weight: 700;
  padding-left: 26px;
}
.lesson-link.active .check { color: #fff; }
.lesson-link.done .check { color: #22C55E; }
.lesson-link .check { font-size: 11px; margin-left: auto; color: transparent; flex-shrink: 0; }
.lesson-link .ll-duration { font-size: 10px; color: rgba(168,179,207,.5); margin-left: auto; white-space: nowrap; }
.lesson-link.active .ll-duration { color: rgba(255,255,255,.6); }


#logout-btn {
  margin: 12px 18px 20px;
  padding: 9px 8px; border-radius: 9px;
  border: none; background: transparent;
  color: #8AAAC6; font-family: 'Inter', sans-serif;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; width: calc(100% - 36px);
  text-align: left; transition: all 0.15s;
  display: flex; align-items: center; gap: 10px;
}
#logout-btn:hover { background: #12314D; color: #fff; }

/* ── MAIN ── */
#main { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── TOPBAR ── */
#topbar {
  height: 66px; background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 30px; gap: 20px;
  flex-shrink: 0; position: relative; z-index: 50;
}
#breadcrumb {
  font-size: 13.5px; color: #7A8DA0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
  display: flex; align-items: center; gap: 6px;
}
#breadcrumb .bc-sep { color: #C2D0DD; }
#breadcrumb .bc-current { color: var(--text-primary); font-weight: 600; }

#topbar-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }

#search-wrap { position: relative; flex-shrink: 0; }
#search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #92A4B5; pointer-events: none; }
#search-input {
  width: 240px; height: 42px;
  padding: 0 14px 0 40px;
  border: 1.5px solid var(--border); border-radius: 11px;
  background: #FAFBFC; font-family: inherit; font-size: 14px;
  color: var(--text-primary); outline: none; transition: border-color 0.2s;
}
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(14,151,217,.1); }
#search-dropdown {
  display: none; position: absolute; top: 48px; left: 0; right: 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(11,34,57,.12);
  max-height: 320px; overflow-y: auto; z-index: 200;
}
.search-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #f1f5f9; }
.search-item-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.search-item-snippet { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.search-item-snippet mark { background: #fef08a; padding: 0 2px; border-radius: 2px; }

#user-avatar-wrap { display: flex; align-items: center; gap: 10px; }
#user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 15px; flex-shrink: 0;
}
#user-name { font-size: 13.5px; font-weight: 700; line-height: 1.1; }
#user-role { font-size: 11.5px; color: #7A8DA0; }

/* ── CONTENT AREA ── */
#content-area { flex: 1; overflow-y: auto; padding: 34px 36px 40px; scroll-behavior: smooth; }
#lesson-content { max-width: 860px; margin: 0 auto; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Loading state */
#lesson-loading {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 0; gap: 16px; color: var(--text-secondary);
}
#lesson-loading.show { display: flex; }
.loading-spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BOTTOM NAV ── */
#bottom-nav {
  height: 76px; background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 32px; flex-shrink: 0;
}
#bottom-nav-label { font-size: 13px; color: #7A8DA0; }
#bottom-nav-label strong { color: var(--text-primary); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 11px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; border: none; transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 20px rgba(14,151,217,.3);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline {
  background: #fff; color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: #C2D0DD; background: #FAFBFC; color: var(--text-primary); }
.btn-outline-accent {
  background: #fff; color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline-accent:hover { background: #E6F4FC; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-success { background: var(--success); color: #fff; }
#complete-btn.completed { background: var(--success); color: #fff; border-color: var(--success); }

/* ── TEXT ── */
h2 { font-family: 'Space Grotesk', sans-serif; font-size: 19px; font-weight: 700; color: var(--text-primary); margin: 28px 0 14px; }
h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 20px 0 10px; }
p  { font-size: 15px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 12px; }

/* ── LESSON HEADER ── */
.lesson-header { margin-bottom: 28px; }
.lesson-tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
  margin-bottom: 12px; letter-spacing: .5px; text-transform: uppercase;
}
.tag-basico     { background: #EAF2FE; color: #2563EB; }
.tag-intermedio { background: #FEF4E2; color: #B45309; }
.tag-avanzado   { background: #FFEAE0; color: #C2410C; }
.tag-incidencias{ background: #fef3c7; color: #92400e; }
.tag-glosario   { background: #E7F6EC; color: #15803D; }
.tag-quiz       { background: #EEEBFE; color: #6D28D9; }

.lesson-title   { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; color: var(--text-primary); line-height: 1.18; letter-spacing: -.6px; }
.lesson-subtitle{ font-size: 15px; color: var(--text-secondary); margin-top: 6px; }

.lesson-meta {
  display: flex; align-items: center; gap: 18px;
  font-size: 13px; color: #7A8DA0; margin: 12px 0 24px;
}
.lesson-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.lesson-duration  { font-size: 12px; color: var(--text-secondary); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #C2D2E0; border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #A0B8C8; background-clip: content-box; border: 2px solid transparent; }

/* ── LOGIN ── */
#login-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; min-height: 100vh;
  background: #fff;
}

/* Brand panel */
#login-brand {
  flex: 0 0 48%; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #08203A 0%, #0E456E 52%, #0E97D9 135%);
  color: #E6F0F8;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 52px 50px;
}
.login-brand-blob {
  position: absolute; border-radius: 50%;
  filter: blur(70px); pointer-events: none;
  animation: blobDrift 9s ease-in-out infinite;
}
.login-brand-blob1 {
  width: 300px; height: 300px;
  background: rgba(56,189,248,.18);
  top: -40px; right: -30px;
}
.login-brand-blob2 {
  width: 240px; height: 240px;
  background: rgba(14,151,217,.16);
  bottom: 30px; left: -50px;
  animation-duration: 11s;
  animation-direction: reverse;
}
@keyframes blobDrift {
  0%,100% { transform: translate(0,0); }
  50%      { transform: translate(14px,-12px); }
}

.login-brand-logo {
  display: flex; align-items: center; gap: 12px;
  position: relative; animation: fadeUp .6s ease-out both;
}
.login-k-badge {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  color: #fff; font-size: 23px;
  box-shadow: 0 8px 24px rgba(14,151,217,.45);
}
.login-brand-name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 21px; line-height: 1;
}
.login-brand-sub {
  font-size: 12px; letter-spacing: 3px; color: #7FC4EC;
  text-transform: uppercase; margin-top: 3px;
}

.login-brand-body { position: relative; }
.login-brand-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .5px;
  background: rgba(124,58,237,.24); color: #CBB6FB;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid rgba(124,58,237,.4);
  margin-bottom: 22px;
  animation: fadeUp .6s .05s ease-out both;
}
.login-brand-pill-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #A78BFA;
}
.login-brand-h1 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 36px; line-height: 1.18; margin: 0 0 28px;
  letter-spacing: -.5px;
  animation: fadeUp .6s .1s ease-out both;
}

/* Animated payment flow */
.login-flow { animation: fadeUp .6s .2s ease-out both; }
.login-flow-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: #7FC4EC; margin-bottom: 16px;
}
.login-flow-track {
  position: relative; display: flex; align-items: center;
  justify-content: space-between; max-width: 380px;
}
.login-flow-line {
  position: absolute; left: 9%; right: 9%; top: 24px; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(127,196,236,.5) 0 6px, transparent 6px 12px);
}
.login-flow-dot {
  position: absolute; top: 18px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #38BDF8; box-shadow: 0 0 14px 3px rgba(56,189,248,.8);
  animation: travelDot 3.4s ease-in-out infinite;
}
@keyframes travelDot {
  0%   { left: 8%; }
  8%   { transform: scale(1.4); }
  44%  { left: 46.5%; }
  54%  { left: 46.5%; }
  90%  { left: 85%; }
  100% { left: 85%; transform: scale(1); }
}
.login-flow-node {
  position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 9px; width: 80px;
}
.login-flow-node span {
  font-size: 12px; color: #A9CDE6; font-weight: 600;
}
.login-flow-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  color: #CFE6F5;
}
.login-flow-node-center .login-flow-k {
  width: 54px; height: 54px; border-radius: 16px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  color: #fff; font-size: 24px;
  box-shadow: 0 10px 26px rgba(14,151,217,.5);
  animation: floatY 3.4s ease-in-out infinite;
}
@keyframes floatY {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
.login-flow-node-center span { color: #fff; font-weight: 700; }

.login-brand-footer {
  position: relative; font-size: 13px; color: #5A7C97;
  animation: fadeUp .6s .3s ease-out both;
}

/* Form panel */
#login-form-panel {
  flex: 1; display: flex; align-items: center;
  justify-content: center; padding: 40px;
  background: #fff;
}
#login-card {
  width: 100%; max-width: 380px;
  animation: fadeUp .6s .15s ease-out both;
}
.login-form-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 28px; letter-spacing: -.4px; margin: 0 0 8px;
  color: var(--text-primary);
}
.login-form-sub {
  font-size: 15px; color: #56697C; margin: 0 0 32px;
  line-height: 1.5;
}

.login-field { margin-bottom: 18px; }
.login-field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 7px;
}
.login-input-wrap {
  display: flex; align-items: center; gap: 11px;
  border: 1.5px solid var(--border); border-radius: 11px;
  padding: 0 14px; height: 50px;
  background: #FAFBFC; color: #92A4B5;
  transition: border-color .2s, box-shadow .2s;
}
.login-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(14,151,217,.1);
  background: #fff;
}
.login-input-wrap svg { flex-shrink: 0; }
.login-input-wrap input {
  border: none; outline: none; background: transparent;
  flex: 1; font-family: 'Inter', sans-serif;
  font-size: 15px; color: var(--text-primary);
}
.pw-toggle {
  flex-shrink: 0; background: none; border: none; padding: 4px; margin: 0;
  cursor: pointer; color: #92A4B5; display: flex; align-items: center;
}
.pw-toggle:hover { color: var(--accent); }
.pw-toggle .pw-icon-off { display: none; }
.pw-toggle.showing .pw-icon-on { display: none; }
.pw-toggle.showing .pw-icon-off { display: block; }
.login-btn {
  width: 100%; height: 52px; border: none; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 16px;
  cursor: pointer; transition: background .15s;
  box-shadow: 0 10px 24px rgba(14,151,217,.36);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 6px;
}
.login-btn:hover { background: var(--accent-dark); }
.login-error {
  color: var(--danger); font-size: 13px; text-align: center; margin-top: 14px;
  background: rgba(220,38,38,.06); border: 1px solid rgba(220,38,38,.2);
  border-radius: 8px; padding: 10px 14px; display: none;
}
.login-error.show { display: block; }

.login-n1-hint {
  display: flex; align-items: center; gap: 11px;
  margin-top: 28px; padding: 14px 15px;
  background: #F3EEFE; border: 1px solid #DCC9FB; border-radius: 11px;
}
.login-n1-badge {
  width: 30px; height: 30px; border-radius: 8px;
  background: #7C3AED; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.login-n1-text { font-size: 12.5px; color: #574785; line-height: 1.45; }

.login-footer { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-secondary); }

/* ── HOME SCREEN ── */
#home-screen { display: none; animation: fadeUp 0.3s ease; }
#home-screen.active { display: block; }

.home-greeting { margin-bottom: 30px; }
.home-greeting-eyebrow {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 8px; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; color: var(--accent);
  text-transform: uppercase;
}
.home-greeting h1 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 34px; letter-spacing: -.7px; margin: 0;
}
.home-greeting-sub { font-size: 15.5px; color: #56697C; margin: 8px 0 0; }
.home-greeting-sub strong { color: var(--accent); }

.home-stats { display: flex; gap: 12px; }
.home-stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 18px;
  text-align: center; min-width: 96px;
  box-shadow: 0 2px 8px rgba(11,34,57,.05);
}
.home-stat-num {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 24px; color: var(--accent);
}
.home-stat-num.dark { color: var(--text-primary); }
.home-stat-num small { font-size: 16px; color: #B6C4D2; }
.home-stat-label { font-size: 11.5px; color: #7A8DA0; margin-top: 2px; }

.home-greeting-row {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 24px; margin-bottom: 30px;
}

/* Continue strip */
.home-continue-strip {
  position: relative; overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 16px; padding: 22px 26px;
  display: flex; align-items: center; gap: 22px;
  box-shadow: 0 6px 20px rgba(11,34,57,.07);
  margin-bottom: 46px;
  animation: fadeUp .6s .08s ease-out both;
}
.home-continue-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: #E6F4FC; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.home-continue-content { flex: 1; min-width: 0; }
.home-continue-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--accent); margin-bottom: 5px;
  text-transform: uppercase;
}
.home-continue-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 19px; margin-bottom: 9px; color: var(--text-primary);
}
.home-continue-progress { display: flex; align-items: center; gap: 12px; max-width: 420px; }
.home-continue-bar-bg { flex: 1; height: 7px; background: #EAF0F5; border-radius: 99px; overflow: hidden; }
.home-continue-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 99px; transition: width .4s; }
.home-continue-count { font-size: 12.5px; font-weight: 700; color: #56697C; white-space: nowrap; }

/* Roadmap */
.home-roadmap-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; }
.home-roadmap-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--accent); margin-bottom: 4px; text-transform: uppercase;
}
.home-roadmap-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 22px; letter-spacing: -.3px; color: var(--text-primary);
  margin: 0;
}

.home-roadmap { position: relative; padding-left: 4px; }
.home-roadmap-line {
  position: absolute; left: 24px; top: 34px; bottom: 60px;
  width: 2px;
  background: repeating-linear-gradient(180deg, #C7D6E4 0 7px, transparent 7px 14px);
}

.home-mod-row {
  position: relative; display: flex; gap: 22px;
  margin-bottom: 18px; animation: fadeUp .55s ease-out both;
}
.home-mod-bullet {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1;
  box-shadow: 0 0 0 5px var(--main-bg);
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px;
}
.home-mod-bullet.done { background: var(--accent); color: #fff; }
.home-mod-bullet.active { background: var(--card-bg); border: 2px solid var(--accent); color: var(--accent); }
.home-mod-bullet.locked { background: #E6EDF4; color: #9CB0C4; }

.home-mod-card {
  flex: 1; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 22px; display: flex; align-items: center; gap: 18px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.home-mod-card:hover { transform: translateX(4px); box-shadow: 0 10px 24px rgba(11,34,57,.1); }
.home-mod-card.active-card { border: 1.5px solid var(--accent); box-shadow: 0 8px 22px rgba(14,151,217,.14); }

.home-mod-card-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 22px;
}
.home-mod-card-body { flex: 1; min-width: 0; }
.home-mod-card-header { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.home-mod-badge {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 12px; padding: 2px 8px; border-radius: 6px;
}
.home-mod-badge.done { background: #E6F4FC; color: var(--accent); }
.home-mod-badge.active { background: #E6F4FC; color: var(--accent); }
.home-mod-badge.locked { background: #EEF3F7; color: #9CB0C4; }

.home-mod-title { font-size: 15.5px; font-weight: 700; color: var(--text-primary); margin: 0; }
.home-mod-progress { display: flex; align-items: center; gap: 11px; }
.home-mod-bar-bg { width: 130px; height: 6px; background: #EAF0F5; border-radius: 99px; overflow: hidden; }
.home-mod-bar { height: 100%; border-radius: 99px; transition: width .4s; }
.home-mod-bar.done  { background: var(--success); }
.home-mod-bar.active { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.home-mod-count { font-size: 12px; color: #7A8DA0; }

.home-mod-card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.home-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  padding: 4px 9px; border-radius: 7px;
}
.home-status-badge.done    { background: #E7F6EC; color: #15803D; }
.home-status-badge.active  { background: #FEF4E2; color: #B45309; }
.home-status-badge.locked  { background: #EEF1F4; color: #64748B; }
.home-status-dot { width: 6px; height: 6px; border-radius: 50%; animation: blinkDot 1.6s infinite; }
@keyframes blinkDot { 0%,100%{opacity:1} 50%{opacity:.3} }

.home-level-badge {
  display: inline-flex; padding: 2px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
}
.home-level-basic    { background: #E7F6EC; color: #15803D; }
.home-level-inter    { background: #FEF4E2; color: #B45309; }
.home-level-advanced { background: #FFEAE0; color: #C2410C; }
.home-level-glossary { background: #EEF1F4; color: #475569; }

/* Cert goal row */
.home-cert-row {
  position: relative; display: flex; gap: 22px;
  animation: fadeUp .55s .5s ease-out both;
}
.home-cert-bullet {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--card-bg); border: 2px dashed #C7D6E4;
  color: #9CB0C4; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1; box-shadow: 0 0 0 5px var(--main-bg);
}
.home-cert-text {
  display: flex; align-items: center;
  padding: 8px 4px; color: #7A8DA0; font-size: 14px; font-weight: 600;
}
.home-cert-text strong { color: var(--text-primary); margin-left: 4px; }

/* Legacy grid (used as fallback) */
.home-hero { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); border-radius: var(--radius); padding: 36px 40px; color: #fff; margin-bottom: 28px; }
.home-hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.home-hero p  { font-size: 15px; opacity: 0.88; margin: 0; }
.home-hero-meta { display: flex; gap: 20px; margin-top: 18px; }
.home-hero-stat { text-align: center; }
.home-hero-stat .stat-num { font-size: 28px; font-weight: 800; }
.home-hero-stat .stat-label { font-size: 12px; opacity: 0.8; }
.home-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 14px; }
.home-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 28px; }
.home-mod-card.legacy { padding: 20px; cursor: pointer; }
.home-cta { display: flex; gap: 12px; margin-bottom: 12px; }

/* ── TOUR OVERLAY ── */
#tour-overlay { display: none; position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
#tour-overlay.active { display: block; }
.tour-highlight {
  position: fixed; border-radius: 10px;
  box-shadow: 0 0 0 2px var(--accent-light), 0 0 0 9999px rgba(5,18,32,.55);
  pointer-events: none; transition: all 0.3s ease; z-index: 9001;
}
.tour-card {
  position: fixed; background: #fff; border-radius: 16px; padding: 21px 22px;
  box-shadow: 0 22px 60px rgba(0,0,0,.3); max-width: 312px; z-index: 9002;
  pointer-events: all; animation: fadeUp 0.2s ease;
}
.tour-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.tour-step-pill {
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  color: var(--accent); background: #E6F4FC;
  padding: 4px 10px; border-radius: 999px;
}
.tour-close { color: #9CB0C4; cursor: pointer; display: flex; }
.tour-close:hover { color: var(--text-primary); }
.tour-card h4 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px; margin: 0 0 7px; }
.tour-card p  { font-size: 14px; color: var(--text-secondary); margin: 0 0 18px; line-height: 1.55; }
.tour-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.tour-dot.active { background: var(--accent); }
.tour-skip { font-size: 13px; font-weight: 600; color: #7A8DA0; cursor: pointer; }
.tour-skip:hover { color: var(--text-primary); }

/* ── HELP BUTTON ── */
#help-btn {
  position: fixed; bottom: 96px; right: 28px;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  cursor: pointer; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  animation: pulseRing 2.6s infinite;
}
@keyframes pulseRing {
  0%   { box-shadow: 0 8px 22px rgba(14,151,217,.4), 0 0 0 0 rgba(14,151,217,.5); }
  70%  { box-shadow: 0 8px 22px rgba(14,151,217,.4), 0 0 0 16px rgba(14,151,217,0); }
  100% { box-shadow: 0 8px 22px rgba(14,151,217,.4), 0 0 0 0 rgba(14,151,217,0); }
}

/* ── LESSON NAV CONTEXT ── */
.lesson-nav-context {
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-secondary);
  margin-bottom: 16px; padding: 10px 16px; background: #f8fafc;
  border-radius: 8px; border: 1px solid var(--border);
}
.lesson-nav-context .lnc-sep { color: var(--border); }

/* ── CERTIFICATE MODAL ── */
#cert-modal {
  display: none; position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,0.6); align-items: center; justify-content: center;
}
#cert-modal.show { display: flex; }
.cert-wrap { position: relative; animation: fadeUp 0.3s ease; }
.cert-close-btn {
  position: absolute; top: -14px; right: -14px; width: 32px; height: 32px;
  border-radius: 50%; background: #fff; border: none; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#cert-canvas { display: block; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.cert-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

/* ── SIDEBAR MODULE PROGRESS (legacy) ── */
.mod-progress-wrap { display: flex; align-items: center; gap: 8px; padding: 0 20px 8px; }
.mod-progress-bar-bg { flex: 1; background: rgba(255,255,255,0.1); border-radius: 4px; height: 4px; }
.mod-progress-bar-fill { background: var(--accent); height: 4px; border-radius: 4px; transition: width 0.4s; }
.mod-progress-label { font-size: 10px; color: var(--sidebar-text); white-space: nowrap; min-width: 28px; text-align: right; }

/* ── SEARCH HIGHLIGHT ── */
mark { background: #fef08a; padding: 0 2px; border-radius: 2px; }

@media (max-width: 1100px) {
  #sidebar { width: 240px; min-width: 240px; }
  #content-area { padding: 20px 24px; }
}
@media (max-width: 900px) {
  #login-brand { display: none; }
  #login-form-panel { flex: 1; }
}
