/*
 * Anômade Academy — Portal do Aluno
 * Design system: minimalista e sofisticado.
 * Dark charcoal + dourado, hairlines, sombras em camadas,
 * tipografia serif de display e micro-interações discretas.
 */

/* ============ TOKENS ============ */
:root {
  --gold: #C9A84C;
  --gold-light: #E8CE8A;
  --gold-dim: #93743A;
  --gold-glow: rgba(201, 168, 76, 0.28);

  --black: #0B0B09;
  --surface: #12120F;
  --surface2: #1A1A16;
  --surface3: #23231E;

  --border: rgba(201, 168, 76, 0.12);
  --border-strong: rgba(201, 168, 76, 0.32);
  --hairline: rgba(240, 237, 230, 0.06);

  --text: #F2EFE8;
  --text-muted: #9C978A;
  --text-dim: #5E5B52;

  --success: #66BD86;
  --success-bg: rgba(102, 189, 134, 0.10);
  --danger: #D06457;
  --danger-bg: rgba(208, 100, 87, 0.10);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;

  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-gold: 0 4px 20px rgba(201, 168, 76, 0.18);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="light"] {
  --gold: #8E6E1F;
  --gold-light: #A8842A;
  --gold-dim: #B99B54;
  --gold-glow: rgba(142, 110, 31, 0.16);

  --black: #F5F3ED;
  --surface: #FFFFFF;
  --surface2: #F4F1E9;
  --surface3: #E9E4D6;

  --border: rgba(142, 110, 31, 0.16);
  --border-strong: rgba(142, 110, 31, 0.38);
  --hairline: rgba(32, 29, 21, 0.07);

  --text: #211E15;
  --text-muted: #6E6752;
  --text-dim: #A69E88;

  --success: #2E8B57;
  --success-bg: rgba(46, 139, 87, 0.10);
  --danger: #B23A2E;
  --danger-bg: rgba(178, 58, 46, 0.08);

  --shadow-sm: 0 1px 2px rgba(32, 29, 21, 0.06);
  --shadow-md: 0 4px 16px rgba(32, 29, 21, 0.08), 0 1px 3px rgba(32, 29, 21, 0.05);
  --shadow-lg: 0 24px 64px rgba(32, 29, 21, 0.14), 0 4px 16px rgba(32, 29, 21, 0.06);
  --shadow-gold: 0 4px 20px rgba(142, 110, 31, 0.14);
}

/* ============ BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}
a { color: inherit; }
button { font-family: inherit; }
::selection { background: var(--gold-glow); color: var(--text); }
:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; border-radius: var(--radius-sm); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: absolute; top: 24px; right: 24px; z-index: 5;
  transition: color 0.2s, border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.2s;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--border-strong); transform: rotate(15deg); box-shadow: var(--shadow-sm); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ============ LOGIN ============ */
#screen-login { background: var(--black); position: relative; overflow: hidden; width: 100%; }
#screen-trocar-senha { flex-direction: column; align-items: center; justify-content: center; background: var(--black); width: 100%; padding: 40px; }
.login-split { display: flex; width: 100%; min-height: 100vh; }

.login-brand {
  flex: 0 0 42%; min-width: 380px; max-width: 560px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 56px 56px 44px;
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--surface) 0%, var(--black) 70%);
}
.login-brand::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, transparent, var(--border-strong) 30%, var(--border-strong) 70%, transparent); }
.login-brand-glow {
  position: absolute; width: 560px; height: 560px; top: -180px; left: -180px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 65%);
  opacity: 0.35; pointer-events: none;
}
.login-brand-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 30% 20%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 80% at 30% 20%, #000 0%, transparent 75%);
}
.brand-logo-row { display: flex; align-items: center; gap: 16px; position: relative; }
.brand-logo-icon { width: 58px; height: 58px; flex-shrink: 0; }
.brand-logo-icon svg { width: 100%; height: 100%; }
.brand-emblem-dot { filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.8)); }
.brand-logo-name { font-family: var(--font-body); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); line-height: 1.2; white-space: nowrap; }
.brand-logo-sub { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-top: 5px; }

.brand-content { position: relative; margin: 48px 0; }
.brand-eyebrow { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 18px; }
.brand-headline { font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 42px); font-weight: 400; line-height: 1.18; color: var(--text); letter-spacing: 0.005em; margin-bottom: 20px; max-width: 420px; }
.brand-headline em { color: var(--gold); font-style: italic; }
.brand-desc { font-size: 14px; line-height: 1.85; color: var(--text-muted); max-width: 380px; }

.brand-footer { position: relative; display: flex; align-items: center; gap: 14px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); }
.brand-footer-line { width: 40px; height: 1px; background: var(--border-strong); flex-shrink: 0; }

.login-panel { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 48px 40px; background: var(--black); position: relative; }

.login-box {
  width: 400px; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 44px 36px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: riseIn 0.6s var(--ease) both;
}
.login-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, transparent 100%); }

.login-heading { text-align: center; }
.login-heading-tag { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 12px; }
.login-heading-title { font-family: var(--font-display); font-size: 30px; font-weight: 500; color: var(--text); line-height: 1.1; }
.login-heading-sub { font-size: 12px; color: var(--text-dim); margin-top: 10px; line-height: 1.6; }

.login-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-logo-text { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: 0.05em; color: var(--gold); }
.login-logo-sub { font-size: 11px; letter-spacing: 0.08em; color: var(--text-muted); text-align: center; }

