:root {
  --bg: #0b0c10;
  --card: #14161d;
  --muted: #c6cedd;
  --accent: #e50914;
  --line: #222634;
  --text: #f8fbff;
  --heading: #ffffff;
  --focus-ring: #8fb3ff;
  --disabled-bg: #2a3040;
  --disabled-text: #a9b1c2;
}

html { scroll-behavior: smooth; }
body { background: radial-gradient(circle at top, #171b27 0%, var(--bg) 45%) !important; color: var(--text) !important; letter-spacing: 0; }
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  background: #ffffff;
  color: #0f1117;
  padding: .5rem .75rem;
  border-radius: 8px;
  z-index: 1200;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}
a { color: #dce6ff; }
a:hover { color: #ffffff; }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring) !important;
  outline-offset: 2px;
}
p, li, label, small, span { color: inherit; }
.text-secondary { color: var(--muted) !important; }
h1, h2, h3, h4, h5, h6 { color: var(--heading); }

.container, .container-fluid { color: var(--text); }

.card.bg-black,
.card.bg-dark,
.card {
  color: var(--text);
  border-color: #32384a !important;
}

.card .card-title,
.card h5,
.card h6 { color: #ffffff; }

.list-group-item {
  color: #f3f7ff !important;
  border-color: #32384a !important;
}

.glass-nav {
  background: rgba(8, 9, 13, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  min-height: 72px;
}

.nav-brand-strong {
  font-weight: 800;
  letter-spacing: .4px;
}

.brand-logo {
  height: 56px;
  width: auto;
  display: block;
}

.login-brand {
  display: block;
  width: min(100%, 300px);
  height: auto;
  margin: 0 auto .5rem;
}

.login-page-container {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #4a5268;
}

.hero {
  min-height: 68vh;
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  overflow: hidden;
  margin: 1.25rem;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .45);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .52) 46%, rgba(0, 0, 0, .25) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, .52), rgba(0, 0, 0, .12));
}

.hero-content { max-width: 640px; padding: 4.2rem 3.2rem; }
.hero-title { font-weight: 800; font-size: clamp(2rem, 3.8vw, 3.8rem); line-height: 1.04; }
.hero-copy { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }

.section-wrap { padding: .25rem 1.25rem 1.25rem; }
.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 1.8rem 0 .85rem;
  padding-left: .1rem;
}

.scroll-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding: .35rem .2rem .7rem;
}
.scroll-row::-webkit-scrollbar { height: 9px; }
.scroll-row::-webkit-scrollbar-thumb { background: #2f3545; border-radius: 999px; }

.course-card {
  min-width: 284px;
  width: 284px;
  background: var(--card);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  transition: transform .32s cubic-bezier(.2, .7, .2, 1), box-shadow .32s ease, border-color .32s ease;
}

.course-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(5, 6, 9, .85) 100%);
  opacity: .7;
  pointer-events: none;
}

.course-card img {
  width: 100%;
  height: 164px;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .45s ease;
}

.course-card .card-body-mini {
  position: relative;
  z-index: 1;
  padding: .85rem .95rem 1rem;
}

