:root {
  --ink: #081b33;
  --blue: #0c2d57;
  --blue-2: #164b85;
  --yellow: #ffb20f;
  --yellow-2: #ffd269;
  --bg: #f5f7fb;
  --card: #ffffff;
  --muted: #667085;
  --line: #e7eaf0;
  --success: #1f9d62;
  --danger: #d64545;
  --shadow: 0 16px 42px rgba(8, 27, 51, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
button, input { font: inherit; }
button { cursor: pointer; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: #fff;
}
.login-visual {
  min-height: 100vh;
  position: relative;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 18%, rgba(255,178,15,.32), transparent 28%),
    linear-gradient(135deg, #06182c 0%, #0c2d57 55%, #164b85 100%);
  color: white;
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  bottom: -150px;
  border: 34px solid rgba(255,178,15,.18);
  border-radius: 50%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 12px);
  gap: 4px;
}
.brand-mark i { width: 12px; height: 12px; display: block; background: var(--yellow); border-radius: 2px; }
.brand-mark i:first-child { background: white; }
.brand-title { font-size: 24px; }
.brand-title span { color: var(--yellow); }
.hero-copy { max-width: 580px; position: relative; z-index: 1; }
.hero-copy h1 { font-size: clamp(42px, 5vw, 72px); line-height: 1.02; margin: 0 0 20px; letter-spacing: -.05em; }
.hero-copy p { max-width: 540px; color: rgba(255,255,255,.76); font-size: 18px; line-height: 1.65; }
.hero-points { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-points span { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); padding: 10px 14px; border-radius: 999px; font-size: 14px; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(440px, 100%); }
.login-card h2 { font-size: 34px; margin: 0 0 10px; letter-spacing: -.04em; }
.login-card > p { color: var(--muted); margin: 0 0 32px; line-height: 1.6; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: .2s;
}
.field input:focus { border-color: var(--blue-2); box-shadow: 0 0 0 4px rgba(22,75,133,.1); }
.primary-btn {
  width: 100%;
  border: 0;
  color: #07172b;
  background: var(--yellow);
  padding: 15px 18px;
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(255,178,15,.25);
}
.primary-btn:hover { transform: translateY(-1px); }
.demo-note { margin-top: 18px; padding: 14px; border-radius: 12px; background: #fff8e6; color: #6a4a00; font-size: 13px; line-height: 1.55; }
.error { color: var(--danger); min-height: 22px; font-size: 13px; margin: 8px 0 0; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 78px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand-title { color: var(--ink); font-size: 21px; }
.user-area { display: flex; align-items: center; gap: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: white; font-weight: 700; }
.logout-btn, .ghost-btn { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 10px; padding: 10px 13px; font-weight: 600; }
.logout-btn:hover, .ghost-btn:hover { background: #f5f7fb; }
.main { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 40px 0 70px; }
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.welcome h1 { margin: 0 0 8px; font-size: 38px; letter-spacing: -.045em; }
.welcome p { margin: 0; color: var(--muted); }
.progress-summary { min-width: 280px; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 10px 25px rgba(8,27,51,.05); }
.progress-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 700; }
.progress-track { height: 10px; border-radius: 999px; background: #edf0f5; margin-top: 12px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--yellow), #ffd46c); border-radius: inherit; transition: width .35s; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 30px 0 18px; }
.section-heading h2 { margin: 0; font-size: 23px; }
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.module-card { background: white; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 12px 28px rgba(8,27,51,.06); transition: .2s; }
.module-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.module-art { aspect-ratio: 1.1; padding: 22px; position: relative; display: flex; align-items: flex-end; color: white; overflow: hidden; }
.module-art::before, .module-art::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.13); }
.module-art::before { width: 180px; height: 180px; top: -70px; right: -45px; }
.module-art::after { width: 110px; height: 110px; bottom: -40px; left: -25px; }
.module-art.one { background: linear-gradient(145deg, #0b2c55, #1e5f9f); }
.module-art.two { background: linear-gradient(145deg, #6a3d00, #ffb20f); }
.module-art.three { background: linear-gradient(145deg, #163b31, #32a87d); }
.module-art.four { background: linear-gradient(145deg, #4a255f, #9a5dc0); }
.module-icon { font-size: 54px; position: relative; z-index: 1; }
.module-number { position: absolute; right: 20px; bottom: 14px; font-size: 48px; font-weight: 800; opacity: .25; }
.module-body { padding: 20px; }
.module-body h3 { margin: 0 0 8px; font-size: 18px; }
.module-body p { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.55; min-height: 44px; }
.module-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.card-btn { width: 100%; border: 0; border-radius: 10px; padding: 12px; background: var(--ink); color: white; font-weight: 700; }
.card-btn.complete { background: var(--success); }

.content-layout { display: grid; grid-template-columns: 310px 1fr; gap: 26px; }
.sidebar { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; height: fit-content; position: sticky; top: 102px; }
.back-btn { width: 100%; text-align: left; margin-bottom: 12px; }
.lesson-link { width: 100%; border: 0; background: transparent; text-align: left; padding: 12px; border-radius: 10px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.lesson-link.active { background: #eef4fb; color: var(--blue); font-weight: 700; }
.lesson-link.done::after { content: "✓"; color: var(--success); font-weight: 800; }
.content-card { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 34px; box-shadow: 0 12px 28px rgba(8,27,51,.05); }
.content-card h1 { margin: 0 0 12px; font-size: 36px; letter-spacing: -.04em; }
.content-card h2 { margin-top: 30px; }
.content-card p, .content-card li { color: #475467; line-height: 1.75; }
.video-placeholder { min-height: 360px; background: linear-gradient(135deg, #07172b, #174f89); border-radius: 16px; display: grid; place-items: center; color: white; margin: 24px 0; position: relative; overflow: hidden; }
.video-placeholder::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 10%, rgba(255,178,15,.28), transparent 30%); }
.play { width: 78px; height: 78px; border-radius: 50%; border: 0; background: var(--yellow); display: grid; place-items: center; font-size: 28px; position: relative; z-index: 1; }
.lesson-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; }
.lesson-actions button { width: auto; min-width: 160px; }
.quiz-option { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 10px 0; cursor: pointer; }
.quiz-option:hover { border-color: var(--blue-2); }
.quiz-option input { margin-right: 10px; }
.quiz-result { padding: 14px; border-radius: 12px; margin-top: 14px; font-weight: 700; }
.quiz-result.good { background: #e9f8f1; color: #166a44; }
.quiz-result.bad { background: #fff0f0; color: #9f3030; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }

@media (max-width: 1000px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 440px; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 640px) {
  .login-visual { padding: 32px 24px; min-height: 380px; }
  .login-panel { padding: 34px 22px; }
  .topbar { padding: 0 18px; }
  .user-area span { display: none; }
  .main { width: min(100% - 24px, 1240px); padding-top: 24px; }
  .welcome { align-items: stretch; flex-direction: column; }
  .progress-summary { min-width: 0; }
  .module-grid { grid-template-columns: 1fr; }
  .content-card { padding: 22px; }
  .video-placeholder { min-height: 240px; }
  .lesson-actions { flex-direction: column; }
  .lesson-actions button { width: 100%; }
}

/* Dashboard right rail */
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.dashboard-primary .section-heading { margin-top: 0; }
.dashboard-primary .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-rail { display: grid; gap: 22px; position: sticky; top: 102px; }
.rail-card { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: 0 12px 28px rgba(8,27,51,.06); }
.rail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.rail-heading h2 { font-size: 18px; margin: 3px 0 0; letter-spacing: -.025em; }
.eyebrow { color: var(--blue-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.calendar-nav { display: flex; gap: 6px; }
.calendar-nav button { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: white; font-size: 20px; line-height: 1; color: var(--ink); }
.calendar-month { font-size: 14px; font-weight: 800; margin-bottom: 13px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.calendar-weekdays { color: #98a2b3; font-size: 10px; font-weight: 800; margin-bottom: 6px; }
.calendar-day { aspect-ratio: 1; min-width: 0; border: 0; background: transparent; border-radius: 9px; color: #344054; font-size: 12px; position: relative; }
.calendar-day:hover { background: #f2f5f9; }
.calendar-day.today { outline: 2px solid var(--blue-2); font-weight: 800; }
.calendar-day.has-deadline { background: #fff4d6; font-weight: 800; }
.calendar-day.has-deadline::after { content: ""; width: 5px; height: 5px; background: var(--yellow); border-radius: 50%; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); }
.calendar-day.has-deadline.quiz { background: #e9f3ff; }
.calendar-day.has-deadline.quiz::after { background: #2e74b5; }
.calendar-day.has-deadline.recommended { background: #e9f8f1; }
.calendar-day.has-deadline.recommended::after { background: var(--success); }
.deadline-list { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; display: grid; gap: 12px; }
.deadline-item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start; }
.deadline-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--yellow); }
.deadline-dot.quiz { background: #2e74b5; }
.deadline-dot.recommended { background: var(--success); }
.deadline-item strong { display: block; font-size: 12px; line-height: 1.35; }
.deadline-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.text-btn { border: 0; background: transparent; color: var(--blue-2); font-weight: 700; font-size: 12px; padding: 5px; }
.social-feed { display: grid; gap: 14px; }
.social-post { border-top: 1px solid var(--line); padding-top: 14px; }
.social-post:first-child { border-top: 0; padding-top: 0; }
.post-top { display: flex; gap: 10px; align-items: center; }
.post-avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue); color: white; font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.social-post:nth-child(2) .post-avatar { background: var(--yellow); color: var(--ink); }
.social-post:nth-child(3) .post-avatar { background: #267b62; }
.post-top strong { display: block; font-size: 12px; }
.post-top small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.social-post p { color: #475467; font-size: 12px; line-height: 1.55; margin: 10px 0; }
.like-btn { border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; padding: 0; }
.like-btn.liked { color: #cf3d5a; }

@media (max-width: 1100px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .dashboard-primary .module-grid { grid-template-columns: 1fr; }
  .dashboard-rail { grid-template-columns: 1fr; }
}

/* Custom logo and photographic module artwork */
.brand-logo { width: 82px; height: 54px; object-fit: contain; display: block; flex: 0 0 auto; }
.login-visual .brand-logo { background: white; border-radius: 10px; padding: 5px; }
.module-art { background-size: cover; background-position: center; }
.module-art::before, .module-art::after { display: none; }
.module-icon { background: rgba(255,255,255,.9); width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.module-number { color: white; opacity: .8; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
@media (max-width: 640px) { .brand-logo { width: 66px; height: 44px; } }
