:root {
  --bg: #0b1326;
  --bg-soft: #111c36;
  --panel: #152341;
  --panel-alt: #1b2f56;
  --text: #f3f7ff;
  --muted: #b6c4e5;
  --primary: #2f80ed;
  --accent: #2dd4bf;
  --warm: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --ring: rgba(45, 212, 191, 0.35);
  --shadow: 0 14px 40px rgba(5, 10, 26, 0.35);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(47, 128, 237, 0.24), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(45, 212, 191, 0.18), transparent 34%),
    radial-gradient(circle at 50% 95%, rgba(245, 158, 11, 0.12), transparent 36%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(9, 16, 34, 0.68);
  border-bottom: 1px solid rgba(182, 196, 229, 0.16);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-link {
  color: var(--muted);
}

.nav-link:hover {
  background: rgba(182, 196, 229, 0.1);
  color: var(--text);
}

.btn {
  background: var(--primary);
  color: white;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  background: rgba(47, 128, 237, 0.12);
  border-color: rgba(47, 128, 237, 0.35);
  color: #b7d4ff;
}

.btn.accent {
  background: var(--accent);
  color: #05211c;
}

.btn.warn {
  background: var(--warm);
  color: #2b1a02;
}

.hero {
  padding: 72px 0 42px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 14px;
}

.hero p {
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

.hero-card {
  background: linear-gradient(155deg, rgba(27, 47, 86, 0.82), rgba(15, 24, 44, 0.86));
  border: 1px solid rgba(182, 196, 229, 0.14);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: float-in 520ms ease;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: linear-gradient(160deg, rgba(21, 35, 65, 0.88), rgba(17, 28, 54, 0.82));
  border: 1px solid rgba(182, 196, 229, 0.14);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h3,
.card h2 {
  margin-top: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(182, 196, 229, 0.12);
  border: 1px solid rgba(182, 196, 229, 0.24);
}

.main {
  padding: 30px 0 56px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 10px 0 24px;
  flex-wrap: wrap;
}

.section-head-text h2,
.section-head-text h3 {
  margin-bottom: 6px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.courses-search-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.courses-search-input {
  width: 300px;
  padding: 10px 14px 10px 40px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg>') no-repeat 12px center;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

.courses-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.courses-search-input::placeholder {
  color: var(--muted);
}

@media (max-width: 768px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .courses-search-wrapper {
    width: 100%;
  }
  .courses-search-input {
    width: 100%;
  }
}

.form-wrap {
  max-width: 520px;
  margin: 48px auto;
}

label {
  display: block;
  margin: 12px 0 6px;
  color: #dce8ff;
  font-size: 14px;
}

.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-wrapper input {
  padding-right: 42px;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  width: 36px;
  height: 36px;
  background: none;
  border: 2px solid var(--muted);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.password-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.password-toggle-btn:active {
  transform: scale(0.95);
}

input,
textarea,
select {
  width: 100%;
  background: rgba(9, 17, 35, 0.72);
  color: var(--text);
  border: 1px solid rgba(182, 196, 229, 0.22);
  border-radius: 12px;
  padding: 11px 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.notice {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
}

.notice.error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.notice.success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
}

.toast {
  border: 1px solid rgba(182, 196, 229, 0.28);
  border-radius: 12px;
  padding: 11px 12px;
  box-shadow: var(--shadow);
  background: rgba(10, 19, 38, 0.95);
  color: var(--text);
  font-size: 14px;
  animation: toast-in 220ms ease forwards;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(7, 42, 26, 0.95);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.48);
  background: rgba(56, 15, 19, 0.95);
}

.toast.out {
  animation: toast-out 220ms ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(14px) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(14px) translateY(-4px);
  }
}

.progress {
  margin-top: 10px;
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(182, 196, 229, 0.16);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.lesson-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(182, 196, 229, 0.16);
  background: rgba(12, 21, 40, 0.55);
}

.locked {
  opacity: 0.6;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  margin-top: 16px;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-frame {
  margin-top: 16px;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(182, 196, 229, 0.2);
  border-radius: 14px;
  display: block;
}

.footer {
  padding: 20px 0 40px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.stagger {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 0.4s ease forwards;
}

.stagger:nth-child(2) {
  animation-delay: 70ms;
}

.stagger:nth-child(3) {
  animation-delay: 120ms;
}

.stagger:nth-child(4) {
  animation-delay: 170ms;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 930px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 42px;
  }

  .grid.cols-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .nav {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .toast-root {
    left: 14px;
    right: 14px;
    width: auto;
  }
}