.login-form { width: 100%; display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.form-input, .form-select {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; color: var(--text);
  font-family: var(--font-body); font-size: 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-input:hover, .form-select:hover { border-color: var(--border-strong); }
.form-input:focus, .form-select:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
.form-input::placeholder { color: var(--text-dim); }
.form-input:read-only { opacity: 0.6; cursor: default; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 100px var(--surface2) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

.btn-login {
  width: 100%; background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 60%);
  border: none; border-radius: var(--radius-sm);
  padding: 14px; color: #14120B;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; margin-top: 6px;
  transition: transform 0.2s var(--ease), box-shadow 0.25s, filter 0.2s;
  box-shadow: var(--shadow-gold);
}
.btn-login:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(201, 168, 76, 0.3); }
.btn-login:active { transform: translateY(0); }

.login-links { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.login-links a { color: var(--gold-dim); text-decoration: none; cursor: pointer; transition: color 0.15s; border-bottom: 1px solid transparent; }
.login-links a:hover { color: var(--gold); border-bottom-color: var(--gold-dim); }
.login-footer { font-size: 10px; color: var(--text-dim); letter-spacing: 0.06em; text-align: center; line-height: 1.7; padding-top: 22px; border-top: 1px solid var(--hairline); width: 100%; }
.login-error { font-size: 12px; color: var(--danger); text-align: center; min-height: 16px; }

/* ============ APP SHELL ============ */
#app-shell { display: none; width: 100%; }
#app-shell.active { display: flex; }

.sidebar {
  width: 248px; min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 30px 0 20px;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform 0.28s var(--ease);
}
.sidebar-logo { padding: 0 26px 26px; border-bottom: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 4px; }
.sidebar-logo-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: 0.16em; color: var(--gold); }
.sidebar-logo-sub { font-size: 9px; letter-spacing: 0.38em; text-transform: uppercase; color: var(--text-dim); }

.sidebar-nav { flex: 1; padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-section-label { font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 450; color: var(--text-muted);
  cursor: pointer; text-decoration: none;
  border: none; background: none; width: 100%; text-align: left;
  position: relative;
  transition: background 0.18s, color 0.18s;
}
.nav-item::before { content: ''; position: absolute; left: -14px; top: 20%; bottom: 20%; width: 2px; border-radius: 0 2px 2px 0; background: transparent; transition: background 0.2s; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.65; transition: opacity 0.18s; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item:hover svg { opacity: 0.9; }
.nav-item.active { background: linear-gradient(90deg, var(--gold-glow) 0%, transparent 130%); color: var(--gold); }
.nav-item.active::before { background: var(--gold); }
.nav-item.active svg { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--gold); color: #14120B; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; min-width: 18px; text-align: center; }

.sidebar-footer { padding: 14px 14px 0; border-top: 1px solid var(--hairline); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; transition: background 0.15s; }
.sidebar-user:hover { background: var(--surface2); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-glow), transparent 80%), var(--surface2);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 13px; color: var(--gold); font-weight: 600; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.logout-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); transition: color 0.15s, background 0.15s; display: flex; }
.logout-btn:hover { color: var(--danger); background: var(--danger-bg); }
.logout-btn svg { width: 14px; height: 14px; }

.main-content { margin-left: 248px; flex: 1; min-height: 100vh; background: var(--black); width: 100%; }

.topbar {
  height: 58px;
  background: color-mix(in srgb, var(--black) 82%, transparent);
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; padding: 0 36px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  gap: 16px;
}
.topbar-menu-btn { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); }
.topbar-menu-btn:hover { color: var(--text); background: var(--surface2); }
.topbar-breadcrumb { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; letter-spacing: 0.02em; }
.topbar-breadcrumb span { color: var(--text-dim); }
.topbar-breadcrumb .current { color: var(--text); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: border-color 0.18s, background 0.18s;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface2); }
.icon-btn svg { width: 15px; height: 15px; color: var(--text-muted); }
.icon-btn:hover svg { color: var(--text); }
.notif-dot { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; position: absolute; top: 7px; right: 7px; box-shadow: 0 0 6px var(--gold-glow); }

.page-body { padding: 40px 44px 64px; max-width: 1200px; }

/* ============ DASHBOARD ============ */
.welcome-block { margin-bottom: 44px; }
.welcome-tag { font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 10px; }
.welcome-title { font-family: var(--font-display); font-size: 40px; font-weight: 400; color: var(--text); line-height: 1.08; margin-bottom: 8px; letter-spacing: 0.005em; }
.welcome-title em { color: var(--gold); font-style: italic; }
.welcome-sub { font-size: 13px; color: var(--text-muted); }

.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 44px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden; min-width: 0;
  transition: border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border-strong), transparent); opacity: 0; transition: opacity 0.3s; }
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { opacity: 1; }
.stat-icon { width: 30px; height: 30px; background: var(--gold-glow); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 14px; height: 14px; color: var(--gold); }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: var(--text); line-height: 1.05; }
.stat-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.02em; }

.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--text); letter-spacing: 0.01em; }
.section-link { font-size: 11px; font-weight: 500; color: var(--gold-dim); cursor: pointer; text-decoration: none; letter-spacing: 0.1em; transition: color 0.15s, letter-spacing 0.2s; background: none; border: none; text-transform: uppercase; }
.section-link:hover { color: var(--gold); }

.continue-card {
  background: linear-gradient(120deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 26px 30px; margin-bottom: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.continue-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); }
