.login-layout {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 42px;
  align-items: center;
}
.hero-copy { padding: 30px 0; }
.hero-title span { display: block; color: var(--blue-600); }
.hero-points { display: grid; gap: 12px; margin-top: 30px; }
.hero-point { display: flex; align-items: center; gap: 12px; color: var(--navy-800); font-weight: 700; }
.hero-point i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: white; box-shadow: 0 8px 22px rgba(16,55,99,.1); font-style: normal; }
.login-card { overflow: hidden; }
.login-card-top { padding: 26px; color: white; background: linear-gradient(140deg, var(--navy-950), var(--blue-600)); }
.login-card-top h2 { margin-bottom: 6px; color: white; }
.login-card-top p { margin: 0; color: #d9efff; }
.login-form { display: grid; gap: 18px; padding: 26px; }
.code-input { min-height: 62px !important; font-size: 28px; font-weight: 900; letter-spacing: .35em; text-align: center; }
.demo-box { border: 1px dashed #a9ccdf; border-radius: 13px; padding: 14px; color: var(--muted); background: #f5fbff; font-size: 13px; text-align: center; }
.demo-box button { border: 0; padding: 2px 4px; color: var(--blue-600); background: none; font-weight: 900; text-decoration: underline; }

.welcome-card { position: relative; overflow: hidden; padding: 28px; color: white; background: linear-gradient(135deg, var(--navy-950), var(--blue-600)); }
.welcome-card::after { content: "๒"; position: absolute; right: 22px; bottom: -50px; color: rgba(255,255,255,.08); font-size: 190px; font-weight: 900; }
.welcome-card h1 { position: relative; z-index: 1; color: white; font-size: clamp(28px, 4vw, 42px); }
.welcome-card p { position: relative; z-index: 1; margin: 0; color: #d7eeff; }
.student-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.student-meta .tag { color: white; background: rgba(255,255,255,.14); }
.btn-student-finance {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(253, 224, 71, 0.5) !important;
  background: rgba(234, 179, 8, 0.22) !important;
  color: #fef08a !important;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  user-select: none;
}
.btn-student-finance:hover {
  background: rgba(234, 179, 8, 0.38) !important;
  border-color: rgba(253, 224, 71, 0.85) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3);
}
.btn-student-finance:active {
  transform: translateY(0);
}
.btn-student-chromebook {
  background: rgba(14, 165, 233, 0.22) !important;
  border: 1px solid rgba(125, 211, 252, 0.6) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  cursor: pointer;
  padding: 6px 14px !important;
  border-radius: 999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-student-chromebook:hover {
  background: rgba(14, 165, 233, 0.42) !important;
  border-color: rgba(186, 230, 253, 0.9) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}
.btn-student-chromebook:active {
  transform: translateY(0);
}
.student-finance-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  max-width: 640px;
  width: 92vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  background: #ffffff;
  color: #1e293b;
  overflow: hidden;
}
.student-finance-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}
.student-chromebook-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  max-width: 720px;
  width: 94vw;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  background: #ffffff;
  color: #1e293b;
  overflow: hidden;
}
.student-chromebook-dialog::backdrop {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
}
.cb-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.cb-photo-box {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}
.cb-photo-box:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}
.cb-photo-box.has-image {
  border-style: solid;
  border-color: #38bdf8;
  padding: 0;
}
.cb-photo-preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.cb-remove-photo-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 20px; margin-top: 22px; }
.course-list { display: grid; gap: 14px; }
.course-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 15px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: white; text-decoration: none; }
.course-card:hover { border-color: #9acfea; box-shadow: 0 12px 30px rgba(18,58,112,.1); }
.course-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, var(--blue-500), var(--navy-800)); font-size: 24px; }
.course-icon.has-art { border-radius: 16px; box-shadow: 0 8px 18px rgba(0,17,50,.36); }
.course-card h3 { margin: 0 0 4px; font-size: 17px; }
.course-card p { margin: 0; color: var(--muted); font-size: 12px; }
.course-score { color: var(--navy-800); font-size: 18px; font-weight: 900; white-space: nowrap; }
.course-score small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: right; }
.course-card.score-only { cursor: default; }
.course-card.score-only:hover { transform: none; border-color: rgba(180,231,255,.18); box-shadow: none; }
.assignment-list { display: grid; gap: 11px; }
.assignment-row { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 11px; border-bottom: 1px solid #e5eef4; }
.assignment-row:last-child { border-bottom: 0; padding-bottom: 0; }
.assignment-row strong { display: block; margin-bottom: 3px; font-size: 14px; }
.assignment-row small { color: var(--muted); }

@media (max-width: 850px) {
  .login-layout, .dashboard-grid { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 0; }
}
@media (max-width: 520px) {
  .hero-points { display: none; }
  .course-card { grid-template-columns: 45px minmax(0, 1fr); }
  .course-icon { width: 45px; height: 45px; }
  .course-score { grid-column: 2; }
}

.hero-copy { position: relative; z-index: 1; }
.frozen-hero-character { position: absolute; z-index: -1; width: min(430px, 48vw); right: -18%; bottom: -29%; opacity: .3; filter: drop-shadow(0 25px 24px rgba(0,8,30,.6)) drop-shadow(0 0 24px rgba(119,221,255,.35)); }
.hero-title { color: #fff; text-shadow: 0 7px 22px #001b42; }
.hero-title span { color: #9ceaff; background: linear-gradient(180deg,#fff,#74cdf3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-point { color: #d5edfa; }
.hero-point i { color: #12518e; background: #eafbff; box-shadow: 0 0 20px rgba(121,225,255,.35); }
.login-card { position: relative; }
.login-card-top { position: relative; z-index: 2; background: linear-gradient(140deg,rgba(3,18,51,.96),rgba(14,102,178,.92)); }
.login-form { position: relative; z-index: 2; }
.login-castle { position: absolute; right: -25px; bottom: -18px; width: 210px; opacity: .09; pointer-events: none; }
.username-input { letter-spacing: .18em; }
.demo-box { color: #b5d1e3; border-color: rgba(169,220,239,.3); background: rgba(2,20,48,.35); }
.demo-box button { color: #86e3ff; }
.welcome-card { background: linear-gradient(135deg,#061733,#0a4f98 62%,#1398c8); }
.welcome-olaf { position: absolute; z-index: 1; right: 35px; bottom: -8px; width: 138px; filter: drop-shadow(0 10px 13px rgba(0,18,54,.62)); }
.welcome-card::after { content: "❄"; color: rgba(255,255,255,.08); }
.welcome-card > :not(.welcome-olaf) { position: relative; z-index: 2; }
.course-card { color: #effaff; border-color: rgba(180,231,255,.18); background: rgba(1,20,50,.42); }
.course-card:hover { border-color: #87ddff; background: rgba(10,64,115,.5); }
.course-card p, .assignment-row small { color: #9fc3dc; }
.course-score { color: #b9f0ff; }
.course-score small { color: #83aec9; }
.assignment-row { border-color: rgba(180,231,255,.13); }
@media (max-width: 850px) {
  .frozen-hero-character { position: relative; display: block; width: min(290px, 80vw); right: auto; bottom: auto; margin: -15px auto -25px; opacity: .82; }
}
@media (max-width: 520px) {
  .login-layout { gap: 24px; }
  .hero-copy { text-align: center; }
  .hero-title { font-size: 36px; }
  .welcome-olaf { width: 94px; right: 8px; opacity: .72; }
  .welcome-card { padding-right: 82px; }
  .code-input { font-size: 23px; }
}

/* ===== Task 3: การ์ดวิชา — ปุ่มเข้าสู่บทเรียน & การ์ด Coming Soon ===== */
.course-card .course-enter { margin-top: 10px; width: fit-content; }
.course-card-locked {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, .28);
  background: linear-gradient(145deg, rgba(255, 255, 255, .16), rgba(160, 190, 255, .06));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: .84;
}
.course-card-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 32%, rgba(255, 255, 255, .12) 50%, transparent 68%);
  pointer-events: none;
}
.course-card-locked:hover {
  transform: none;
  border-color: rgba(255, 255, 255, .42);
  background: linear-gradient(145deg, rgba(255, 255, 255, .2), rgba(160, 190, 255, .08));
  box-shadow: none;
}
.course-card-locked h3 { color: #f4fbff; }
.course-card-locked p { color: #b9d4ea; }
.course-card-locked .course-icon.locked-icon {
  font-size: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .24), rgba(120, 150, 190, .32));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 18px rgba(0, 17, 50, .3);
}
.coming-soon-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.coming-soon-badge small { font-size: 9px; letter-spacing: .08em; opacity: .75; font-weight: 700; }
@media (max-width: 520px) {
  .course-card .coming-soon-badge { grid-column: 2; justify-self: start; margin-top: 8px; }
}
