:root {
  --bg: #0b0f1a;
  --card: #12172a;
  --primary: #7c7cff;
  --secondary: #3dd5f3;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 64px;
}

* {
  box-sizing: border-box;
  font-family: Inter, system-ui, sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #1b1f3a, var(--bg));
  color: var(--text);
}

.sidebar {
  width: var(--sidebar-width);
  transition: width 0.3s ease-in-out;
  background: linear-gradient(170deg, rgba(18, 23, 42, 0.96), rgba(11, 15, 26, 0.96));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-header {
  height: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px;
}

.sidebar-controls {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
  padding: 12px;
  display: grid;
  gap: 6px;
}

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-item.active {
  color: #fff;
  background: linear-gradient(90deg, #5f67ff, #3dd5f3);
  box-shadow: 0 0 20px rgba(95, 103, 255, 0.35);
}

body:not(.is-authenticated) .sidebar-nav .sidebar-item:not([data-page="home"]) {
  display: none;
}

body:not(.is-authenticated) .chat-fab {
  display: none;
}

.page-content {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease-in-out;
}

.sidebar-hidden .sidebar {
  width: var(--sidebar-width-collapsed);
}

.sidebar-hidden .page-content {
  margin-left: var(--sidebar-width-collapsed);
}

.sidebar-hidden .sidebar-header {
  justify-content: center;
  padding: 0;
}

.sidebar-hidden .sidebar-item {
  justify-content: center;
  padding: 10px 0;
}

.sidebar-hidden .item-label {
  display: none;
}

.sidebar-hidden .chevron-icon {
  transform: rotate(180deg);
}

.sidebar-hidden #hideSidebar {
  display: none;
}

.sidebar-full-hidden .sidebar {
  width: 0;
  overflow: visible;
  background: transparent;
  border-right: 0;
}

.sidebar-full-hidden .page-content {
  margin-left: 0;
}

.sidebar-full-hidden .sidebar-nav,
.sidebar-full-hidden #collapseSidebar {
  display: none;
}

.sidebar-full-hidden .sidebar-header {
  height: 0;
  border-bottom: 0;
  padding: 0;
}

.sidebar-full-hidden #hideSidebar {
  display: none;
}

.floating-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 140;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(18, 23, 42, 0.9);
  color: var(--text);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.floating-menu-btn svg {
  width: 20px;
  height: 20px;
}

.sidebar-full-hidden .floating-menu-btn {
  display: flex;
}

/* HEADER */
#header-slot {
  position: sticky;
  top: 0;
  z-index: 80;
}

.header {
  position: relative;
  padding: 16px;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.4);
}