.continue-info { min-width: 0; flex: 1 1 260px; }
.continue-info .tag { font-family: var(--font-mono); font-size: 10px; color: var(--gold-dim); letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 8px; }
.continue-info .title { font-family: var(--font-display); font-size: 24px; color: var(--text); margin-bottom: 12px; line-height: 1.15; }
.continue-progress-wrap { width: 280px; max-width: 100%; }

.activity-feed { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--hairline); font-size: 12px; }
.activity-item:last-child { border-bottom: none; }
.activity-ts { color: var(--text-dim); font-family: var(--font-mono); font-size: 10px; min-width: 92px; }
.activity-msg { color: var(--text-muted); line-height: 1.5; }
.empty-state { color: var(--text-dim); font-size: 12px; font-style: italic; padding: 18px 0; }

/* ============ TRILHAS ============ */
.trilhas-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 44px; }
.trilha-card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; cursor: pointer; min-width: 0;
  position: relative; overflow: hidden;
  transition: border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.trilha-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(420px circle at var(--mx, 50%) -20%, var(--gold-glow), transparent 60%); opacity: 0; transition: opacity 0.35s; pointer-events: none; }
.trilha-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.trilha-card:hover::after { opacity: 0.5; }
.trilha-card.locked { cursor: not-allowed; opacity: 0.5; filter: saturate(0.5); }
.trilha-card.locked:hover { transform: none; box-shadow: none; }
.trilha-num { font-family: var(--font-mono); font-size: 10px; color: var(--gold-dim); letter-spacing: 0.14em; margin-bottom: 10px; }
.trilha-name { font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--text); margin-bottom: 10px; line-height: 1.2; }
.trilha-meta { display: flex; gap: 14px; font-size: 11px; color: var(--text-dim); margin-bottom: 18px; flex-wrap: wrap; }

.progress-bar-wrap { height: 3px; background: var(--surface3); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 2px; transition: width 0.8s var(--ease); }
.progress-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-dim); letter-spacing: 0.03em; }
.progress-label .pct { color: var(--gold-dim); font-family: var(--font-mono); }

.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 600; padding: 4px 10px; border-radius: 20px; letter-spacing: 0.12em; margin-bottom: 12px; }
.status-badge.active { background: var(--success-bg); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); }
.status-badge.locked { background: var(--surface3); color: var(--text-dim); border: 1px solid transparent; }
.status-badge.done { background: var(--gold-glow); color: var(--gold); border: 1px solid var(--border-strong); }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 5px currentColor; }

/* ============ LISTA DE AULAS ============ */
.aulas-list { display: flex; flex-direction: column; gap: 8px; }
.aula-item {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; padding: 16px 20px; gap: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease);
}
.aula-item:hover { border-color: var(--border-strong); background: var(--surface2); transform: translateX(3px); }
.aula-item.locked, .aula-item.pendente { opacity: 0.45; cursor: not-allowed; }
.aula-item.locked:hover, .aula-item.pendente:hover { transform: none; }
.aula-item.static { cursor: default; }
.aula-item.static:hover { border-color: var(--border); background: var(--surface); transform: none; }
.aula-num { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); min-width: 28px; }
.aula-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.aula-icon.done { background: var(--gold-glow); }
.aula-icon.active { background: var(--gold-glow); box-shadow: inset 0 0 0 1px var(--border-strong); }
.aula-icon.locked, .aula-icon.pendente { background: var(--surface3); }
.aula-icon svg { width: 16px; height: 16px; }
.aula-icon.done svg { color: var(--gold); }
.aula-icon.active svg { color: var(--gold-light); }
.aula-icon.locked svg, .aula-icon.pendente svg { color: var(--text-dim); }
.aula-info { flex: 1; min-width: 0; }
.aula-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.aula-meta { font-size: 11px; color: var(--text-dim); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.aula-tag-chip { font-size: 9px; font-weight: 500; padding: 2px 8px; border: 1px solid var(--border); border-radius: 10px; color: var(--gold-dim); letter-spacing: 0.06em; }
.aula-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.aula-duration { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.aula-check { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.2s; }
.aula-check.done { background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.aula-check.active { border: 1.5px solid var(--gold-dim); }
.aula-check.locked, .aula-check.pendente { border: 1.5px solid var(--surface3); }
.aula-check.done svg { width: 11px; height: 11px; color: #14120B; }

/* ============ HERO DA TRILHA ============ */
.trilha-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 36px 40px; margin-bottom: 36px;
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.trilha-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border-strong) 40%, transparent); }
.trilha-hero::after { content: ''; position: absolute; width: 320px; height: 320px; top: -160px; right: -80px; background: radial-gradient(circle, var(--gold-glow), transparent 65%); opacity: 0.4; pointer-events: none; }
.trilha-hero-tag { font-family: var(--font-mono); font-size: 10px; color: var(--gold-dim); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 12px; }
.trilha-hero-title { font-family: var(--font-display); font-size: 34px; font-weight: 500; color: var(--text); margin-bottom: 12px; line-height: 1.12; }
.trilha-hero-desc { font-size: 13px; color: var(--text-muted); line-height: 1.75; max-width: 560px; margin-bottom: 22px; }
.trilha-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-tag { font-size: 11px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); background: color-mix(in srgb, var(--surface3) 40%, transparent); }
.trilha-hero-stats { display: flex; flex-direction: column; gap: 16px; align-items: flex-end; position: relative; }
.hero-stat { text-align: right; }
.hero-stat-val { font-family: var(--font-display); font-size: 40px; color: var(--gold); line-height: 1; }
.hero-stat-lbl { font-size: 10px; color: var(--text-dim); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 6px; }
.big-progress { width: 100%; height: 3px; background: var(--surface3); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.big-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width 0.8s var(--ease); }

