:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #14213d;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0f766e;
  --border: #dbe4f0;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: white;
  padding-bottom: 4rem;
}

.site-header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  font-weight: 800;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: 80px;
  width: auto;
}

.brand span {
  color: var(--primary);
}

@media (max-width: 640px) {
  .brand img {
    height: 56px;
  }
}

.nav-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.nav-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-link.active {
  color: var(--primary);
}

.hero-content,
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  padding: 3rem 0 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  font-weight: 700;
  color: #bfdbfe;
  margin-bottom: 0.4rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.7rem;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.15;
}

.hero-text {
  color: #dbeafe;
  max-width: 620px;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.hero-card,
.panel,
.card,
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 1.5rem;
  color: var(--text);
}

.hero-card ul {
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.hero-image {
  height: 280px;
  object-fit: cover;
  border-radius: 24px;
}

.page-shell {
  padding: 2rem 0 4rem;
}

.section {
  padding: 4rem 0 0;
}

.section-stack {
  padding-top: 2rem;
}

.section-title,
.section-header {
  margin-bottom: 1.3rem;
}

.section-title .eyebrow,
.section-header .eyebrow {
  color: var(--accent);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feature-card img {
  height: 200px;
  object-fit: cover;
}

.feature-card > div {
  padding: 1rem 1.2rem 1.2rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.card {
  padding: 1.3rem;
}

.course-card {
  display: block;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: #93c5fd;
}

.card-link,
.back-link {
  color: var(--primary-dark);
  font-weight: 700;
}

.card-link {
  display: inline-block;
  margin-top: 0.5rem;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.badge,
.type-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.type-pill {
  background: #dbeafe;
  color: var(--primary-dark);
}

.badge {
  background: #ecfeff;
  color: var(--accent);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.8rem 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1.2rem;
}

.panel {
  padding: 1.3rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

label {
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font: inherit;
  background: #f8fafc;
}

fieldset {
  margin: 0.5rem 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

legend {
  padding: 0 0.35rem;
  font-weight: 700;
}

.check-list {
  display: grid;
  gap: 0.55rem;
}

.check-option {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-weight: 500;
}

.check-option input {
  width: auto;
  margin-top: 0.35rem;
}

.enrollment-form {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.form-feedback {
  min-height: 1.5rem;
  margin: 0.4rem 0 0;
  color: var(--accent);
  font-weight: 700;
}

.btn-full {
  width: 100%;
  margin-top: 0.35rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.95rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.admin-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.action-btn.edit {
  background: #dbeafe;
  color: var(--primary-dark);
}

.action-btn.delete {
  background: #fee2e2;
  color: #b91c1c;
}

.action-btn.lessons {
  background: #ccfbf1;
  color: #115e59;
}

.lesson-summary {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.lesson-manager {
  scroll-margin-top: 1rem;
}

.lesson-manager .eyebrow {
  color: var(--accent);
  margin: 0;
}

.panel-note,
.course-description {
  color: var(--muted);
}

.course-author {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lesson-form {
  margin-top: 1.3rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--border);
}

.lesson-fields {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1rem;
}

.lesson-fields > div {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.lesson-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.lesson-list,
.public-lesson-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.lesson-item,
.public-lesson {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
}

.lesson-number {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  background: #dbeafe;
  color: var(--primary-dark);
  font-weight: 800;
}

.lesson-copy p {
  margin: 0.25rem 0 0.65rem;
  color: var(--muted);
}

.course-heading {
  padding: 1rem 0 2.4rem;
  max-width: 760px;
}

.course-heading .type-pill {
  margin-top: 1.4rem;
}

.course-heading h1 {
  margin-top: 0.8rem;
}

.course-content {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.resource-frame {
  aspect-ratio: 16 / 9;
  max-width: 760px;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
}

.resource-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.resource-link {
  display: inline-flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.empty-state {
  padding: 1rem;
  color: var(--muted);
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed var(--border);
}

.footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
}

.footer-content {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

@media (max-width: 900px) {
  .hero-content,
  .hero-grid,
  .feature-grid,
  .cards-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    gap: 0.4rem;
  }

  .hero-content {
    padding-top: 2rem;
  }

  .lesson-fields,
  .lesson-item,
  .public-lesson {
    grid-template-columns: 1fr;
  }

  .lesson-item .actions {
    justify-content: flex-start;
  }
}

/* ---- Autenticação / navegação ---- */
.nav-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding-left: 0.9rem;
  border-left: 1px solid var(--border);
}

.nav-user {
  font-weight: 700;
  color: var(--text);
}

.hero .nav-auth {
  border-left-color: rgba(255, 255, 255, 0.25);
}

.hero .nav-user {
  color: #fff;
}

.auth-shell {
  max-width: 460px;
  margin: 0 auto;
}

.auth-shell h1 {
  margin-top: 1rem;
}

.auth-alt {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
}

.form-feedback[data-tone='error'] {
  color: #b91c1c;
}

/* ---- Painel de matrículas ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.table-panel {
  padding: 0.6rem;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 1.2rem;
}

.muted-line {
  color: var(--muted);
  font-size: 0.85rem;
}

.row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.detail-actions {
  margin: 1rem 0;
}

.pill-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin-right: 0.3rem;
}

.status-ativa,
.parcela-paga {
  background: #dcfce7;
  color: #15803d;
}

.status-inativa {
  background: #fee2e2;
  color: #b91c1c;
}

.parcela-pendente {
  background: #e0e7ff;
  color: #3730a3;
}

.parcela-atrasada {
  background: #fef3c7;
  color: #b45309;
}

.content-gate {
  text-align: left;
}

.content-gate .hero-actions {
  margin-top: 1rem;
}

