:root {
  --cream: #f3efe4;
  --cream-deep: #e8e2d2;
  --page: #efe9da;
  --surface: #ffffff;
  --surface-soft: #f8f5ed;
  --ink: #1a1a1a;
  --mid: #6b6b6b;
  --light: #9a9a9a;
  --turquoise: #00bcd4;
  --turquoise-deep: #0097a7;
  --purple: #7b5ea7;
  --pink: #e83e8c;
  --green: #22c55e;
  --amber: #f5a623;
  --brand-line: linear-gradient(90deg, #00bcd4 0%, #7b5ea7 50%, #e83e8c 100%);
  --gradient-soft: linear-gradient(135deg, #00bcd4, #7b5ea7);
  --font: "Poppins", system-ui, sans-serif;
  --radius: 22px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --shadow: 0 20px 50px rgba(20, 20, 20, 0.07);
  --shadow-soft: 0 8px 24px rgba(20, 20, 20, 0.05);
  --shadow-bubble: 0 2px 0 rgba(255, 255, 255, 0.7) inset, 0 10px 28px rgba(20, 20, 20, 0.05);
  --sidebar: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 8% -5%, rgba(0, 188, 212, 0.14), transparent 55%),
    radial-gradient(700px 420px at 95% 5%, rgba(232, 62, 140, 0.1), transparent 50%),
    var(--page);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

a {
  color: var(--turquoise-deep);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  color: var(--pink);
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 0.35rem;
}

.pack-line {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--mid);
  font-weight: 500;
}

.pack-line span {
  color: var(--purple);
  font-weight: 600;
}

.course-desc {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.82rem;
  color: var(--mid);
  line-height: 1.4;
}


/* —— Gate —— */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.gate-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.85rem 1.75rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-line);
}

.gate-card h1 {
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.lead {
  color: var(--mid);
  font-size: 0.95rem;
}

.gate-form {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.gate-form label {
  font-size: 0.85rem;
  font-weight: 600;
}

.gate-form input {
  border: 0;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1.5px rgba(20, 20, 20, 0.06);
}

.gate-form input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(0, 188, 212, 0.45);
}

.gate-form button,
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #00bcd4, #7b5ea7 55%, #c2185b);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.gate-form button:hover,
.cta:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.error {
  color: #b00020;
  font-size: 0.85rem;
  font-weight: 600;
}

.hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--mid);
}

/* —— Shell —— */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  gap: 14px;
  padding: 14px 16px 16px;
}

.sidebar {
  background: var(--ink);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 6px;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
}

.sidebar-brand {
  margin-bottom: 10px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--gradient-soft);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  align-items: center;
}

.nav-btn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.45);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  background: #fff;
  color: var(--ink);
  transform: scale(1.04);
}

.sidebar-spacer {
  flex: 1;
}

.nav-btn.logout:hover {
  color: var(--pink);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 8px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.greeting {
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  box-shadow: var(--shadow-soft);
  color: var(--light);
  min-width: min(280px, 100%);
}

.search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--ink);
}

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

.view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.welcome-card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: center;
}

.welcome-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.welcome-card p {
  color: var(--mid);
  font-size: 0.92rem;
  max-width: 28rem;
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.chip {
  background: var(--surface);
  border-radius: 18px;
  padding: 0.7rem 1rem;
  min-width: 88px;
  box-shadow: var(--shadow-bubble);
  display: grid;
  gap: 0.1rem;
}

.chip strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--turquoise-deep);
}

.chip span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.sub {
  color: var(--mid);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

.count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mid);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.linkish {
  border: 0;
  background: transparent;
  color: var(--turquoise-deep);
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
}

.linkish:hover {
  color: var(--pink);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.course-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: riseIn 0.45s ease both;
}

.course-card:nth-child(2) { animation-delay: 0.05s; }
.course-card:nth-child(3) { animation-delay: 0.1s; }
.course-card:nth-child(4) { animation-delay: 0.15s; }
.course-card:nth-child(5) { animation-delay: 0.2s; }
.course-card:nth-child(6) { animation-delay: 0.25s; }

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.course-visual {
  position: relative;
  aspect-ratio: 16 / 11;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.course-lessons {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

.course-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  box-shadow: var(--shadow-bubble);
}

.course-body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.course-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mid);
  background: var(--surface-soft);
  width: fit-content;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}

.course-card h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.course-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--light);
  font-weight: 600;
  padding-top: 0.35rem;
}

.course-meta .status {
  color: var(--turquoise-deep);
}

.course-meta .status.is-coach {
  color: var(--pink);
}

.course-card.is-hidden {
  display: none;
}

.foot {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--mid);
}

.foot .cta {
  margin-top: 0;
  padding: 0.7rem 1.1rem;
  font-size: 0.9rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .courses-grid,
  .courses-grid--preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    border-radius: var(--radius);
    padding: 10px 12px;
    gap: 8px;
  }

  .sidebar-brand {
    margin: 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .sidebar-nav {
    flex-direction: row;
    width: auto;
  }

  .sidebar-spacer {
    flex: 1;
  }

  .nav-btn {
    width: 42px;
    height: 42px;
  }

  .courses-grid,
  .courses-grid--preview {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 4px 2px 20px;
  }
}