.header-inner {
  width: 100%;
  margin: 0 auto;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-full-hidden .header-inner {
  padding-left: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 0 20px rgba(95, 103, 255, 0.35);
  color: #fff;
}

.brand-icon svg {
  width: 24px;
  height: 24px;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand p {
  margin: 2px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.profile-btn {
  height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.login-btn {
  height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(74, 102, 180, 0.4);
  background: rgba(5, 11, 31, 0.8);
  color: #dbe6fb;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.login-btn:hover {
  border-color: rgba(79, 143, 248, 0.6);
  transform: translateY(-1px);
}

.profile-menu {
  position: relative;
}

#profileMenuWrap {
  display: none;
}

body.is-authenticated .login-btn {
  display: none;
}

body.is-authenticated #profileMenuWrap {
  display: block;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #fff;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar.has-image {
  background: rgba(5, 11, 31, 0.8);
}

.profile-avatar.has-image svg {
  display: none;
}

.profile-avatar svg {
  width: 16px;
  height: 16px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  width: 224px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(16, 24, 54, 0.96), rgba(8, 14, 35, 0.98));
  box-shadow: 0 18px 34px rgba(4, 9, 24, 0.45);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.profile-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.profile-dropdown-user {
  padding: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.profile-dropdown-email {
  padding: 0 8px 8px;
  font-size: 0.74rem;
  color: var(--muted);
}

.profile-dropdown hr {
  margin: 4px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-dropdown-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 8px;
  font-size: 0.86rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.profile-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.profile-dropdown-item svg {
  width: 16px;
  height: 16px;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 170;
  background: rgba(3, 8, 22, 0.66);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.auth-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-card {
  width: min(420px, calc(100vw - 28px));
  border: 1px solid rgba(66, 99, 176, 0.3);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(16, 24, 54, 0.96), rgba(8, 14, 35, 0.98));
  padding: 18px;
  position: relative;
}

.auth-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dbe6fb;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auth-modal-card h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form .form-field-group {
  display: grid;
  gap: 8px;
  width: 100%;
}

.auth-form .form-field-group label,
.auth-form .form-field-group input,
.auth-form .form-field-group select {
  display: block;
}

.auth-form label {
  font-size: 0.84rem;
  color: #c7d7f2;
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(74, 102, 180, 0.35);
  background: rgba(4, 10, 29, 0.82);
  color: #dbe6fb;
  padding: 0 10px;
}

.auth-form select {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(74, 102, 180, 0.35);
  background: rgba(4, 10, 29, 0.82);
  color: #dbe6fb;
  padding: 0 10px;
}

.forgot-link {
  justify-self: start;
  font-size: 0.8rem;
  color: #8ec7ff;
  text-decoration: none;
  margin-top: 4px;
}

.forgot-link:hover {
  text-decoration: underline;
}

.google-btn {
  margin-top: 6px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-feedback {
  min-height: 18px;
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #ff9f9f;
}

.google-btn > div,
.google-btn iframe {
  max-width: 100%;
}

.auth-actions {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-btn {
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(74, 102, 180, 0.35);
  background: rgba(5, 11, 31, 0.8);
  color: #dbe6fb;
  font-weight: 700;
  cursor: pointer;
}

.auth-btn.primary {
  border-color: transparent;
  background: linear-gradient(90deg, #4f8ff8, #8450f2);
  color: #061024;
}

.google-complete-card {
  width: min(480px, calc(100vw - 28px));
}

.google-complete-actions {
  grid-template-columns: 1fr;
}

.forgot-password-card {
  width: min(420px, calc(100vw - 28px));
}

.forgot-password-actions {
  grid-template-columns: 1fr 1fr;
}

.auth-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 240;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid rgba(66, 176, 110, 0.45);
  border-radius: 10px;
  background: rgba(8, 36, 24, 0.95);
  color: #b8f3d1;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.auth-toast.open {
  opacity: 1;
  transform: translateY(0);
}

/* HOME HERO */
.home-hero {
  padding: 64px 16px 48px;
  text-align: center;
}

.home-hero-inner {
  max-width: 960px;
  margin: 0 auto;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(124, 124, 255, 0.35);
  background: rgba(124, 124, 255, 0.12);
  color: #8ec7ff;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
}

.home-title {
  margin: 16px 0 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.1;
  font-weight: 700;
}

.home-title span {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  color: transparent;
}

.home-subtitle {
  max-width: 680px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.home-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.home-btn {
  border: 0;
  border-radius: 10px;
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}

.home-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

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

.home-btn-primary {
  color: #fff;
  background: linear-gradient(90deg, #5f67ff, #3dd5f3);
  box-shadow: 0 0 24px rgba(95, 103, 255, 0.28);
}

.home-btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.home-stats-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-stat-card {
  background: linear-gradient(170deg, rgba(18, 23, 42, 0.92), rgba(11, 15, 26, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px 16px;
}

.home-stat-icon {
  font-size: 1.4rem;
}

.home-stat-value {
  margin-top: 10px;
  font-size: 1.55rem;
  font-weight: 700;
}

.home-stat-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* SECTIONS */
.section {
  padding: 80px 40px;
  text-align: center;
}

.cards,
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card,
.plan {
  background: var(--card);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(124, 124, 255, 0.1);
  transition: transform 0.3s;
}

.card:hover,
.plan:hover {
  transform: translateY(-6px);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.course-card {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(74, 102, 180, 0.28);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(16, 24, 54, 0.95), rgba(8, 15, 36, 0.98));
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  overflow: hidden;
  text-align: left;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.course-card:hover,
.course-card:focus-within,
.course-card:focus {
  border-color: rgba(84, 194, 255, 0.75);
  box-shadow: 0 0 0 2px rgba(84, 194, 255, 0.2), 0 14px 34px rgba(8, 16, 46, 0.6);
  transform: translateY(-2px);
  outline: none;
}

.course-media {
  position: relative;
  height: 200px;
  background: radial-gradient(circle at 30% 20%, rgba(48, 95, 201, 0.16), rgba(6, 14, 38, 0.95));
  border-bottom: 1px solid rgba(74, 102, 180, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-media-label {
  color: rgba(168, 184, 212, 0.75);
  font-size: 0.9rem;
}

.course-level {
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(77, 125, 223, 0.6);
  background: rgba(14, 39, 94, 0.72);
  color: #4f91ff;
  font-size: 0.92rem;
  font-weight: 600;
}

#courses .course-level {
  left: auto;
  right: 14px;
  top: 12px;
  bottom: auto;
}

.course-area {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(2, 10, 30, 0.82);
  color: #d5e0f6;
  font-size: 0.82rem;
  font-weight: 700;
}

.course-content {
  padding: 18px 18px 20px;
}

.course-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
  color: #e8edf8;
  transition: color 0.25s ease;
}

.course-desc {
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: #99a8c3;
}

.course-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.meta-item {
  color: #9aabc9;
  font-size: 1rem;
}

.meta-rating {
  color: #ffc14f;
}

.course-action {
  margin-top: 18px;
  width: 100%;
  border: 1px solid rgba(77, 125, 223, 0.2);
  border-radius: 14px;
  background: rgba(4, 10, 26, 0.95);
  color: #e8edf8;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.course-action:hover {
  background: rgba(8, 20, 52, 0.98);
}

.course-card:hover .course-title,
.course-card:focus-within .course-title,
.course-card:focus .course-title {
  color: #67dbff;
}

.course-card:hover .course-action,
.course-card:focus-within .course-action,
.course-card:focus .course-action {
  border-color: rgba(84, 194, 255, 0.65);
  background: linear-gradient(90deg, rgba(28, 74, 186, 0.72), rgba(38, 156, 216, 0.72));
  color: #f6fbff;
}

.course-actions-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.course-actions-row .course-action {
  margin-top: 0;
}

.course-secondary-action {
  border: 1px solid rgba(77, 125, 223, 0.24);
  border-radius: 14px;
  background: rgba(4, 10, 26, 0.82);
  color: #dbe6fb;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.course-secondary-action:hover {
  border-color: rgba(84, 194, 255, 0.65);
  color: #f6fbff;
  background: rgba(8, 20, 52, 0.96);
}

.shared-course-review-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 22, 0.72);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.shared-course-review-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.shared-course-review-card {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid rgba(66, 99, 176, 0.3);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(16, 24, 54, 0.98), rgba(8, 14, 35, 0.98));
  padding: 22px;
  display: grid;
  gap: 14px;
}

.shared-course-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shared-course-review-head h3,
.shared-course-review-head p {
  margin: 0;
}

.shared-course-review-head p {
  color: #9aabc9;
  margin-top: 6px;
}

.shared-course-review-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(66, 99, 176, 0.3);
  background: rgba(5, 11, 31, 0.72);
  color: #dbe6fb;
  font-size: 1.2rem;
  cursor: pointer;
}

.shared-course-review-stars {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shared-course-review-star {
  border: 0;
  background: transparent;
  color: rgba(255, 193, 79, 0.32);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.shared-course-review-star.is-active {
  color: #ffc14f;
}

.shared-course-review-field {
  display: grid;
  gap: 8px;
}

.shared-course-review-field label {
  color: #c8d6ee;
  font-size: 0.86rem;
  font-weight: 700;
}

.shared-course-review-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  border-radius: 14px;
  border: 1px solid rgba(66, 99, 176, 0.3);
  background: rgba(5, 11, 31, 0.72);
  color: #dbe6fb;
  padding: 12px;
  resize: vertical;
}

.shared-course-review-feedback {
  margin: 0;
  color: #9aabc9;
}

.shared-course-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.shared-course-review-submit,
.shared-course-review-cancel {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.shared-course-review-submit {
  border: 0;
  background: linear-gradient(90deg, #4f8ff8, #8450f2);
  color: #061024;
}

.shared-course-review-cancel {
  border: 1px solid rgba(66, 99, 176, 0.3);
  background: rgba(5, 11, 31, 0.72);
  color: #dbe6fb;
}

.shared-course-review-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 260;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid rgba(66, 176, 110, 0.45);
  border-radius: 10px;
  background: rgba(8, 36, 24, 0.95);
  color: #b8f3d1;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.shared-course-review-toast.open {
  opacity: 1;
  transform: translateY(0);
}

.courses-footer {
  margin-top: 56px;
  display: flex;
  justify-content: center;
}

.view-all-courses {
  border: 1px solid rgba(61, 213, 243, 0.45);
  background: rgba(11, 22, 48, 0.58);
  color: #36ddff;
  border-radius: 14px;
  padding: 14px 28px;
  min-width: 300px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
  max-width: 360px;
  font-size: 1rem;
  text-decoration: none;
}

.view-all-courses:hover {
  background: rgba(22, 48, 99, 0.7);
  border-color: rgba(61, 213, 243, 0.8);
  text-decoration: none;
}

.journey-card {
  border-radius: 18px;
  background: linear-gradient(120deg, #4888f3, #6d49f0);
  text-align: center;
  color: #020b1b;
  margin-top: 48px;
  padding: 52px 18px 40px;
}

.journey-icon {
  font-size: 3.2rem;
  line-height: 1;
}

.journey-card h3 {
  margin: 20px 0 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.15;
  font-weight: 800;
}

.journey-card p {
  margin: 18px auto 0;
  max-width: 880px;
  font-size: clamp(0.65rem, 1.8vw, 1.0rem);
  line-height: 1.45;
  opacity: 0.9;
}

.journey-action {
  margin-top: 30px;
  border: 0;
  border-radius: 14px;
  background: #030a1c;
  color: #2d8fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  font-size: 1.1rem;
  padding: 14px 26px;
}

.journey-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(2, 8, 26, 0.35);
}

/* PLANS */
.plans-section {
  padding-top: 72px;
}

.plans-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.52vw, 2.38rem);
  font-weight: 800;
}

.plans-header p {
  margin: 14px auto 0;
  max-width: 760px;
  color: #9aabc9;
  font-size: clamp(0.7rem, 1.26vw, 1.015rem);
}

.plans-compare {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.plan-card {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  padding: 34px 30px;
  border: 1px solid rgba(66, 99, 176, 0.28);
  background: linear-gradient(160deg, rgba(13, 22, 52, 0.95), rgba(8, 14, 36, 0.98));
  overflow: hidden;
}

.plan-card h3 {
  margin: 0;
  font-size: clamp(1.4rem, 1.96vw, 2.1rem);
  font-weight: 800;
  line-height: 1.08;
}

.plan-price {
  margin-top: 14px;
  color: #3f82ff;
  font-size: clamp(1.54rem, 2.8vw, 2.94rem);
  font-weight: 800;
  line-height: 1;
}

.plan-period {
  margin-top: 8px;
  color: #97a9c9;
  font-size: 1.4rem;
  line-height: 1;
}

.plan-features {
  margin-top: 28px;
  display: grid;
  gap: 14px;
  text-align: left;
}

.plan-features li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-left: 0;
  font-size: clamp(0.7rem, 1.05vw, 0.805rem);
  color: #d9e4f8;
  text-align: left;
}

.plan-features li::before {
  position: static;
  line-height: 1;
  font-size: 1.4rem;
  font-weight: 700;
}

.plan-features li.ok::before {
  content: "✓";
  color: #1ee88e;
}

.plan-features li.off {
  color: #8a9ab6;
}

.plan-features li.off::before {
  content: "✕";
  color: #8392b0;
}

.plan-card.featured {
  background: linear-gradient(150deg, #4c8dfa, #7552f3);
  color: #041028;
  border-color: rgba(120, 168, 255, 0.7);
  transform: translateY(-8px);
}

.plan-card.featured .plan-price,
.plan-card.featured .plan-period,
.plan-card.featured .plan-features li {
  color: #041028;
}

.plan-card.featured .plan-features li.ok::before {
  color: #1ee88e;
}

.plan-card.featured .plan-features li.off {
  color: rgba(4, 16, 40, 0.55);
}

.plan-card.featured .plan-features li.off::before {
  color: rgba(4, 16, 40, 0.55);
}

.plan-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0);
  background: #ffb100;
  color: #061024;
  font-size: 0.665rem;
  font-weight: 800;
  border-radius: 0 0 14px 14px;
  padding: 8px 22px;
}

.plan-select {
  margin-top: 26px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(66, 205, 255, 0.45);
  background: rgba(6, 15, 36, 0.94);
  color: #3dd5f3;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.plan-select:hover {
  border-color: rgba(66, 205, 255, 0.8);
  background: rgba(12, 29, 70, 0.95);
}

.plan-card.featured .plan-select {
  border-color: rgba(4, 16, 40, 0.22);
  background: #051126;
  color: #3f82ff;
}

.plan-card.featured .plan-select:hover {
  border-color: rgba(4, 16, 40, 0.45);
  background: #091a38;
}

/* BUTTONS */
.btn {
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 16px;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #000;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--secondary);
  color: var(--secondary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--text);
}

.footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

.chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 135;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 0;
  background: #4586ec;
  color: #061024;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(69, 134, 236, 0.45);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(69, 134, 236, 0.6);
}

.chat-fab svg {
  width: 30px;
  height: 30px;
}

.chat-modal {
  position: fixed;
  right: 24px;
  bottom: 112px;
  z-index: 150;
  width: min(390px, calc(100vw - 24px));
  height: 500px;
  border: 1px solid rgba(66, 99, 176, 0.32);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(16, 24, 54, 0.96), rgba(8, 14, 35, 0.98));
  box-shadow: 0 0 30px rgba(69, 134, 236, 0.3);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-modal.minimized {
  height: 62px;
}

.chat-modal.minimized .chat-modal-body {
  display: none;
}

.chat-modal-head {
  min-height: 62px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-modal-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-modal-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f8ff8, #8450f2);
  color: #061024;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-modal-avatar svg {
  width: 16px;
  height: 16px;
}

.chat-modal-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.chat-modal-controls {
  display: flex;
  gap: 4px;
}

.chat-icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chat-icon-btn svg {
  width: 16px;
  height: 16px;
}

.chat-modal-body {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-modal-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
}

.chat-msg {
  max-width: 84%;
  width: fit-content;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  justify-items: start;
  align-items: start;
  gap: 6px;
}

.chat-msg p {
  margin: 0;
  display: inline-block;
  width: auto;
  max-width: 100%;
  align-self: start;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg span {
  font-size: 0.72rem;
  opacity: 0.7;
  justify-self: end;
}

.chat-msg.ai {
  justify-self: start;
  background: rgba(90, 110, 154, 0.28);
}

.chat-msg.user {
  justify-self: end;
  background: linear-gradient(90deg, #4f8ff8, #8450f2);
  color: #061024;
}

.chat-modal-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-modal-form input {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(74, 102, 180, 0.35);
  background: rgba(4, 10, 29, 0.85);
  color: #dbe6fb;
  padding: 0 10px;
}

.chat-modal-form input::placeholder {
  color: #8fa5cb;
}

.chat-modal-form button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #4f8ff8, #8450f2);
  color: #061024;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-modal-form button svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 900px) {
  .sidebar {
    z-index: 120;
  }

  #header-slot {
    z-index: 90;
  }

  .page-content,
  .sidebar-hidden .page-content {
    margin-left: var(--sidebar-width-collapsed);
  }

  .sidebar-full-hidden .page-content {
    margin-left: 0;
  }

  .brand p,
  .profile-btn span {
    display: none;
  }

  .home-hero {
    padding-top: 40px;
  }

  .home-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .course-media {
    height: 160px;
  }

  .course-title {
    font-size: 1.9rem;
  }

  .plans-compare {
    grid-template-columns: 1fr;
  }

  .plan-card {
    padding: 28px 22px;
  }

  .plan-price {
    font-size: 2.6rem;
  }

  .plan-period {
    font-size: 1.5rem;
  }

  .section {
    padding: 60px 20px;
  }

  .chat-fab {
    width: 60px;
    height: 60px;
    right: 16px;
    bottom: 16px;
  }

  .chat-fab svg {
    width: 24px;
    height: 24px;
  }

  .chat-modal {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 86px;
    height: min(520px, calc(100vh - 110px));
  }
}
