:root {
  --sky-0: #f7fbff;
  --sky-1: #eaf4fc;
  --sky-2: #d5ebf8;
  --ink: #173047;
  --ink-soft: #4a647a;
  --brand: #0c6f78;
  --brand-deep: #08545b;
  --accent: #ef7a3a;
  --accent-soft: #fff1e7;
  --card: #ffffffee;
  --line: #c9deec;
  --ok: #1f8a55;
  --shadow: 0 18px 50px rgba(23, 72, 104, 0.12);
  --radius: 22px;
  --font-display: "Syne", "Apple SD Gothic Neo", sans-serif;
  --font-body: "Manrope", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  background:
    radial-gradient(1200px 600px at 10% -10%, #c8ecff 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #ffe7d4 0%, transparent 50%),
    linear-gradient(180deg, var(--sky-0), var(--sky-1) 40%, #f3f9fd);
  min-height: 100vh;
}

button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }

.app-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* ===== Login ===== */
.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-card {
  width: min(920px, 100%);
  background: var(--card);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-hero {
  position: relative;
  min-height: 300px;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.18), rgba(255,236,214,0.28)),
    linear-gradient(160deg, rgba(12,111,120,0.35), rgba(239,122,58,0.18)),
    center/cover no-repeat url("assets/media/ko/01.jpg");
  color: #fff;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 10%, transparent 40%, rgba(7,55,62,0.55));
  pointer-events: none;
}

.login-hero > * { position: relative; z-index: 1; }

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}

.brand-mark span { color: #9ef0f5; }

.login-hero p {
  margin: 10px 0 0;
  max-width: 34rem;
  font-size: 1.02rem;
  color: rgba(255,255,255,0.92);
}

.login-body { padding: 24px 22px 28px; }

.section-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 10px;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lang-card {
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  text-align: left;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.lang-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lang-card.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(12,111,120,0.12);
}

.lang-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.lang-card .meta { padding: 12px 14px 14px; }
.lang-card b { display: block; font-size: 1.05rem; }
.lang-card small { color: var(--ink-soft); }

.form-row { margin-top: 18px; }
.form-row label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-row input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: #fff;
}

.start-btn {
  margin-top: 18px;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}

.hint {
  margin: 12px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -18px -16px 18px;
  padding: 14px 16px 12px;
  background: rgba(247,251,255,0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-dot {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand), #19a0ab);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
}

.top-meta { flex: 1; min-width: 0; }
.top-meta b, .top-meta small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-meta small { color: var(--ink-soft); }

.tool-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.tool-row button,
.tabs button,
.actions button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-weight: 800;
  color: var(--ink);
}

.tool-row button.on,
.tabs button.on {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

.hero-panel {
  border-radius: var(--radius);
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(12,111,120,0.78), rgba(56,176,186,0.72) 55%, rgba(239,122,58,0.45)),
    center/cover no-repeat var(--hero-image);
  box-shadow: var(--shadow);
}

.hero-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.5vw, 2.1rem);
  margin: 4px 0 8px;
  letter-spacing: -0.02em;
}

.hero-panel p { margin: 0; opacity: 0.92; max-width: 40rem; }

.tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(23,72,104,0.06);
}

.panel h2 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.week-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, var(--sky-0));
  padding: 14px;
}

.week-card b { color: var(--brand-deep); display: block; }
.week-card small { color: var(--ink-soft); }
.week-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12,111,120,0.12);
}

/* ===== Image lecture ===== */
.player {
  overflow: hidden;
  border-radius: 20px;
  background: #102433;
  color: #fff;
}

.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0d1d28;
}

.stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stage-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.28), transparent 35%, transparent 60%, rgba(0,0,0,0.55));
  pointer-events: none;
}

.badge {
  position: absolute;
  top: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(8, 30, 40, 0.62);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
  font-weight: 700;
}

.badge.left { left: 12px; }
.badge.right { right: 12px; }

.caption {
  min-height: 88px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #0f4f56, #0a3b41);
  font-size: 1.02rem;
}

.progress {
  height: 5px;
  background: rgba(255,255,255,0.15);
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #45d0d8, #ffb278);
  transition: width .2s linear;
}

.status-line {
  padding: 10px 14px 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px 4px;
}

.dots button {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #c5d7e4;
}
.dots button.on { background: var(--brand); transform: scale(1.2); }

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px 16px;
}

.actions .primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.lesson-text {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.lesson-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--sky-0);
}

.lesson-block.current {
  background: #fff8ef;
  border-color: #f0c39a;
}

.grades-list {
  display: grid;
  gap: 8px;
}

.grade-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sky-0);
  border: 1px solid var(--line);
}

.intro-video {
  width: 100%;
  border-radius: 16px;
  background: #000;
  margin-top: 10px;
}

@media (min-width: 800px) {
  .week-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lang-card img { height: 180px; }
  .login-body { padding: 28px 30px 32px; }
}