/* ============ PLAYER / AULA ============ */
.video-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.video-wrap { background: #000; border-radius: var(--radius-lg); aspect-ratio: 16/9; position: relative; overflow: hidden; border: 1px solid var(--border); margin-bottom: 24px; cursor: pointer; box-shadow: var(--shadow-md); }
.video-thumb { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, #1D1D18 0%, #0B0B09 80%); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; padding: 20px; text-align: center; }
.video-thumb-text { font-family: var(--font-display); font-size: 22px; color: rgba(242, 239, 232, 0.55); }
.video-thumb-note { font-size: 11px; color: #5E5B52; max-width: 380px; line-height: 1.6; }
.play-btn {
  width: 68px; height: 68px;
  background: rgba(201, 168, 76, 0.12); border: 1.5px solid var(--gold-dim); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.play-btn:hover { background: rgba(201, 168, 76, 0.22); border-color: var(--gold); transform: scale(1.06); box-shadow: 0 0 32px rgba(201, 168, 76, 0.25); }
.play-btn svg { width: 24px; height: 24px; color: var(--gold); margin-left: 4px; }
.video-grid-overlay { position: absolute; inset: 0; background-image: linear-gradient(rgba(201,168,76,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(201,168,76,0.03) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.video-controls { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 100%); }
.video-progress { height: 3px; background: rgba(255,255,255,0.18); border-radius: 2px; margin-bottom: 10px; cursor: pointer; }
.video-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 2px; }
.video-controls-row { display: flex; align-items: center; gap: 12px; }
.ctrl-btn { background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.7); display: flex; padding: 4px; border-radius: 4px; transition: color 0.15s; }
.ctrl-btn:hover { color: #fff; }
.ctrl-btn svg { width: 16px; height: 16px; }
.time-display { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.6); flex: 1; }
.video-tag { font-family: var(--font-mono); font-size: 10px; color: var(--gold-dim); letter-spacing: 0.18em; margin-bottom: 8px; }
.video-title { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: var(--text); margin-bottom: 10px; line-height: 1.15; }
.video-desc { font-size: 13px; color: var(--text-muted); line-height: 1.75; }

/* ============ TABS / SEÇÕES DE CONTEÚDO ============ */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tab { padding: 10px 18px; font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; letter-spacing: 0.05em; }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab:hover:not(.active) { color: var(--text); }

.content-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 26px; margin-bottom: 16px; }
.content-section-title { font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--text); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.content-list { display: flex; flex-direction: column; gap: 11px; }
.content-list-item { display: flex; gap: 14px; align-items: flex-start; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.content-num { font-family: var(--font-mono); font-size: 11px; color: var(--gold-dim); min-width: 20px; flex-shrink: 0; margin-top: 1px; }

.atividade-box { background: linear-gradient(120deg, var(--gold-glow), transparent 70%), var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 22px 26px; margin-bottom: 16px; position: relative; overflow: hidden; }
.atividade-label { font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.atividade-desc { font-size: 13px; color: var(--text-muted); line-height: 1.75; margin-bottom: 0; }

/* ============ BOTÕES ============ */
.btn-gold {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 65%);
  color: #14120B; border: none; border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter 0.2s, transform 0.2s var(--ease), box-shadow 0.25s;
  box-shadow: var(--shadow-sm);
}
.btn-gold:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: var(--shadow-gold); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { background: var(--surface3); color: var(--text-dim); cursor: not-allowed; box-shadow: none; transform: none; filter: none; }
.btn-gold svg { width: 13px; height: 13px; }

.btn-outline {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.btn-outline:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface2); transform: translateY(-1px); }
.btn-outline:active { transform: translateY(0); }
.btn-outline svg { width: 13px; height: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ SIDEBAR DO PLAYER ============ */
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.sidebar-card-header { padding: 15px 18px; border-bottom: 1px solid var(--hairline); font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; display: flex; justify-content: space-between; }
.next-aula-item { padding: 13px 18px; display: flex; gap: 12px; align-items: center; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--hairline); position: relative; }
.next-aula-item:last-child { border-bottom: none; }
.next-aula-item:hover { background: var(--surface2); }
.next-aula-item.current { background: linear-gradient(90deg, var(--gold-glow), transparent 80%); }
.next-aula-item.current::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--gold); }
.next-aula-item.pendente { cursor: not-allowed; opacity: 0.45; }
.next-aula-num { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); min-width: 24px; }
.next-aula-info { flex: 1; min-width: 0; }
.next-aula-title { font-size: 12px; color: var(--text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-aula-dur { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); }
.next-aula-status { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.next-aula-status.done { background: var(--gold); }
.next-aula-status.active { background: var(--gold-light); box-shadow: 0 0 8px var(--gold-glow); }
.next-aula-status.locked, .next-aula-status.pendente { background: var(--text-dim); opacity: 0.3; }

.atencao-card { background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--gold-dim); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 16px; }
.atencao-label { font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.atencao-text { font-size: 12px; color: var(--text-muted); line-height: 1.65; font-style: italic; }

/* ============ CERTIFICADOS ============ */
.cert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 32px; }
.cert-card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px; position: relative; overflow: hidden; min-width: 0;
  transition: border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.cert-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cert-card.earned { border-color: var(--border-strong); background: linear-gradient(150deg, var(--surface) 60%, var(--surface2) 100%); }
.cert-card.earned::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.cert-card.earned::after { content: ''; position: absolute; width: 220px; height: 220px; top: -110px; right: -60px; background: radial-gradient(circle, var(--gold-glow), transparent 65%); opacity: 0.5; pointer-events: none; }
.cert-icon { width: 46px; height: 46px; border-radius: var(--radius); background: var(--gold-glow); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.cert-icon svg { width: 20px; height: 20px; color: var(--gold); }
.cert-name { font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--text); margin-bottom: 6px; line-height: 1.2; }
.cert-sub { font-size: 11px; color: var(--text-dim); margin-bottom: 20px; }
.cert-meta { display: flex; gap: 16px; font-size: 11px; color: var(--text-dim); margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.cert-actions { display: flex; gap: 8px; position: relative; }
.cert-locked-msg { font-size: 12px; color: var(--text-dim); font-style: italic; line-height: 1.6; }
.cert-code { font-family: var(--font-mono); font-size: 10px; color: var(--gold-dim); letter-spacing: 0.05em; }

/* Certificado — visual imprimível */
.cert-paper {
  background: linear-gradient(180deg, var(--surface) 0%, var(--black) 130%);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 56px 48px; text-align: center; max-width: 760px; margin: 0 auto 28px;
  position: relative; box-shadow: var(--shadow-lg);
}
.cert-paper::before { content: ''; position: absolute; inset: 12px; border: 1px solid var(--border); pointer-events: none; border-radius: 8px; }
.cert-paper::after { content: ''; position: absolute; inset: 17px; border: 1px solid var(--hairline); pointer-events: none; border-radius: 5px; }
.cert-paper-eyebrow { font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 24px; }
.cert-paper-title { font-family: var(--font-display); font-size: 36px; color: var(--gold); margin-bottom: 22px; line-height: 1.15; }
.cert-paper-name { font-family: var(--font-display); font-size: 27px; font-style: italic; color: var(--text); margin-bottom: 12px; }
.cert-paper-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 30px; line-height: 1.75; max-width: 520px; margin-left: auto; margin-right: auto; }
.cert-paper-meta { display: flex; justify-content: center; gap: 36px; font-size: 11px; color: var(--text-dim); flex-wrap: wrap; }

/* ============ AVALIAÇÃO ============ */
.quiz-progress-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; font-size: 12px; color: var(--text-muted); letter-spacing: 0.04em; }
.quiz-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; max-width: 640px; margin: 0 auto; box-shadow: var(--shadow-md); }
.quiz-question { font-family: var(--font-display); font-size: 24px; color: var(--text); margin-bottom: 26px; line-height: 1.3; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.quiz-option {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  background: var(--surface2); line-height: 1.5;
  transition: border-color 0.18s, color 0.18s, background 0.18s, transform 0.2s var(--ease);
}
.quiz-option:hover { border-color: var(--border-strong); color: var(--text); transform: translateX(3px); }
.quiz-option.selected { border-color: var(--gold); color: var(--text); background: var(--gold-glow); box-shadow: 0 0 0 1px var(--gold); }
.quiz-option-letter { font-family: var(--font-mono); font-size: 11px; color: var(--gold-dim); width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.18s; }
.quiz-option.selected .quiz-option-letter { background: var(--gold); color: #14120B; border-color: var(--gold); font-weight: 500; }
.quiz-intro { max-width: 620px; margin: 0 auto; text-align: center; }
.quiz-intro-rules { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 26px 26px 44px; margin: 26px 0; }
.quiz-intro-rules li { font-size: 13px; color: var(--text-muted); margin-bottom: 11px; line-height: 1.65; }
.quiz-intro-rules li::marker { color: var(--gold-dim); }
.quiz-intro-rules li:last-child { margin-bottom: 0; }
.result-hero { text-align: center; max-width: 500px; margin: 40px auto 0; }
.result-score { font-family: var(--font-display); font-size: 84px; color: var(--gold); line-height: 1; margin-bottom: 10px; text-shadow: 0 0 60px var(--gold-glow); }
.result-status { font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 24px; }
.result-status.pass { color: var(--success); }
.result-status.fail { color: var(--danger); }
.countdown-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin: 24px 0; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.countdown-box strong { color: var(--gold); }

/* ============ RANKING / TABELAS ============ */
.ranking-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.ranking-table th { text-align: left; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.ranking-table td { padding: 14px 16px; font-size: 13px; color: var(--text-muted); border-bottom: 1px solid var(--hairline); }
.ranking-table tbody tr { transition: background 0.15s; }
.ranking-table tbody tr:hover { background: var(--surface2); }
.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table tr.me { background: linear-gradient(90deg, var(--gold-glow), transparent 70%); }
.ranking-table tr.me td { color: var(--text); font-weight: 500; }
.rank-pos { font-family: var(--font-display); font-size: 17px; width: 36px; }
.rank-pos.gold { color: var(--gold); }
.rank-pos.silver { color: #C7C7C0; }
.rank-pos.bronze { color: #B4763E; }
.rank-name-cell { display: flex; align-items: center; gap: 11px; }
.rank-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-glow); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 12px; color: var(--gold); flex-shrink: 0; }

/* ============ PERFIL ============ */
.perfil-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.perfil-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; height: fit-content; position: sticky; top: 82px; box-shadow: var(--shadow-sm); }
.perfil-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-glow), transparent 75%), var(--surface2);
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 30px; color: var(--gold); font-weight: 600;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold-glow) 40%, transparent);
}
.perfil-name { font-family: var(--font-display); font-size: 23px; font-weight: 500; color: var(--text); }
.perfil-role { font-size: 11px; color: var(--text-dim); letter-spacing: 0.12em; text-transform: uppercase; }
.perfil-divider { width: 100%; height: 1px; background: var(--hairline); margin: 6px 0; }
.perfil-stat-row { width: 100%; }
.perfil-stat-item { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 12px; }
.perfil-stat-item:last-child { border-bottom: none; }
.perfil-stat-lbl { color: var(--text-dim); }
.perfil-stat-val { color: var(--text); font-weight: 500; font-family: var(--font-mono); font-size: 11px; }
.perfil-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.settings-title { font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--text); margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--hairline); gap: 16px; }
.toggle-row:last-child { border-bottom: none; }
.toggle-lbl { font-size: 13px; font-weight: 500; color: var(--text); }
.toggle-desc { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.toggle { width: 40px; height: 22px; background: var(--surface3); border-radius: 11px; position: relative; cursor: pointer; transition: background 0.25s; flex-shrink: 0; border: none; }
.toggle.on { background: var(--gold); }
.toggle::after { content: ''; position: absolute; width: 16px; height: 16px; background: var(--text); border-radius: 50%; top: 3px; left: 3px; transition: transform 0.25s var(--ease), background 0.25s; box-shadow: var(--shadow-sm); }
.toggle.on::after { transform: translateX(18px); background: #14120B; }

/* ============ ELABORAÇÃO DE AULAS (pipeline) ============ */
.elab-legend {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 22px; margin-bottom: 24px;
}
.elab-legend-item { display: flex; align-items: center; gap: 9px; font-size: 11px; color: var(--text-muted); }
.elab-legend-num {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--gold-dim);
  font-family: var(--font-mono); font-size: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.elab-trilha { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 14px; overflow: hidden; transition: border-color 0.2s; }
.elab-trilha[open] { border-color: var(--border-strong); }
.elab-trilha summary { list-style: none; cursor: pointer; padding: 18px 22px; display: flex; align-items: center; gap: 20px; transition: background 0.15s; }
.elab-trilha summary::-webkit-details-marker { display: none; }
.elab-trilha summary:hover { background: var(--surface2); }
.elab-sum-info { flex: 1; min-width: 0; }
.elab-sum-info .trilha-num { margin-bottom: 4px; }
.elab-sum-titulo { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--text); line-height: 1.2; }
.elab-sum-meta { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.elab-sum-bar { width: 120px; }
.elab-sum-bar .progress-bar-wrap { margin-bottom: 0; }
.elab-chevron { display: flex; color: var(--text-dim); transition: transform 0.25s var(--ease), color 0.2s; }
.elab-chevron svg { width: 16px; height: 16px; }
.elab-trilha[open] .elab-chevron { transform: rotate(180deg); color: var(--gold-dim); }

.elab-board { border-top: 1px solid var(--hairline); overflow-x: auto; }
.elab-board-inner { min-width: 720px; }
.elab-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(7, 40px) 108px;
  gap: 6px; align-items: center;
  padding: 9px 22px;
  border-bottom: 1px solid var(--hairline);
}
.elab-row:last-child { border-bottom: none; }
.elab-row:not(.elab-head):hover { background: var(--surface2); }
.elab-head { font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); background: var(--surface2); padding-top: 11px; padding-bottom: 11px; position: sticky; top: 0; }
.elab-head-col { text-align: center; font-family: var(--font-mono); cursor: help; color: var(--gold-dim); }
.elab-aula { display: flex; align-items: center; gap: 10px; min-width: 0; }
.elab-aula-num { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); min-width: 26px; flex-shrink: 0; }
.elab-aula-titulo { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elab-flag { color: var(--success); font-size: 8px; flex-shrink: 0; cursor: help; }

.elab-cell {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); font-family: var(--font-mono); font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; margin: 0 auto; padding: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.elab-cell:hover { border-color: var(--gold-dim); color: var(--gold); transform: scale(1.12); }
.elab-cell.done { background: var(--gold); border-color: var(--gold); color: #14120B; box-shadow: 0 0 8px var(--gold-glow); }
.elab-cell.done:hover { filter: brightness(1.1); color: #14120B; }
.elab-cell.done svg { width: 12px; height: 12px; }
.elab-cell.next { border-color: var(--gold-dim); color: var(--gold-dim); border-style: dashed; }

.elab-row-status { text-align: right; }
.elab-status { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.elab-status.done { background: var(--gold-glow); color: var(--gold); border: 1px solid var(--border-strong); }
.elab-status.prog { background: var(--success-bg); color: var(--success); }
.elab-status.idle { background: var(--surface3); color: var(--text-dim); }

/* ============ AULAS AO VIVO ============ */
.vivo-list { display: flex; flex-direction: column; gap: 12px; }
.vivo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: 20px; padding: 20px 24px;
  transition: border-color 0.2s, box-shadow 0.25s;
  flex-wrap: wrap;
}
.vivo-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.vivo-card.past { opacity: 0.9; }
.vivo-date {
  width: 58px; flex-shrink: 0; text-align: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 8px 4px 9px; background: var(--gold-glow);
}
.vivo-card.past .vivo-date { background: var(--surface3); border-color: var(--border); }
.vivo-date-dia { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--gold); line-height: 1; }
.vivo-card.past .vivo-date-dia { color: var(--text-muted); }
.vivo-date-mes { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; color: var(--text-dim); margin-top: 3px; }
.vivo-info { flex: 1; min-width: 220px; }
.vivo-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.vivo-rel { color: var(--gold-dim); font-weight: 600; }
.vivo-titulo { font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--text); line-height: 1.2; }
.vivo-pauta { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; max-width: 60ch; }
.vivo-acao { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.vivo-acao-admin { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: 320px; }
.vivo-presenca-ok { font-size: 11px; font-weight: 600; color: var(--success); letter-spacing: 0.04em; }
.vivo-gravacao-player { width: 280px; max-width: 100%; border-radius: var(--radius); background: #000; border: 1px solid var(--border); }
.vivo-presencas-lista { margin-top: 12px; border-top: 1px solid var(--hairline); padding-top: 8px; }
.presenca-linha { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--hairline); }
.presenca-linha:last-child { border-bottom: none; }

.vivo-banner {
  background: linear-gradient(120deg, var(--gold-glow), transparent 60%), var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 22px 28px; margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.vivo-banner-info { min-width: 0; flex: 1 1 260px; }
.vivo-banner-tag { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; color: var(--gold); letter-spacing: 0.16em; margin-bottom: 8px; }
.vivo-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--gold-glow); } 50% { box-shadow: 0 0 0 6px transparent; } }
.vivo-banner-titulo { font-family: var(--font-display); font-size: 22px; color: var(--text); margin-bottom: 4px; line-height: 1.15; }
.vivo-banner-meta { font-size: 12px; color: var(--text-muted); }