.course-card .card-title-mini {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.progress-mini {
  height: 6px;
  background: #2b3140;
  border-radius: 999px;
}

.course-card:hover {
  transform: translateY(-7px) scale(1.035);
  border-color: #383f52;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .52);
  z-index: 2;
}
.course-card:focus-visible {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(143, 179, 255, 0.3);
}

.course-card:hover img { transform: scale(1.08); }

.skeleton-row {
  height: 196px;
  margin: 14px 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #151922, #232938, #151922);
  background-size: 220% 100%;
  animation: pulse 1.1s infinite linear;
}
@keyframes pulse { to { background-position: -220% 0; } }

.list-group-item:hover {
  background: #1b1f2a !important;
  transition: background-color .2s ease;
}

.btn-outline-light {
  color: #eef3ff;
  border-color: #8d97ad;
}

.btn-outline-light:hover {
  color: #0f1117;
  background: #f1f5ff;
  border-color: #f1f5ff;
}
.btn-danger:hover { filter: brightness(1.05); }
.btn[disabled],
.btn.disabled,
button:disabled {
  opacity: 1 !important;
  background: var(--disabled-bg) !important;
  color: var(--disabled-text) !important;
  border-color: #4a5368 !important;
  cursor: not-allowed;
}

.form-control,
.form-select {
  background-color: #151922 !important;
  color: #f5f8ff !important;
  border: 1px solid #3a4155 !important;
}

.form-control::placeholder { color: #b6bfd1 !important; }
.form-control:focus,
.form-select:focus {
  color: #ffffff !important;
  background-color: #1a1f2c !important;
  border-color: #5d6b8a !important;
  box-shadow: 0 0 0 .2rem rgba(105, 129, 182, 0.2) !important;
}
.form-control:disabled,
.form-select:disabled {
  background-color: #202531 !important;
  color: var(--disabled-text) !important;
  border-color: #3b4357 !important;
}

.badge { color: #ffffff; }
.progress { background-color: #2b3140; }

.password-strength {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #2b3140;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 10%;
  background: #ef4444;
  transition: width .25s ease, background-color .25s ease;
}

.profile-shell { max-width: 860px; }
.profile-card {
  background: linear-gradient(160deg, #151923, #10131b);
  border: 1px solid #2f3545;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, .35);
}

.profile-avatar-form {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1rem;
  align-items: center;
}

.profile-avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #4a5268;
}

.avatar-editor {
  background: #121722;
  border: 1px solid #2f3545;
  border-radius: 10px;
  padding: .75rem;
}

.admin-kpi-card {
  background: linear-gradient(165deg, #151923, #0f131b);
  border: 1px solid #2f3545;
  border-radius: 12px;
  padding: .8rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.admin-kpi-card small {
  color: #aeb7c9;
}

.admin-kpi-card strong {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.admin-tabs .nav-link {
  border: 1px solid #3a4155;
  color: #d7def0;
  background: #121722;
}

.admin-tabs .nav-link.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 88px;
  background: linear-gradient(165deg, #121722, #0e131c);
  border: 1px solid #2f3545;
  border-radius: 12px;
  padding: .9rem;
}

.admin-sidebar-title {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9ba7bf;
  margin-bottom: .7rem;
}

.admin-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.admin-side-link {
  width: 100%;
  text-align: left;
  border: 1px solid #3a4155;
  border-radius: 10px;
  background: #121722;
  color: #d7def0;
  padding: .62rem .72rem;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.admin-side-link-content {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.admin-side-link-content svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.admin-side-link:hover {
  border-color: #5c6681;
  background: #171d2b;
  color: #ffffff;
}

.admin-side-link.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.admin-main-content {
  min-width: 0;
}

/* Consistencia visual no painel admin (sem alterar estrutura/layout) */
.admin-main-content .card {
  border-radius: 8px;
}

.admin-main-content .form-label {
  margin-bottom: .35rem;
  font-weight: 600;
  color: #e9eefb !important;
  display: block;
  line-height: 1.2;
}

.admin-main-content .form-control,
.admin-main-content .form-select {
  min-height: 42px;
}

.admin-main-content textarea.form-control {
  min-height: 100px;
}

.admin-main-content .btn {
  min-height: 42px;
}

.admin-main-content .btn.btn-sm {
  min-height: 34px;
}

.admin-main-content small.text-secondary {
  display: block;
  margin-top: .25rem;
  line-height: 1.25;
}

.admin-main-content .form-check-label {
  color: #e9eefb !important;
}

/* Destaque tipografico da pagina de editor de curso */
.admin-editor-title {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  font-weight: 800;
  letter-spacing: 0;
  color: #ffffff;
  margin-bottom: 0;
}

.admin-editor-section-title {
  font-size: 1.3rem;
  font-weight: 750;
  color: #f8fbff;
  margin-bottom: .8rem;
}

.admin-editor-block-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: .7rem;
}

.admin-editor-accordion-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.lesson-accordion-button::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: .6rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  color: #7ef08a;
  border: 1px solid #2f7d39;
  border-radius: 50%;
  background: rgba(23, 89, 38, 0.22);
}

.lesson-accordion-button:not(.collapsed)::before {
  content: "-";
}

.lesson-accordion-button::after {
  display: none !important;
}

.course-cover-preview {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #3a4155;
}

.validation-slot {
  min-height: 1.25rem;
}

@media (max-width: 768px) {
  .profile-avatar-form {
    grid-template-columns: 1fr;
  }
  .profile-avatar-preview {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 992px) {
  .hero { min-height: 56vh; margin: 1rem; }
  .hero-content { padding: 2.6rem 1.3rem; max-width: 92%; }
  .section-wrap { padding: .1rem .75rem 1rem; }
  .course-card { min-width: 236px; width: 236px; }
  .course-card img { height: 142px; }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
  }
  .admin-sidebar-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
