/* ==========================================================================
   Malta UP — design system
   Base: Bootstrap 5.3 (local). Aqui ficam tokens, tema claro/escuro e os
   componentes compartilhados pelo site público, área do aluno e painel.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url("../fonts/Inter-roman.var.66c6e4088364.woff2") format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root,
[data-bs-theme="light"] {
  --brand: #d4202a;
  --brand-600: #b3141d;
  --brand-700: #8f0f16;
  --brand-rgb: 212, 32, 42;
  --brand-soft: #fdecec;
  --ink: #111827;
  --muted: #6b7280;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eef0f3;
  --border: #e5e7eb;
  --ring: rgba(var(--brand-rgb), .25);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06), 0 1px 3px rgba(17, 24, 39, .08);
  --shadow: 0 4px 12px rgba(17, 24, 39, .06), 0 12px 32px rgba(17, 24, 39, .06);
  --shadow-lg: 0 20px 50px rgba(17, 24, 39, .14);
  --radius: 14px;
  --radius-lg: 20px;
  --header-h: 68px;

  --bs-body-bg: var(--surface-2);
  --bs-body-color: var(--ink);
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-600);
  --bs-link-hover-color-rgb: 179, 20, 29;
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-3);
  --bs-emphasis-color: var(--ink);
  --bs-border-radius: 10px;
  --bs-border-radius-lg: var(--radius);
  --bs-focus-ring-color: var(--ring);
}

[data-bs-theme="dark"] {
  --brand: #ef4444;
  --brand-600: #dc2626;
  --brand-700: #b91c1c;
  --brand-rgb: 239, 68, 68;
  --brand-soft: rgba(239, 68, 68, .14);
  --ink: #e5e7eb;
  --muted: #9ca3af;
  --surface: #151a22;
  --surface-2: #0d1117;
  --surface-3: #1d2430;
  --border: #262e3b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);

  --bs-body-bg: var(--surface-2);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-3);
  --bs-emphasis-color: #f9fafb;
  --bs-secondary-bg: var(--surface-3);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--bs-body-font-family);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.02em; font-weight: 700; color: var(--bs-emphasis-color); }
.text-balance { text-wrap: balance; }
.line-clamp-2, .line-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }
.text-brand { color: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }
.fw-semibold { font-weight: 600 !important; }
.small-caps { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.visually-hidden-focusable:focus { position: fixed; top: 8px; left: 8px; z-index: 2000; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }
::selection { background: rgba(var(--brand-rgb), .2); }

/* ----- Botões -------------------------------------------------------------- */
.btn { font-weight: 600; border-radius: 10px; padding: .55rem 1.1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-sm { padding: .35rem .75rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.5rem; border-radius: 12px; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), .25);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-600); --bs-btn-active-border-color: var(--brand-600);
}
.btn-soft { background: var(--surface-3); color: var(--ink); border: 1px solid var(--border); }
.btn-soft:hover { background: var(--border); color: var(--ink); }
.btn-ghost { background: transparent; border: 0; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading::before {
  content: ""; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Formulários --------------------------------------------------------- */
.form-control, .form-select {
  border-radius: 10px; padding: .6rem .85rem; background-color: var(--surface);
  border-color: var(--border); color: var(--ink);
}
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem var(--ring); background-color: var(--surface); color: var(--ink); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem var(--ring); border-color: var(--brand); }
.input-group-text { background: var(--surface-3); border-color: var(--border); color: var(--muted); }
.password-field { position: relative; }
.password-field .form-control { padding-right: 2.75rem; }
.password-field .toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); }
.password-rules { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .25rem .75rem; font-size: .82rem; color: var(--muted); }
.password-rules li::before { content: "○"; margin-right: .4rem; }
.password-rules li.ok { color: #16a34a; }
.password-rules li.ok::before { content: "●"; }
.dropzone {
  position: relative; border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 1.75rem 1rem; text-align: center; background: var(--surface); transition: .2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.has-file { border-style: solid; border-color: #16a34a; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { font-size: 2rem; color: var(--brand); }
.fieldset-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.fieldset-card + .fieldset-card { margin-top: 1rem; }
.fieldset-card > h2, .fieldset-card > h3 { font-size: 1rem; margin-bottom: 1rem; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice label { display: block; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); font-weight: 500; transition: .15s; }
.choice input:checked + label { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.choice input:focus-visible + label { box-shadow: 0 0 0 .2rem var(--ring); }

/* ----- Cartões ------------------------------------------------------------- */
.card { --bs-card-bg: var(--surface); --bs-card-border-color: var(--border); --bs-card-border-radius: var(--radius); --bs-card-cap-bg: transparent; box-shadow: var(--shadow-sm); }
.card-header { border-bottom-color: var(--border); padding: 1rem 1.25rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.course-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  color: inherit; text-decoration: none;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .35); color: inherit; }
.course-card .thumb { position: relative; aspect-ratio: 16 / 10; background: var(--surface-3); overflow: hidden; }
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.course-card:hover .thumb img { transform: scale(1.04); }
.course-card .thumb .placeholder-thumb { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.5rem; color: var(--muted); background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); }
.course-card .badges { position: absolute; top: .75rem; left: .75rem; right: .75rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.course-card .body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.course-card h3 { font-size: 1.02rem; margin: 0; line-height: 1.35; }
.course-card .meta { display: flex; gap: .9rem; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.course-card .footer { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.course-card.highlight { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .18); }
.price { font-weight: 800; font-size: 1.1rem; color: var(--bs-emphasis-color); white-space: nowrap; }
.price small { font-weight: 600; color: var(--muted); font-size: .75rem; }
.price.free { color: #16a34a; }

.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: rgba(17, 24, 39, .72); color: #fff; backdrop-filter: blur(6px); }
.chip-brand { background: var(--brand); }
.chip-success { background: #16a34a; }
.chip-light { background: var(--surface-3); color: var(--ink); backdrop-filter: none; }

.badge-soft { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-soft.success { background: rgba(22, 163, 74, .12); color: #15803d; }
.badge-soft.warning { background: rgba(234, 179, 8, .16); color: #a16207; }
.badge-soft.danger { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.badge-soft.info { background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.badge-soft.neutral { background: var(--surface-3); color: var(--muted); }
[data-bs-theme="dark"] .badge-soft.success { color: #4ade80; }
[data-bs-theme="dark"] .badge-soft.warning { color: #facc15; }
[data-bs-theme="dark"] .badge-soft.danger { color: #f87171; }
[data-bs-theme="dark"] .badge-soft.info { color: #60a5fa; }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: flex; gap: 1rem; align-items: center; box-shadow: var(--shadow-sm); height: 100%; }
.stat-card .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.stat-card .icon.green { background: rgba(22, 163, 74, .12); color: #16a34a; }
.stat-card .icon.blue { background: rgba(37, 99, 235, .12); color: #2563eb; }
.stat-card .icon.amber { background: rgba(234, 179, 8, .16); color: #ca8a04; }
.stat-card .label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-card .value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--bs-emphasis-color); }

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty-state .icon { font-size: 2.5rem; color: var(--brand); opacity: .8; }
.empty-state h3 { font-size: 1.1rem; margin: .75rem 0 .35rem; color: var(--bs-emphasis-color); }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem; flex-shrink: 0; overflow: hidden; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-xl { width: 112px; height: 112px; font-size: 2rem; }

.progress { --bs-progress-bar-bg: var(--brand); --bs-progress-bg: var(--surface-3); height: .55rem; border-radius: 999px; }

/* ----- Tabelas ------------------------------------------------------------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--border); --bs-table-hover-bg: var(--surface-2); margin: 0; }
.table > thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--surface-2); border-bottom-width: 1px; white-space: nowrap; }
.table td, .table th { padding: .8rem 1rem; vertical-align: middle; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-card .table-responsive { margin: 0; }
.row-link { cursor: pointer; }
.thumb-sm { width: 56px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-3); }

/* ----- Paginação ----------------------------------------------------------- */
.pagination { --bs-pagination-color: var(--ink); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-hover-bg: var(--surface-3); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-disabled-bg: var(--surface); --bs-pagination-focus-box-shadow: 0 0 0 .2rem var(--ring); gap: .25rem; }
.pagination .page-link { border-radius: 8px !important; }

/* ----- Alertas / toasts ---------------------------------------------------- */
.alert { border-radius: var(--radius); border-width: 1px; }
.toast-stack { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 32px)); }
.toast { --bs-toast-bg: var(--surface); --bs-toast-border-color: var(--border); --bs-toast-border-radius: 12px; box-shadow: var(--shadow-lg); }
.toast .toast-body { display: flex; gap: .65rem; align-items: flex-start; }
.toast .toast-icon { font-size: 1.15rem; line-height: 1.3; }
.toast.success .toast-icon { color: #16a34a; }
.toast.error .toast-icon { color: #dc2626; }
.toast.warning .toast-icon { color: #ca8a04; }
.toast.info .toast-icon { color: #2563eb; }

/* ----- Cabeçalho do site --------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 1030; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.site-header .navbar { min-height: var(--header-h); padding: .5rem 0; }
.site-header .brand img { height: 34px; width: auto; max-width: 180px; object-fit: contain; }
.site-header .brand-text { font-weight: 800; font-size: 1.15rem; color: var(--bs-emphasis-color); }
.site-header .nav-link { font-weight: 600; font-size: .92rem; color: var(--muted); padding: .5rem .8rem !important; border-radius: 8px; display: inline-flex; gap: .4rem; align-items: center; }
.site-header .nav-link:hover { color: var(--ink); background: var(--surface-3); }
.site-header .nav-link.active { color: var(--brand); background: var(--brand-soft); }
.site-header .user-btn { display: inline-flex; align-items: center; gap: .55rem; border: 1px solid var(--border); background: var(--surface); padding: .25rem .6rem .25rem .25rem; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: .9rem; }
.site-header .user-btn:hover { border-color: rgba(var(--brand-rgb), .4); }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--border); --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--surface-3); --bs-dropdown-link-active-bg: var(--brand); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; font-size: .92rem; }
.dropdown-item i { color: var(--muted); width: 1.1rem; text-align: center; }
.offcanvas { --bs-offcanvas-bg: var(--surface); }
.theme-toggle .bi-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle .bi-sun { display: inline; }
[data-bs-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }
[data-bs-theme="dark"] .logo-light-only { display: none !important; }

/* Barra da área do aluno */
.student-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.student-bar .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: .25rem; }
.student-bar .nav::-webkit-scrollbar { display: none; }
.student-bar .nav-link { white-space: nowrap; color: var(--muted); font-weight: 600; font-size: .9rem; padding: .85rem .9rem; border-bottom: 2px solid transparent; border-radius: 0; display: flex; gap: .45rem; align-items: center; }
.student-bar .nav-link:hover { color: var(--ink); }
.student-bar .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ----- Seções / hero ------------------------------------------------------- */
.section { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: .35rem .75rem; border-radius: 999px; }
.section-title { font-size: clamp(1.6rem, 2.5vw, 2.2rem); margin: .75rem 0 .5rem; }
.section-lead { color: var(--muted); font-size: 1.05rem; max-width: 640px; }
.hero { position: relative; overflow: hidden; padding: 4.5rem 0 3.5rem; }
/* Fundo com brilho da marca cobrindo sempre a tela inteira (fixo durante a rolagem) */
body:not(.admin-body) {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(var(--brand-rgb), .16), transparent 60%),
    radial-gradient(900px 500px at -10% 105%, rgba(var(--brand-rgb), .09), transparent 60%),
    var(--surface-2);
  background-attachment: fixed;
  min-height: 100vh;
}
.carousel-caption { left: 0; right: 0; bottom: 0; padding: 2.5rem 1.5rem 1.25rem; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.banner-carousel .carousel-indicators { margin-bottom: .5rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.08; letter-spacing: -.035em; }
.hero .lead { color: var(--muted); font-size: 1.15rem; }
.hero-media { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 9; background: var(--surface-3); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.banner-carousel .carousel-item img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; }
@media (max-width: 767.98px) { .banner-carousel .carousel-item img { aspect-ratio: 4 / 5; } }
.banner-carousel { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.feature { padding: 1.5rem; height: 100%; }
.feature .icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 1.35rem; margin-bottom: 1rem; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); margin: 0; }
.cta-band { background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; border-radius: var(--radius-lg); padding: 2.5rem; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; }
.cta-band .btn-light { color: var(--brand-700); }

.page-hero { padding: 2.5rem 0 1.5rem; }
.page-hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.page-hero p { color: var(--muted); margin: .4rem 0 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0; }
.page-head p { color: var(--muted); margin: .25rem 0 0; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar .search { position: relative; flex: 1 1 240px; }
.filter-bar .search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filter-bar .search .form-control { padding-left: 2.4rem; }
.pill-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill-filters a, .pill-filters label { padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.pill-filters a.active, .pill-filters input:checked + label { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill-filters input { display: none; }

/* Página de curso */
.course-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 2.5rem 0; }
.course-cover { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-3); box-shadow: var(--shadow); }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.fact { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; }
.fact .k { font-size: .75rem; color: var(--muted); font-weight: 600; }
.fact .v { font-weight: 700; }
.checkout-card { position: sticky; top: calc(var(--header-h) + 1rem); }
.pix-box { text-align: center; }
.pix-box .qr { background: #fff; padding: .75rem; border-radius: 14px; display: inline-block; border: 1px solid var(--border); }
.pix-box .qr img { width: 220px; height: 220px; image-rendering: pixelated; }
.pix-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; word-break: break-all; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: .75rem; max-height: 5.5rem; overflow: auto; text-align: left; }
.prose { color: var(--ink); line-height: 1.7; }
.prose p { margin-bottom: 1rem; }
.post-conteudo { font-size: 1.08rem; }
.post-conteudo h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; }
.post-conteudo h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.post-conteudo ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.post-conteudo li { margin-bottom: .35rem; }
.post-conteudo blockquote { border-left: 4px solid var(--brand); padding: .5rem 1rem; margin: 1.25rem 0; background: var(--surface); border-radius: 0 10px 10px 0; color: var(--muted); font-style: italic; }
.post-conteudo a { text-decoration: underline; text-underline-offset: 3px; }

/* Currículo / perfil */
.profile-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1.25rem 1.5rem; border-left: 2px solid var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }

/* ----- Rodapé -------------------------------------------------------------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-top: 3rem; font-size: .92rem; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.site-footer .brand img { height: 36px; max-width: 180px; object-fit: contain; }
.social { display: flex; gap: .5rem; }
.social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink); font-size: 1.05rem; }
.social a:hover { background: var(--brand); color: #fff; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.25rem; color: var(--muted); font-size: .85rem; }

/* ----- Autenticação -------------------------------------------------------- */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } }
.auth-aside { display: none; position: relative; padding: 3rem; color: #fff; background: radial-gradient(800px 400px at 0% 0%, rgba(255,255,255,.14), transparent 60%), linear-gradient(145deg, var(--brand), var(--brand-700) 70%, #3a0508); }
@media (min-width: 992px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside h2 { color: #fff; font-size: 2.2rem; line-height: 1.15; }
.auth-aside ul { list-style: none; padding: 0; display: grid; gap: .8rem; }
.auth-aside li { display: flex; gap: .6rem; align-items: flex-start; opacity: .95; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 720px; }
.auth-card h1 { font-size: 1.7rem; }
.divider-text { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; margin: 1.25rem 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.steps { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.steps span { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-3); }
.steps span.on { background: var(--brand); }

/* ----- Páginas de erro ----------------------------------------------------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(900px 500px at 50% -10%, rgba(var(--brand-rgb), .14), transparent 60%), var(--surface-2); }
.error-card { max-width: 560px; text-align: center; }
.error-code { font-size: clamp(5rem, 16vw, 8.5rem); font-weight: 900; letter-spacing: -.06em; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--brand-700)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-card .logo { height: 36px; margin-bottom: 2rem; }
.error-card p { color: var(--muted); font-size: 1.05rem; }

/* ==========================================================================
   Painel administrativo
   ========================================================================== */
.admin-body { background: var(--surface-2); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 264px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); }
@media (min-width: 992px) {
  .admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .admin-sidebar.offcanvas-lg { visibility: visible; transform: none; }
}
.admin-sidebar .sidebar-brand { height: 64px; display: flex; align-items: center; padding: 0 1.25rem; border-bottom: 1px solid var(--border); }
.admin-sidebar .sidebar-brand img { height: 30px; max-width: 170px; object-fit: contain; }
.admin-nav { padding: 1rem .75rem 2rem; }
.admin-nav .section-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 1rem .75rem .4rem; }
.admin-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: .92rem; text-decoration: none; margin-bottom: 2px; }
.admin-nav a i { font-size: 1.05rem; color: var(--muted); width: 1.25rem; text-align: center; }
.admin-nav a:hover { background: var(--surface-3); }
.admin-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.admin-nav a.active i { color: var(--brand); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 1020; height: 64px; display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.admin-topbar .crumbs { font-size: .85rem; color: var(--muted); }
.admin-topbar .crumbs a { color: var(--muted); text-decoration: none; }
.admin-topbar .crumbs a:hover { color: var(--brand); }
.admin-topbar .crumbs .current { color: var(--ink); font-weight: 600; }
.admin-content { padding: 1.5rem 1.25rem 3rem; max-width: 1400px; width: 100%; margin: 0 auto; }
@media (min-width: 992px) { .admin-content { padding: 2rem 2rem 3rem; } }
.notif-dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.notif-menu { width: 340px; max-height: 420px; overflow-y: auto; }
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: .5rem 1rem; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }
.chart-box { position: relative; height: 280px; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--surface-2) 92%, transparent); backdrop-filter: blur(6px); padding: 1rem 0; border-top: 1px solid var(--border); margin-top: 1.5rem; display: flex; gap: .5rem; justify-content: flex-end; z-index: 5; }
.image-preview { border-radius: 12px; border: 1px solid var(--border); background: var(--surface-3); max-height: 180px; object-fit: contain; width: 100%; }
.check-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: .5rem; background: var(--surface); }
.check-list .form-check { padding: .45rem .5rem .45rem 2.2rem; border-radius: 8px; margin: 0; }
.check-list .form-check:hover { background: var(--surface-3); }

/* Impressão */
@media print {
  .site-header, .student-bar, .site-footer, .admin-sidebar, .admin-topbar, .toast-stack { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* ==========================================================================
   Home: carrossel + introdução (mobile primeiro)
   ========================================================================== */
.home-hero { padding: .75rem 0 2rem; }
.home-carousel { border-radius: 16px; overflow: hidden; background: var(--surface-3); box-shadow: var(--shadow); isolation: isolate; }
.home-carousel .carousel-inner { aspect-ratio: 16 / 10; }
.home-carousel .carousel-item { height: 100%; position: relative; overflow: hidden; }
.home-carousel .carousel-item img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.home-carousel picture { display: block; height: 100%; }
/* Banner tem texto embutido: nunca corta. A sobra vira a própria arte desfocada. */
.home-carousel [data-slide="banner"]::before {
  content: ""; position: absolute; inset: -24px; z-index: 0;
  background: var(--fundo) center / cover no-repeat; filter: blur(22px) saturate(1.2); opacity: .75;
}
.home-carousel [data-slide="banner"] img { object-fit: contain; }
.home-carousel [data-slide="curso"]::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,0) 100%);
}
.home-carousel .slide-conteudo { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 1rem 1rem 2.1rem; color: #fff; }
.home-carousel .slide-conteudo h2 { color: #fff; font-size: 1.15rem; margin: .4rem 0 .25rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-carousel .slide-meta { display: flex; gap: .9rem; font-size: .82rem; opacity: .9; }
.home-carousel .slide-conteudo .btn { display: none; }
.home-carousel .carousel-control-prev, .home-carousel .carousel-control-next { display: none; z-index: 3; width: 3.25rem; }
.home-carousel .carousel-control-prev-icon, .home-carousel .carousel-control-next-icon { width: 2.4rem; height: 2.4rem; border-radius: 50%; background-color: rgba(0,0,0,.35); background-size: 45%; backdrop-filter: blur(4px); }
.home-carousel .carousel-indicators { z-index: 3; margin-bottom: .6rem; gap: .3rem; }
.home-carousel .carousel-indicators [data-bs-target] { width: 8px; height: 8px; border-radius: 999px; border: 0; margin: 0; opacity: .55; transition: width .25s, opacity .25s; }
.home-carousel .carousel-indicators .active { width: 22px; opacity: 1; }

.home-intro { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.home-intro h1 { font-size: clamp(1.65rem, 6.2vw, 2.6rem); line-height: 1.12; letter-spacing: -.03em; margin: 0; }
.home-intro p { color: var(--muted); margin: .5rem 0 0; font-size: 1rem; }
.home-intro-acoes { display: flex; gap: .5rem; }
.home-intro-acoes .btn { flex: 1; white-space: nowrap; font-size: 1rem; padding: .75rem 1rem; }
.home-selos { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; }
.home-selos::-webkit-scrollbar { display: none; }
.home-selos li { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .4rem .8rem; }
.home-selos i { color: var(--brand); }

@media (min-width: 768px) {
  .home-carousel .carousel-inner { aspect-ratio: 21 / 9; max-height: 420px; width: 100%; }
  .home-carousel .carousel-control-prev, .home-carousel .carousel-control-next { display: flex; }
  .home-carousel .slide-conteudo { max-width: 60%; padding: 2rem 2.5rem 2.75rem; }
  .home-carousel .slide-conteudo h2 { font-size: 1.7rem; }
  .home-carousel .slide-conteudo .btn { display: inline-flex; }
  .home-carousel [data-slide="curso"]::after { background: linear-gradient(to right, rgba(0,0,0,.8) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,0) 75%); }
}
@media (min-width: 992px) {
  .home-hero { padding: 1.5rem 0 3rem; }
  .home-carousel { border-radius: var(--radius-lg); }
  /* Proporção real da arte do primeiro banner (calculada no servidor); 8:3 se não houver banner */
  .home-carousel .carousel-inner { aspect-ratio: var(--proporcao, 2.667); max-height: 460px; }
  .home-carousel [data-slide="banner"] img { object-fit: cover; }
  .home-intro { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-top: 2.25rem; }
  .home-intro-texto { max-width: 640px; }
  .home-intro-acoes .btn { flex: 0 0 auto; font-size: 1.05rem; padding: .8rem 1.5rem; }
}

/* ==========================================================================
   Ajustes gerais para celular
   ========================================================================== */
@media (max-width: 575.98px) {
  body { font-size: .95rem; }
  .container { padding-left: 1rem; padding-right: 1rem; }
  .site-header .navbar { min-height: 60px; }
  .site-header .brand img { height: 28px; max-width: 120px; }
  .site-header .btn { padding: .45rem .8rem; font-size: .88rem; }
  .site-header .user-btn { padding: .2rem; }
  .section { padding: 2.5rem 0; }
  .section-sm { padding: 1.75rem 0; }
  .section-title { font-size: 1.45rem; }
  .page-hero { padding: 1.5rem 0 1rem; }
  .page-hero h1, .page-head h1 { font-size: 1.45rem; }
  .page-head { margin-bottom: 1rem; }
  .page-head > .btn, .page-head > div > .btn { width: 100%; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .search { flex: 1 1 auto; }
  .filter-bar .btn, .filter-bar .form-select { width: 100% !important; }
  .pill-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; }
  .pill-filters::-webkit-scrollbar { display: none; }
  .pill-filters a, .pill-filters label { flex: 0 0 auto; }
  .course-hero { padding: 1.5rem 0; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fieldset-card { padding: 1.1rem; }
  .surface.p-4, .card-body { padding: 1rem !important; }
  .stat-card { padding: .85rem; gap: .7rem; }
  .stat-card .value { font-size: 1.25rem; }
  .stat-card .icon { width: 38px; height: 38px; font-size: 1.1rem; }
  .cta-band { padding: 1.5rem; }
  .feature { padding: 1.1rem; display: flex; gap: .9rem; align-items: flex-start; }
  .feature .icon { width: 40px; height: 40px; font-size: 1.1rem; margin: 0; flex-shrink: 0; }
  .feature h3 { font-size: 1rem; margin-bottom: .2rem; }
  .feature p { font-size: .9rem; }
  .timeline li { padding-left: 1.1rem; }
  .cta-band .btn { width: 100%; }
  .toast-stack { top: auto; bottom: 12px; right: 12px; left: 12px; max-width: none; }
  .table td, .table th { padding: .65rem .75rem; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dd { margin-bottom: .5rem; }
  .auth-main { padding: 1.5rem 1rem; align-items: flex-start; }
  .sticky-actions { flex-wrap: wrap; }
  .sticky-actions .btn { flex: 1 1 auto; }
  .admin-content { padding: 1rem .85rem 2.5rem; }
  .admin-topbar { padding: 0 .75rem; }
}
/* Evita o zoom automático do iOS ao focar campos */
@media (max-width: 767.98px) {
  .form-control, .form-select { font-size: 16px; }
  .checkout-card { position: static; }
}


/* ==========================================================================
   Refinamento minimalista: menos caixas, mais respiro e fotografia
   ========================================================================== */
.card, .surface, .stat-card, .table-card { box-shadow: none; }
.home-carousel, .banner-carousel, .hero-media, .course-cover, .cta-band { box-shadow: none; }
.eyebrow { background: none; padding: 0; border-radius: 0; font-size: .74rem; letter-spacing: .12em; }

/* Cartões de curso/evento/post: imagem arredondada e texto solto, sem moldura */
.course-card { background: none; border: 0; border-radius: 0; overflow: visible; }
.course-card:hover { transform: none; box-shadow: none; }
.course-card .thumb { border-radius: var(--radius-lg); }
.course-card .body { padding: .9rem .1rem 0; gap: .4rem; }
.course-card:hover h3 { color: var(--brand); }
.course-card .footer { border-top: 0; padding-top: .35rem; }
.course-card.highlight { box-shadow: none; }
.course-card.highlight .thumb { box-shadow: 0 0 0 2px var(--brand); }

.link-mais { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(var(--brand-rgb), .45); text-underline-offset: .3em; white-space: nowrap; }
.link-mais:hover { color: var(--brand); text-decoration-color: var(--brand); }

/* Selos da home: texto simples separado por ponto */
.home-selos { gap: .3rem 0; margin-top: 1rem; flex-wrap: wrap; overflow: visible; }
.home-selos li { background: none; border: 0; border-radius: 0; padding: 0; font-size: .85rem; }
.home-selos li + li::before { content: "·"; margin: 0 .6rem; color: var(--brand); font-weight: 700; }

/* Diferenciais: três colunas com fio superior, sem cartão */
.diferenciais { display: grid; gap: 1.75rem; }
.diferenciais > div { border-top: 1px solid var(--border); padding-top: 1.25rem; }
.diferenciais i { font-size: 1.35rem; color: var(--brand); }
.diferenciais h3 { font-size: 1.05rem; margin: .7rem 0 .35rem; }
.diferenciais p { color: var(--muted); margin: 0; font-size: .95rem; }
@media (min-width: 768px) { .diferenciais { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

.foto-editorial { margin: 0; }
.foto-editorial img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-lg); display: block; }
.foto-editorial figcaption { font-size: .72rem; color: var(--muted); margin-top: .5rem; }
@media (min-width: 992px) { .foto-editorial img { aspect-ratio: 4 / 5; } }

/* Lateral de login/cadastro com fotografia */
.auth-aside[style*="--foto"] {
  background:
    linear-gradient(180deg, rgba(10, 8, 10, .6) 0%, rgba(10, 8, 10, .2) 32%, rgba(10, 8, 10, .55) 62%, rgba(10, 8, 10, .9) 100%),
    var(--foto) center / cover no-repeat, #1a1214;
}
.auth-aside h2 { font-weight: 700; letter-spacing: -.02em; max-width: 18ch; }
.auth-aside ul { gap: .55rem; font-size: .95rem; }
.auth-aside li i { color: rgba(255, 255, 255, .85); }
.auth-eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.auth-rodape { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.auth-credito { font-size: .7rem; opacity: .6; }
.btn-primary { box-shadow: none; }
.btn-soft { background: transparent; }
.btn-soft:hover { background: var(--surface-3); }

/* Papéis: permissões em caixas de seleção */
.permissoes-grupo + .permissoes-grupo { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.permissoes-grupo .section-label { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.permissao-item { display: flex; gap: .7rem; align-items: flex-start; padding: .45rem 0 .45rem 0; margin: 0; }
.permissao-item .form-check-input { float: none; margin: .2rem 0 0; flex-shrink: 0; width: 1.15em; height: 1.15em; }
.permissao-item .form-check-label { cursor: pointer; }
@media (min-width: 768px) { .permissoes-grupo { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.5rem; } .permissoes-grupo .section-label { grid-column: 1 / -1; } }
