:root{
  --bg: #0b0e14;
  --bg-panel: #11151f;
  --bg-card: #161b28;
  --border: #242b3d;
  --text: #e7eaf2;
  --text-dim: #8d96ab;
  --accent: #7c6cff;
  --accent-dim: #5a4fd1;
  --accent-soft: rgba(124,108,255,0.14);
  --good: #3ecf8e;
  --warn: #f0b84f;
  --danger: #ef5a6c;
  --radius: 14px;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg);
  color:var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height:1.5;
}
a{color:var(--accent);}
h1,h2,h3,h4{line-height:1.25; margin:0 0 .5em;}
.hidden{display:none !important;}

/* ---------- Topbar ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px; border-bottom:1px solid var(--border);
  background:var(--bg-panel); position:sticky; top:0; z-index:40;
  flex-wrap:wrap; row-gap:10px;
}
.topbar-left{display:flex; align-items:center; gap:12px; flex-wrap:wrap;}
.brand{display:flex; align-items:center; gap:10px; font-weight:700; font-size:18px;}
.brand .logo{font-size:22px;}
.topbar-actions{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.user-pill{font-size:13px; color:var(--text-dim); padding:6px 10px; border:1px solid var(--border); border-radius:999px;}

.lgst-back-link{
  display:flex; align-items:center; gap:6px; color:var(--text-dim);
  font-size:13px; font-weight:600; text-decoration:none; transition:color .15s;
}
.lgst-back-link svg{width:14px; height:14px; flex:0 0 14px; transition:transform .15s;}
.lgst-back-link:hover{color:var(--accent);}
.lgst-back-link:hover svg{transform:translateX(-2px);}
.topbar-divider{color:var(--border); font-size:16px; user-select:none;}
@media (max-width:560px){
  .topbar-divider{display:none;}
  .topbar-left{width:100%; justify-content:space-between;}
}

.lang-switch{display:flex; border:1px solid var(--border); border-radius:999px; overflow:hidden;}
.lang-btn{
  background:transparent; border:none; color:var(--text-dim); font-size:12px; font-weight:700;
  padding:6px 12px; cursor:pointer; transition:all .15s;
}
.lang-btn.active{background:var(--accent); color:#fff;}
.lang-btn:not(.active):hover{color:var(--text);}

/* ---------- Buttons / inputs ---------- */
.btn{
  background:var(--accent); color:#fff; border:none; border-radius:10px;
  padding:10px 16px; font-size:14px; font-weight:600; cursor:pointer;
  transition:background .15s; text-decoration:none; display:inline-block;
}
.btn:hover{background:var(--accent-dim);}
.btn.ghost{background:transparent; border:1px solid var(--border); color:var(--text);}
.btn.ghost:hover{border-color:var(--accent);}
.btn.small{padding:6px 10px; font-size:12px;}
.btn:disabled{opacity:.6; cursor:default;}
.text-input{
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--border);
  background:var(--bg-card); color:var(--text); font-size:14px; margin-bottom:10px;
}
.text-input:focus{outline:none; border-color:var(--accent);}

/* ---------- Hero / landing ---------- */
.hero{
  max-width:860px; margin:0 auto; padding:60px 20px 30px; text-align:center;
}
.hero h1{font-size:34px;}
.hero .tag{color:var(--text-dim); font-size:17px; max-width:620px; margin:14px auto 28px;}
.hero-cta{display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-bottom:10px;}
.hero-steps{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:14px;
  max-width:900px; margin:36px auto 0; text-align:left;
}
.hero-step{background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:16px;}
.hero-step .n{color:var(--accent); font-weight:700; font-size:13px;}
.hero-step h4{margin:6px 0 4px; font-size:15px;}
.hero-step p{color:var(--text-dim); font-size:13px; margin:0;}

/* ---------- Gate (login/register) card, used inline on landing ---------- */
.gate-card{
  max-width:360px; margin:28px auto 0; background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); padding:22px;
}
.gate-card h3{font-size:16px; margin-bottom:4px;}
.gate-card p.desc{color:var(--text-dim); font-size:13px; margin:0 0 14px;}
.gate-error{color:var(--danger); font-size:13px; min-height:18px; margin-top:4px;}
.gate-switch{margin:12px 0 0; font-size:13px; color:var(--text-dim); text-align:center;}
.gate-switch a{cursor:pointer; text-decoration:none;}
.gate-switch a:hover{text-decoration:underline;}

