/* ============================================
   Page-specific animations & layout
   ============================================ */

/* ---- Loading screen (entry animation) ---- */
.loader {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transition: transform 1s cubic-bezier(0.86, 0, 0.07, 1);
}
.loader.done { transform: translateY(-100%); }
.loader__text {
  color: var(--bg);
  font-size: clamp(48px, 12vw, 140px);
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 1;
  display: flex;
  gap: 6px;
}
.loader__text span {
  display: inline-block;
  animation: letter-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}
.loader__text span:nth-child(1) { animation-delay: 0.05s; color: var(--pink); }
.loader__text span:nth-child(2) { animation-delay: 0.15s; color: var(--lime); }
.loader__text span:nth-child(3) { animation-delay: 0.25s; color: var(--blue); }
.loader__text span:nth-child(4) { animation-delay: 0.35s; color: var(--yellow); }
.loader__text span:nth-child(5) { animation-delay: 0.45s; color: var(--pink); }
.loader__text span:nth-child(6) { animation-delay: 0.55s; color: var(--lime); }
.loader__text span:nth-child(7) { animation-delay: 0.65s; color: var(--blue); }
.loader__bar {
  width: 240px;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
}
.loader__bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--lime);
  width: 0;
  animation: load 1.6s ease-out forwards;
  animation-delay: 0.4s;
}
@keyframes letter-pop {
  0% { transform: translateY(80px) rotate(15deg); opacity: 0; }
  100% { transform: translateY(0) rotate(0); opacity: 1; }
}
@keyframes load {
  to { width: 100%; }
}

/* ---- Hero ---- */
.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 60px 32px;
  overflow: hidden;
}
.hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}
.hero__title {
  font-size: clamp(48px, 9vw, 130px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -3px;
  margin-bottom: 20px;
}
.hero__title .word {
  display: inline-block;
  margin-right: 12px;
  opacity: 0;
  transform: translateY(40px);
  animation: slide-up 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.hero__title .word:nth-child(1) { animation-delay: 0.1s; }
.hero__title .word:nth-child(2) { animation-delay: 0.2s; }
.hero__title .word:nth-child(3) { animation-delay: 0.3s; }
.hero__title .word:nth-child(4) { animation-delay: 0.4s; }
.hero__title .accent-pink { color: var(--pink); display: inline-block; }
.hero__title .accent-blue { color: var(--blue); display: inline-block; }
.hero__lede {
  font-size: 20px;
  max-width: 540px;
  color: var(--ink-soft);
  margin-bottom: 32px;
  font-weight: 500;
  opacity: 0;
  animation: slide-up 0.7s ease 0.6s forwards;
}
.hero__cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  animation: slide-up 0.7s ease 0.8s forwards;
}

.hero__sticker-1 {
  position: absolute;
  top: 14%;
  right: 6%;
  z-index: 1;
}
.hero__sticker-2 {
  position: absolute;
  bottom: 18%;
  right: 22%;
  z-index: 1;
}
.hero__sticker-3 {
  position: absolute;
  top: 50%;
  right: 4%;
  z-index: 1;
}
.hero__circle {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pink), transparent 70%);
  opacity: 0.35;
  filter: blur(40px);
  z-index: 0;
}
.hero__circle--1 { top: -100px; right: -100px; }
.hero__circle--2 { bottom: -120px; left: -100px; background: radial-gradient(circle, var(--blue), transparent 70%); }

/* ---- Course grid ---- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
}
.course-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.course-card:hover {
  transform: translate(-4px, -4px) rotate(-0.8deg);
  box-shadow: 10px 10px 0 var(--ink);
}
.course-card__cover {
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  border-bottom: var(--border);
  overflow: hidden;
}
.course-card__cover .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--ink);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.course-card__cover.bg-pink { background: var(--pink); color: white; }
.course-card__cover.bg-blue { background: var(--blue); color: white; }
.course-card__cover.bg-lime { background: var(--lime); }
.course-card__cover.bg-yellow { background: var(--yellow); }
.course-card__cover.bg-purple { background: var(--purple); color: white; }
.course-card__body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.course-card__title { font-size: 22px; font-weight: 900; line-height: 1.15; margin-bottom: 8px; letter-spacing: -0.5px; }
.course-card__meta { display: flex; gap: 10px; font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }
.course-card__footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 14px; border-top: 2px dashed rgba(0,0,0,0.12); }
.course-card__price { font-size: 22px; font-weight: 900; }
.course-card__price small { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

/* ---- Lesson list ---- */
.lesson-list { display: flex; flex-direction: column; gap: 14px; }
.lesson {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--paper);
  border: var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-hard-sm);
  transition: transform 0.15s ease;
}
.lesson:hover { transform: translateX(4px); }
.lesson__num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--lime);
  border: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}
.lesson__body { flex: 1; }
.lesson__title { font-weight: 800; font-size: 17px; }
.lesson__meta { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.lesson__icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 16px;
}
.lesson--locked { opacity: 0.55; }
.lesson--locked .lesson__num { background: var(--ink); color: var(--bg); }

/* ---- Video player frame ---- */
.video-frame {
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.video-frame__lock {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-align: center;
  padding: 20px;
}
.video-frame__lock svg { width: 64px; height: 64px; }
.video-frame__play {
  width: 84px; height: 84px;
  background: var(--pink);
  border: var(--border);
  border-radius: 50%;
  color: white;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s ease;
}
.video-frame__play:hover { transform: scale(1.08); }

/* ---- QR payment ---- */
.qr-box {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-hard);
}
.qr-img {
  width: 220px;
  height: 220px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 12px;
  margin: 0 auto 16px;
  padding: 10px;
  display: block;
}
.qr-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 2px solid var(--ink);
}
.qr-status .dot {
  width: 10px; height: 10px;
  background: var(--yellow);
  border-radius: 50%;
  animation: pulse 1s infinite;
}
.qr-status.success { background: var(--lime); }
.qr-status.success .dot { background: var(--ink); animation: none; }
.qr-amount {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
}
.qr-promptpay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  margin-top: 8px;
}

/* ---- Auth split layout ---- */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-shell__art {
  background: var(--pink);
  color: white;
  padding: 60px;
  position: relative;
  overflow: hidden;
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-shell__art h2 { font-size: clamp(36px, 4vw, 64px); font-weight: 900; line-height: 0.95; letter-spacing: -1.5px; }
.auth-shell__form {
  padding: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-shell__art { display: none; }
  .auth-shell__form { padding: 40px 24px; }
}

/* ---- Dashboard ---- */
.dash-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: flex-start;
}
.dash-side {
  position: sticky;
  top: 92px;
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
  padding: 22px;
}
.dash-side h4 { font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.dash-side a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  margin-bottom: 4px;
}
.dash-side a:hover, .dash-side a.active {
  background: var(--lime);
  border: 2px solid var(--ink);
}
@media (max-width: 880px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { position: static; }
}