/* ============ AVALIAÇÃO DE AULA (estrelas) ============ */
.avaliacao-box { border-color: var(--border-strong); }
.star-row { display: flex; gap: 4px; }
.star-btn {
  background: none; border: none; cursor: pointer; padding: 2px;
  color: var(--text-dim); display: flex;
  transition: color 0.15s, transform 0.2s var(--ease);
}
.star-btn svg { width: 24px; height: 24px; }
.star-btn:hover { transform: scale(1.15); color: var(--gold-light); }
.star-btn.on { color: var(--gold); }
.star-row-view { display: inline-flex; gap: 1px; align-items: center; vertical-align: middle; }
.star-view { display: inline-flex; color: var(--text-dim); opacity: 0.4; }
.star-view.on { color: var(--gold); opacity: 1; }
.star-view svg { width: 13px; height: 13px; }

.coment-item { padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.coment-item:last-child { border-bottom: none; }
.coment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.coment-nome { font-size: 12px; font-weight: 600; color: var(--text); }
.coment-texto { font-size: 13px; color: var(--text-muted); line-height: 1.65; font-style: italic; }

/* ============ BIBLIOTECA (aulas extras) ============ */
.filtro-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filtro-chip {
  background: transparent; border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 14px; font-family: var(--font-body); font-size: 11px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; letter-spacing: 0.03em;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filtro-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filtro-chip.active { background: var(--gold-glow); border-color: var(--gold-dim); color: var(--gold); }
.extra-cat-chip { display: inline-block; font-size: 9px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-dim); border: 1px solid var(--border); border-radius: 10px; padding: 3px 10px; margin-bottom: 12px; }
.extra-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ============ SALA AO VIVO (Jitsi embutido) ============ */
.sala-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.jitsi-container {
  width: 100%; height: min(72vh, 720px);
  background: #0B0B09; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.jitsi-container iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ============ CENTRAL DE COMUNICAÇÃO ============ */
.convoc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .convoc-grid { grid-template-columns: 1fr; } }
.convoc-canvas { width: 100%; max-width: 440px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: #0B0B09; display: block; box-shadow: var(--shadow-md); }
.convoc-alunos { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 4px 14px; }
.convoc-aluno-linha { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; font-size: 12.5px; color: var(--text); border-bottom: 1px solid var(--hairline); }
.convoc-aluno-linha:last-child { border-bottom: none; }
.convoc-aluno-linha a { text-decoration: none; }

.aviso-item { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.aviso-item:last-child { border-bottom: none; }
.aviso-admin-item { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.aviso-admin-item:last-child { border-bottom: none; }
.aviso-titulo { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.aviso-msg { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 4px 0; max-width: 70ch; }
.aviso-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }

/* ============ PAINEL DE NOTIFICAÇÕES ============ */
.topbar-actions { position: relative; }
.notif-panel {
  display: none; position: absolute; top: 44px; right: 0; width: 340px; max-width: 88vw;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden;
  max-height: 420px; overflow-y: auto;
}
.notif-panel.open { display: block; animation: fadeUp 0.25s var(--ease); }
.notif-panel-header { padding: 14px 18px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--hairline); position: sticky; top: 0; background: var(--surface); }
.notif-item { padding: 13px 18px; border-bottom: 1px solid var(--hairline); cursor: default; transition: background 0.15s; }
.notif-item[data-notif-link] { cursor: pointer; }
.notif-item:hover { background: var(--surface2); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: linear-gradient(90deg, var(--gold-glow), transparent 70%); }
.notif-msg { font-size: 12.5px; color: var(--text); line-height: 1.5; margin-bottom: 4px; }
.notif-ts { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }

/* ============ GAMIFICAÇÃO (pontos e badges) ============ */
.perfil-pontos { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.perfil-pontos-num { font-family: var(--font-display); font-size: 34px; color: var(--gold); line-height: 1; }
.perfil-pontos-lbl { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
.perfil-streak { font-size: 11px; color: var(--text-muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 3px 10px; }
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; width: 100%; margin-top: 4px; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: 0.35; filter: grayscale(0.8); cursor: help; transition: opacity 0.2s, filter 0.2s, transform 0.2s var(--ease); }
.badge-item.earned { opacity: 1; filter: none; }
.badge-item:hover { transform: translateY(-2px); }
.badge-circle { width: 38px; height: 38px; border-radius: 50%; background: var(--gold-glow); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; }
.badge-item.earned .badge-circle { box-shadow: 0 0 10px var(--gold-glow); }
.badge-circle svg { width: 16px; height: 16px; color: var(--gold); }
.badge-item:not(.earned) .badge-circle svg { color: var(--text-dim); }
.badge-nome { font-size: 8.5px; letter-spacing: 0.04em; color: var(--text-muted); text-align: center; line-height: 1.3; }

/* ============ ANALYTICS (mini gráfico de barras) ============ */
.mini-bars { display: flex; align-items: stretch; gap: 10px; padding: 8px 4px 0; }
.mini-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.mini-bar-col b { font-family: var(--font-mono); font-size: 11px; color: var(--gold-dim); font-weight: 400; }
.mini-bar-track { width: 100%; max-width: 44px; height: 120px; background: var(--surface3); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.mini-bar { width: 100%; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border-radius: 4px 4px 0 0; transition: height 0.7s var(--ease); }
.mini-bar-col span { font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); }

/* ============ BUSCA (TOPBAR) ============ */
.search-input { background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 8px 16px 8px 34px; color: var(--text); font-family: var(--font-body); font-size: 12px; outline: none; width: 210px; transition: border-color 0.2s, width 0.3s var(--ease), box-shadow 0.2s; }
.search-input:focus { border-color: var(--gold-dim); width: 250px; box-shadow: 0 0 0 3px var(--gold-glow); }
.search-input:disabled { opacity: 0.55; cursor: not-allowed; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-icon svg { width: 13px; height: 13px; color: var(--text-dim); }

/* ============ TOAST ============ */
.toaster { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface2); border: 1px solid var(--border-strong); border-left: 3px solid var(--gold);
  border-radius: var(--radius); padding: 13px 18px;
  font-size: 13px; color: var(--text); line-height: 1.5;
  display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.35s var(--ease); max-width: 320px;
  box-shadow: var(--shadow-md);
}

/* ============ ANIMAÇÕES ============ */
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(22px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.fade-in { animation: fadeUp 0.45s var(--ease) both; }

/* entrada escalonada dos cards em grids */
.stats-row > *, .trilhas-grid > *, .cert-grid > * { animation: fadeUp 0.45s var(--ease) both; }
.stats-row > *:nth-child(1), .trilhas-grid > *:nth-child(1), .cert-grid > *:nth-child(1) { animation-delay: 0.03s; }
.stats-row > *:nth-child(2), .trilhas-grid > *:nth-child(2), .cert-grid > *:nth-child(2) { animation-delay: 0.08s; }
.stats-row > *:nth-child(3), .trilhas-grid > *:nth-child(3), .cert-grid > *:nth-child(3) { animation-delay: 0.13s; }
.stats-row > *:nth-child(4), .trilhas-grid > *:nth-child(4), .cert-grid > *:nth-child(4) { animation-delay: 0.18s; }
.stats-row > *:nth-child(n+5), .trilhas-grid > *:nth-child(n+5), .cert-grid > *:nth-child(n+5) { animation-delay: 0.22s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ============ RESPONSIVIDADE ============ */
.sidebar-backdrop { display: none; }
@media (max-width: 1024px) {
  .trilhas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-layout { grid-template-columns: 1fr; }
  .perfil-layout { grid-template-columns: 1fr; }
  .perfil-card { position: static; }
}
@media (max-width: 900px) {
  .login-split { flex-direction: column; }
  .login-brand { flex: none; max-width: none; min-width: 0; padding: 44px 32px 32px; align-items: center; text-align: center; justify-content: flex-start; gap: 8px; }
  .login-brand::after { display: none; }
  .brand-logo-row { flex-direction: column; }
  .brand-content { margin: 24px 0 8px; }
  .brand-headline { max-width: 100%; font-size: 28px; }
  .brand-desc { max-width: 100%; }
  .brand-footer { display: none; }
  .login-panel { padding: 8px 32px 56px; }
}
@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trilhas-grid { grid-template-columns: minmax(0, 1fr); }
  .cert-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-body { padding: 24px 18px 48px; }
  .topbar { padding: 0 18px; }
  .welcome-title { font-size: 32px; }
  .trilha-hero { grid-template-columns: 1fr; padding: 26px; }
  .trilha-hero-stats { flex-direction: row; align-items: center; justify-content: space-between; }
  .hero-stat { text-align: left; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar-menu-btn { display: flex; }
  .search-wrap { display: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); z-index: 90; }
  .ranking-table { display: block; overflow-x: auto; }
}

/* ============ IMPRESSÃO (certificado) ============ */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .btn-row, .toaster, .sidebar-backdrop { display: none !important; }
  .main-content { margin-left: 0; }
  .page-body { padding: 0; max-width: none; }
  .cert-paper { background: #fff; border-color: #B99B54; box-shadow: none; color: #211E15; }
  .cert-paper-title { color: #8E6E1F; }
  .cert-paper-name { color: #211E15; }
  .cert-paper-desc, .cert-paper-meta { color: #555; }
}