/* ---------- App layout ---------- */
.app-layout{display:flex; max-width:1200px; margin:0 auto; min-height:calc(100vh - 60px);}
.sidebar{
  width:280px; flex:0 0 280px; border-right:1px solid var(--border);
  padding:18px 10px; position:sticky; top:60px; height:calc(100vh - 60px); overflow-y:auto;
}
.progress-overall{padding:8px 10px 16px;}
.progress-overall .label{font-size:12px; color:var(--text-dim); margin-bottom:6px; display:flex; justify-content:space-between;}
.progress-bar{height:8px; border-radius:6px; background:var(--bg-card); overflow:hidden;}
.progress-bar > div{height:100%; background:linear-gradient(90deg,var(--accent),var(--good)); transition:width .3s;}

.module-nav-item{
  display:block; padding:10px 12px; border-radius:10px; cursor:pointer; margin-bottom:2px;
  font-size:14px; color:var(--text-dim);
}
.module-nav-item:hover{background:var(--bg-card); color:var(--text);}
.module-nav-item.active{background:var(--accent-soft); color:var(--text); font-weight:600;}
.module-nav-item .count{float:right; font-size:11px; color:var(--text-dim);}

.main-content{flex:1; padding:28px 32px; max-width:820px;}
.module-header{margin-bottom:22px;}
.module-header .eyebrow{color:var(--accent); font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;}
.module-header p{color:var(--text-dim); font-size:15px; margin-top:8px;}

.step-card{
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px 20px; margin-bottom:16px;
}
.step-card.done{border-color:var(--good);}
.step-top{display:flex; align-items:flex-start; gap:12px;}
.step-check{
  width:22px; height:22px; border-radius:7px; border:2px solid var(--border); flex:0 0 22px;
  margin-top:2px; cursor:pointer; display:flex; align-items:center; justify-content:center;
  font-size:13px; color:transparent; transition:all .15s; background:var(--bg-panel);
}
.step-check.checked{background:var(--good); border-color:var(--good); color:#06241a;}
.step-body{flex:1;}
.step-body h4{font-size:15.5px; margin-bottom:6px;}
.step-body .step-text{color:var(--text-dim); font-size:14px;}
.step-body .step-text p{margin:0 0 10px;}
.step-body .step-text ul{margin:0 0 10px; padding-left:20px;}
.step-body .step-text li{margin-bottom:4px;}
.step-body .step-text strong{color:var(--text);}
.callout{
  border-radius:10px; padding:10px 14px; font-size:13px; margin:10px 0; border:1px solid;
}
.callout.tip{background:rgba(124,108,255,.08); border-color:var(--accent-dim); color:#cfc9ff;}
.callout.warn{background:rgba(240,184,79,.1); border-color:var(--warn); color:#f5d99b;}

.code-block{
  position:relative; background:#0a0c12; border:1px solid var(--border); border-radius:10px;
  margin:10px 0; overflow:hidden;
}
.code-block pre{
  margin:0; padding:14px 76px 14px 16px; font-family:var(--mono); font-size:13px; color:#c9e8c0;
  white-space:pre-wrap; word-break:break-word; overflow-wrap:break-word;
}
.code-block .copy-btn{
  position:absolute; top:8px; right:8px; background:var(--bg-card); border:1px solid var(--border);
  color:var(--text-dim); font-size:11px; padding:4px 8px; border-radius:6px; cursor:pointer;
}
.code-block .copy-btn:hover{color:var(--text); border-color:var(--accent);}

.module-footer-nav{display:flex; justify-content:space-between; margin-top:28px;}

@media (max-width:860px){
  .app-layout{flex-direction:column;}
  .sidebar{
    width:100%; flex:none; position:static; height:auto; border-right:none;
    border-bottom:1px solid var(--border); padding:10px;
  }
  .main-content{padding:20px 16px; max-width:100%;}
}
