:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #64717d;
  --line: #d8e0e5;
  --surface: #ffffff;
  --soft: #f4f7f8;
  --teal: #006d77;
  --teal-2: #0a9396;
  --coral: #d95d39;
  --gold: #e9c46a;
  --shadow: 0 18px 50px rgba(28, 44, 52, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 109, 119, 0.08), transparent 36%),
    linear-gradient(180deg, #f9fbfb 0%, #eef4f5 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 32px;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  align-items: center;
  gap: 48px;
  max-width: 1160px;
  margin: 0 auto;
}

.brand-block h1,
.topbar h1 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-block h1 {
  max-width: 760px;
  font-size: clamp(48px, 7vw, 84px);
}

.lead {
  max-width: 720px;
  margin: 24px 0 0;
  font-size: 20px;
  line-height: 1.65;
  color: var(--muted);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
}

.login-panel,
.sidebar,
.lesson-copy {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 28px;
}

.login-panel h2,
.lesson-copy h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.muted,
.helper {
  color: var(--muted);
  line-height: 1.6;
}

.login-panel label {
  display: block;
  margin: 28px 0 8px;
  font-weight: 700;
}

.input-row {
  display: grid;
  gap: 10px;
}

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

.input-row button,
.account-pill button,
.iframe-fallback a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--teal);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.google-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  color: var(--coral);
  font-weight: 800;
}

.error {
  min-height: 24px;
  margin: 12px 0 0;
  color: #b42318;
  font-weight: 600;
}

.course-view {
  max-width: 1280px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  white-space: nowrap;
}

.account-pill span {
  color: var(--muted);
  padding: 0 8px;
}

.account-pill button {
  min-height: 38px;
  background: var(--ink);
}

.lesson-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}

.sidebar {
  padding: 18px;
  align-self: start;
}

.module-link {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.module-link span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--teal);
  font-weight: 800;
}

.module-link.active {
  border-color: rgba(0, 109, 119, 0.45);
  background: rgba(10, 147, 150, 0.08);
}

.module-link:disabled {
  opacity: 0.62;
}

.lesson-main {
  min-width: 0;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #0e171b;
  box-shadow: var(--shadow);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.iframe-fallback {
  position: absolute;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 14px;
  border-radius: 8px;
  color: #fff;
  background: rgba(14, 23, 27, 0.82);
}

.iframe-fallback p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.iframe-fallback a {
  min-height: 38px;
  background: var(--coral);
}

.lesson-copy {
  margin-top: 20px;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}

.lesson-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.status-grid {
  display: grid;
  gap: 10px;
  align-content: center;
}

.status-grid div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.complete {
  background: var(--teal-2);
}

.status-dot.pending {
  background: var(--gold);
}

@media (max-width: 900px) {
  .app-shell {
    padding: 18px;
  }

  .login-view,
  .lesson-layout,
  .lesson-copy {
    grid-template-columns: 1fr;
  }

  .login-view {
    align-items: start;
    gap: 28px;
    padding-top: 28px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-pill {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .brand-block h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 17px;
  }

  .account-pill {
    align-items: stretch;
    flex-direction: column;
  }

  .account-pill span {
    overflow-wrap: anywhere;
  }

  .iframe-fallback {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}
