/* =====================================================================
   LabsFlows · Academic Studio
   Escopo: só vale dentro de <body class="studio">. As demais páginas
   continuam usando app.css até a aprovação do redesign.
   ===================================================================== */

.studio {
  /* ---- escalas -------------------------------------------------------
     Azul (marca), neutros cinza-azulados (mesma família do azul) e cores
     de estado. As regras abaixo usam só os papéis semânticos. */
  --blue-50: #EEF2FE;  --blue-100: #E0E7FD; --blue-200: #C5D3FB; --blue-300: #9DB4F7;
  --blue-500: #2F5BEA; --blue-600: #2449C4; --blue-700: #1E3A8A;
  --gray-0: #FFFFFF;   --gray-25: #F7F8FB;  --gray-50: #F1F3F8;  --gray-100: #E4E8EF;
  --gray-200: #D3D9E3; --gray-400: #8B95A7; --gray-600: #586379; --gray-900: #172033;
  --green-50: #E8F5EE; --green-200: #BEE1CC; --green-600: #1F7A4D;
  --amber-50: #FDF4E3; --amber-200: #F1DCAD; --amber-700: #8F5A00;
  --red-50: #FDEDEB;   --red-200: #F3C6C1;   --red-600: #C13A2E;

  /* ---- papéis -------------------------------------------------------- */
  --bg: var(--gray-25);
  --surface: var(--gray-0);
  --surface-2: var(--gray-50);
  --border: var(--gray-100);
  --border-strong: var(--gray-200);
  --text: var(--gray-900);
  --muted: var(--gray-600);
  --subtle: var(--gray-400);
  --brand: var(--blue-500);
  --brand-hover: var(--blue-600);
  --brand-ink: #FFFFFF;
  --accent: var(--blue-50);
  --accent-2: var(--blue-100);
  --accent-border: var(--blue-200);
  --accent-ink: var(--blue-700);
  --ok: var(--green-600);   --ok-bg: var(--green-50);   --ok-border: var(--green-200);
  --warn: var(--amber-700); --warn-bg: var(--amber-50); --warn-border: var(--amber-200);
  --danger: var(--red-600); --danger-bg: var(--red-50); --danger-border: var(--red-200);
  --overlay: rgba(23, 32, 51, .6);
  --shadow-pop: 0 12px 40px rgba(23, 32, 51, .16);

  /* ---- editor e console (escuro neutro, cores originais do editor) ---- */
  --code-bg: #1E1E1E;
  --code-bar: #252526;
  --code-line: #333333;
  --code-btn: #333333;
  --code-btn-border: #444444;
  --code-btn-hover: #3C3C3C;
  --code-text: #E6E6E6;
  --code-muted: #9A9A9A;
  --code-input: #161616;
  --code-run: #3D8B5F;          /* verde do "Verificar resposta" */
  --code-run-hover: #46996A;
  --code-ok: #8FD1A8;
  --code-err: #F09A8E;
  --code-accent: var(--blue-300);
  --code-dot-ok: #4CB27B;
  --code-dot-busy: #E0B45A;

  /* forma */
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: none;
  --focus: 0 0 0 3px rgba(47, 91, 234, .22);
  /* tipografia */
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* espaçamento */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.studio h1 { font-size: 1.375rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.studio h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.005em; }
.studio h3 { font-size: .95rem; font-weight: 600; }
.studio a { color: var(--brand); }
.studio code, .studio pre { font-family: var(--mono); }
.studio code { background: var(--surface-2); border-radius: 4px; font-size: .86em; padding: .08em .35em; }
.studio pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.studio .muted { color: var(--muted); }
.studio :focus-visible { outline: none; box-shadow: var(--focus); }

/* ícones (Lucide) */
.studio .ico, .studio svg.lucide { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.studio .ico-lg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- marca */
.studio .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.studio .brand:hover { text-decoration: none; }
.studio .brand-mark { display: block; flex: none; }
.studio .wordmark { font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; }
.studio .wordmark span { color: var(--brand); font-weight: 500; }

/* ---------------------------------------------------------------- botões */
.studio .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 .875rem/1 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.studio .btn:hover { background: var(--surface-2); text-decoration: none; }
.studio .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.studio .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.studio .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.studio .btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.studio .btn.sm { height: 28px; padding: 0 10px; font-size: .8125rem; }
.studio .btn.icon { width: 34px; padding: 0; }
.studio .btn.block { width: 100%; height: 40px; }
.studio .btn:disabled, .studio .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------------------------- formulários */
.studio label { font-weight: 500; font-size: .8125rem; color: var(--text); margin-bottom: 6px; }
.studio input[type=text], .studio input[type=email], .studio input[type=password], .studio textarea, .studio select {
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  font: 400 .9375rem/1.4 var(--sans); padding: 9px 11px; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.studio input:focus, .studio textarea:focus, .studio select:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.studio .field + .field { margin-top: var(--s4); }

/* ---------------------------------------------------------------- avisos e estados */
.studio .alert { border-radius: var(--radius); padding: 10px 12px; font-size: .875rem; display: flex; gap: 8px; align-items: flex-start; border: 1px solid transparent; }
.studio .alert.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.studio .alert.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.studio .alert.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.studio .badge { border-radius: 4px; font-weight: 500; font-size: .75rem; padding: 2px 8px; background: var(--surface-2); color: var(--muted); }
.studio .badge.ok { background: var(--ok-bg); color: var(--ok); }
.studio .badge.warn { background: var(--warn-bg); color: var(--warn); }
.studio .badge.danger { background: var(--danger-bg); color: var(--danger); }

/* ================================================================= LOGIN */
.studio-auth .auth-shell { min-height: 100vh; display: grid; }
.studio-auth .auth-shell { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.studio-auth .auth-brand {
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s6) clamp(24px, 5vw, 72px); display: flex; flex-direction: column; gap: var(--s5);
  border-right: 1px solid var(--accent-2);
}
.studio-auth .brand-top { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.studio-auth .eyebrow { font: 600 .72rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
  border: 1px solid var(--accent-border); border-radius: 999px; padding: 5px 10px; background: var(--surface); }
.studio-auth .hero h1 { font-size: 1.875rem; line-height: 1.2; margin: var(--s4) 0 var(--s3); max-width: 20ch; color: var(--text); letter-spacing: -.02em; }
.studio-auth .lead { font-size: .975rem; color: var(--muted); max-width: 60ch; margin: 0; line-height: 1.6; }

/* terminal de exemplo */
.studio-auth .terminal { margin: 0; max-width: 620px; background: var(--code-bg); border-radius: var(--radius-lg); border: 1px solid var(--code-line); overflow: hidden; }
.studio-auth .term-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--code-bar); border-bottom: 1px solid var(--code-line); }
.studio-auth .term-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--code-btn-border); }
.studio-auth .term-bar em { margin-left: 8px; font: 400 .72rem/1 var(--mono); color: var(--code-muted); font-style: normal; }
.studio-auth .terminal pre { margin: 0; padding: 12px 16px 14px; background: transparent; border: 0; border-radius: 0;
  color: var(--code-text); font: 12.5px/1.65 var(--mono); white-space: pre; overflow-x: auto; }
.studio-auth .t-ok { color: var(--code-ok); }
.studio-auth .t-no { color: var(--code-err); }
.studio-auth .t-dim { color: var(--code-muted); }

/* diferenciais técnicos */
.studio-auth .tech-grid { list-style: none; padding: 0; margin: 0; max-width: 620px; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s5); }
.studio-auth .tech-grid li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.studio-auth .tech-grid .ico { color: var(--brand); width: 18px; height: 18px; margin-top: 2px; }
.studio-auth .tech-grid strong { display: block; color: var(--text); font-weight: 600; font-size: .9rem; margin-bottom: 2px; }
.studio-auth .tech-grid span { font-size: .8125rem; color: var(--muted); line-height: 1.5; }
.studio-auth .mobile-tag { margin: var(--s2) 0 0; font-size: .8125rem; color: var(--muted); }
@media (max-width: 1100px) { .studio-auth .tech-grid { grid-template-columns: 1fr; } }
.studio-auth .auth-panel { display: grid; place-items: center; padding: var(--s7) var(--s4); }
.studio-auth .auth-card { width: 100%; max-width: 380px; }
.studio-auth .auth-card h2 { font-size: 1.375rem; margin: 0 0 var(--s1); }
.studio-auth .auth-card .sub { color: var(--muted); margin: 0 0 var(--s5); font-size: .9375rem; }
.studio-auth .auth-card form { margin-top: var(--s4); }
.studio-auth .forgot { display: flex; justify-content: flex-end; margin-top: var(--s2); font-size: .8125rem; }
.studio-auth .auth-links { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--border); display: grid; gap: var(--s2); font-size: .875rem; }
.studio-auth .auth-links .first { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.studio-auth .auth-links .first:hover { border-color: var(--brand); }
.studio-auth .auth-links .first .grow { flex: 1; }
.studio-auth .auth-links .first small { display: block; color: var(--muted); font-size: .8125rem; }
.studio-auth .auth-links .first .ico { color: var(--brand); }
.studio-auth .auth-legal { margin-top: var(--s5); font-size: .8125rem; color: var(--subtle); }
.studio-auth .auth-legal a { color: var(--muted); }
.studio-auth .mobile-brand { display: none; margin-bottom: var(--s6); }

@media (max-width: 860px) {
  .studio-auth .auth-shell { grid-template-columns: 1fr; }
  .studio-auth .auth-brand { display: none; }
  .studio-auth .mobile-brand { display: block; }
  .studio-auth .auth-panel { place-items: start center; padding-top: var(--s6); }
}

/* ================================================================= LABORATÓRIO */
.studio.lab { background: var(--bg); }
.studio .topbar {
  height: 52px; gap: var(--s3); padding: 0 var(--s4); background: var(--surface);
  border-bottom: 1px solid var(--border); font-size: .875rem;
}
.studio .topbar .brand .wordmark { font-size: .95rem; }
.studio .topbar .sep { width: 1px; height: 20px; background: var(--border); flex: none; }
.studio .topbar .lab-title { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28vw; }
.studio .topbar .who { color: var(--muted); font-size: .8125rem; text-decoration: none; }
.studio .topbar .who:hover { color: var(--text); }
.studio .deadline { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.studio .deadline.danger { background: var(--danger-bg); color: var(--danger); }
.studio .deadline.warn { background: var(--warn-bg); color: var(--warn); }

/* etapas (exercícios) */
.studio .ex-nav { gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
.studio .ex-nav button {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); font: 600 .75rem/1 var(--sans);
  display: grid; place-items: center; transition: background .12s, border-color .12s;
}
.studio .ex-nav button:hover { border-color: var(--brand); color: var(--brand); }
.studio .ex-nav button.current { border-color: var(--brand); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.studio .ex-nav button.completed { background: var(--brand); border-color: var(--brand); color: #fff; }
.studio .ex-nav button.passed { background: var(--accent-2); border-color: var(--blue-300); color: var(--accent-ink); }
.studio .ex-nav button.in_progress { border-color: var(--accent-border); color: var(--accent-ink); background: var(--accent); }
.studio .ex-nav button.locked { background: var(--surface-2); color: var(--subtle); border-color: var(--border-strong); border-style: dashed; opacity: 1; }
.studio .ex-nav button .ico { width: 13px; height: 13px; }

/* painel esquerdo */
.studio .lab-main { grid-template-columns: minmax(340px, 42%) 1fr; }
.studio .lab-left { background: var(--surface); border-right: 1px solid var(--border); }
.studio .tabs { padding: 0 var(--s5); gap: var(--s4); border-bottom: 1px solid var(--border); }
.studio .tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 12px 0; font: 500 .8125rem/1 var(--sans); color: var(--muted); border-bottom: 2px solid transparent; }
.studio .tabs button.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.studio .lab-scroll { padding: var(--s5) var(--s5) var(--s7); }
.studio .ex-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .78rem; color: var(--muted); margin-bottom: var(--s2); }
.studio .ex-meta .lang { font-family: var(--mono); font-size: .72rem; background: var(--accent); color: var(--accent-ink); padding: 1px 6px; border-radius: 4px; }
.studio #ex-title { font-size: 1.25rem; margin: 0 0 var(--s4); }
.studio .instructions { font-size: .9375rem; line-height: 1.65; }
.studio .instructions p { margin: 0 0 var(--s3); }
.studio .instructions ul, .studio .instructions ol { padding-left: 1.25rem; margin: 0 0 var(--s3); }
.studio .instructions li { margin-bottom: 4px; }
.studio .instructions table { margin: var(--s3) 0; font-size: .875rem; border: 1px solid var(--border); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.studio .instructions th { background: var(--surface-2); color: var(--muted); text-transform: none; letter-spacing: 0; font-size: .78rem; }
.studio .instructions th, .studio .instructions td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.studio .instructions tr:last-child td { border-bottom: 0; }
.studio .instructions blockquote { margin: var(--s3) 0; padding: var(--s2) var(--s3); border-left: 3px solid var(--brand); background: var(--accent); color: var(--accent-ink); border-radius: 0 var(--radius) var(--radius) 0; }
.studio .instructions pre { padding: var(--s3); }
.studio .param { font-family: var(--mono); background: var(--accent); color: var(--accent-ink); font-weight: 500; padding: 0 .35em; border-radius: 4px; }

.studio .ex-actions { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.studio .ex-actions .muted { font-size: .8125rem; }
.studio .hint { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 10px 12px; margin-top: var(--s2); font-size: .875rem; }
.studio .hint .ico { color: var(--warn); margin-top: 2px; }

/* feedback dos testes */
.studio .feedback { margin-top: var(--s4); border-radius: var(--radius-lg); padding: 0; white-space: normal; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.studio .feedback .fb-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; font-size: .9rem; }
.studio .feedback.ok .fb-head { background: var(--ok-bg); color: var(--ok); }
.studio .feedback.fail .fb-head { background: var(--danger-bg); color: var(--danger); }
.studio .feedback .fb-body { padding: 10px 14px; font-size: .875rem; color: var(--text); white-space: pre-wrap; }
.studio .feedback .reason { font-size: .8125rem; color: var(--muted); margin-top: 6px; font-family: var(--mono); white-space: pre-wrap; }
.studio .feedback ul.checks { list-style: none; margin: 0; padding: 0 14px 12px; display: grid; gap: 4px; font-size: .8125rem; }
.studio .feedback ul.checks li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.studio .feedback ul.checks li.ok .ico { color: var(--ok); }
.studio .feedback ul.checks li.no { color: var(--text); }
.studio .feedback ul.checks li.no .ico { color: var(--danger); }
.studio .feedback ul.checks code { background: transparent; padding: 0; }

/* reflexão */
.studio .reflection { margin-top: var(--s4); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s4); background: var(--surface); box-shadow: none; }
.studio .reflection h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--s2); }
.studio .reflection textarea { min-height: 120px; resize: vertical; font-size: .9rem; }
.studio .ex-pager { display: flex; justify-content: space-between; margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--border); }

/* painel direito: editor e console */
.studio .lab-right { background: var(--code-bg); }
/* barra do editor: mesmas cores de antes (botões cinza, "Verificar" verde) */
.studio .toolbar { gap: var(--s2); padding: 8px var(--s3); background: var(--code-bar); border-bottom: 1px solid var(--code-line); }
.studio .toolbar .btn { background: var(--code-btn); border-color: var(--code-btn-border); color: var(--code-text); height: 34px; font-size: .9rem; }
.studio .toolbar .btn:hover { background: var(--code-btn-hover); }
.studio .toolbar .btn.success { background: var(--code-run); border-color: var(--code-run); color: #FFFFFF; }
.studio .toolbar .btn.success:hover { background: var(--code-run-hover); border-color: var(--code-run-hover); }
.studio .toolbar .btn:disabled { opacity: .4; }
.studio .toolbar .status { display: inline-flex; align-items: center; gap: 6px; color: var(--code-muted); font: 400 .75rem/1.2 var(--sans);
  margin-left: auto; min-width: 0; max-width: 45%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.studio .toolbar .status::before { flex: none; }
.studio .toolbar .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--code-dot-ok); }
.studio .toolbar .status.busy::before { background: var(--code-dot-busy); animation: studio-pulse 1s ease-in-out infinite; }
@keyframes studio-pulse { 50% { opacity: .3; } }
.studio .kbd { font: 500 .68rem/1 var(--mono); color: var(--code-muted); border: 1px solid var(--code-btn-border); border-radius: 4px; padding: 2px 4px; margin-left: 2px; }
.studio .splitter { background: var(--code-line); }
.studio .console { font: 13px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--code-text); }
.studio .console-head { display: flex; align-items: center; gap: 6px; padding: 6px var(--s3); font: 600 .7rem/1 var(--sans); letter-spacing: .06em; color: var(--code-muted); border-bottom: 1px solid var(--code-line); }
.studio .console-head button { color: var(--code-muted); font: 500 .72rem/1 var(--sans); }
.studio .console-head button:hover { color: var(--code-text); }
.studio .console-out { padding: var(--s2) var(--s3); }
.studio .console-out .sys { color: var(--code-muted); font-style: normal; }
.studio .console-out .err { color: var(--code-err); }
.studio .console-out .in { color: var(--code-accent); }
.studio .console-out .vars { color: var(--code-ok); }
.studio .console-in { border-top: 1px solid var(--code-line); padding: 6px var(--s3); }
.studio .console-in span { color: var(--code-accent); }
.studio .stdin-box { border-bottom: 1px solid var(--code-line); }
.studio .stdin-box label { display: block; margin: 0 0 6px; color: var(--code-muted); font: 500 .7rem/1.3 var(--sans); letter-spacing: .04em; }
.studio .stdin-box textarea { background: var(--code-input); color: var(--code-text); border-color: var(--code-line); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.studio .stdin-box textarea::placeholder { color: var(--code-muted); opacity: .7; }

/* editor claro (botão sol/lua na barra do editor; escolha do aluno) */
.studio .lab-right.code-light {
  --code-bg: #FFFFFF; --code-bar: #F3F4F5; --code-line: #E1E4E8;
  --code-btn: #FFFFFF; --code-btn-border: #CDD2D8; --code-btn-hover: #ECEEF1;
  --code-text: #1F2328; --code-muted: #656D76; --code-input: #F8F9FA;
  --code-ok: #1F7A4D; --code-err: #B3261E; --code-accent: #284D7A;
}

/* sobreposições (tela cheia, confirmação) e toast */
.studio .fs-overlay { background: var(--overlay); backdrop-filter: blur(2px); }
.studio .fs-card { border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-pop); padding: var(--s5) var(--s6); max-width: 560px; }
.studio .fs-card h2 { font-size: 1.125rem; margin: 0 0 var(--s3); }
.studio .fs-card ul { margin: 0 0 var(--s4); font-size: .9rem; }
.studio .fs-card.alert-exit h2 { color: var(--danger); }
.studio .toast { background: var(--text); border-radius: var(--radius); font-size: .85rem; box-shadow: var(--shadow-pop); }

@media (max-width: 860px) {
  .studio .lab-main { grid-template-columns: 1fr; }
  .studio .topbar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 6px var(--s3); }
  .studio .topbar .lab-title { max-width: 60vw; }
  .studio .topbar .sep, .studio .topbar .who { display: none; }
  .studio .tabs, .studio .lab-scroll { padding-left: var(--s4); padding-right: var(--s4); }
}

/* =====================================================================
   "Blue Academic Studio" — padrão das telas novas: <body class="studio academic">
   (login e laboratório). Redefine os papéis e refina
   cabeçalho, enunciado, código inline, dica e paginação.
   ===================================================================== */
.studio.academic {
  --brand: #284D7A;          --brand-hover: #1D3B60; --accent-strong: #3568A3;
  --accent: #ECF2FA;         --accent-2: #DCE7F5;   --accent-border: #C9D8EC; --accent-ink: #284D7A;
  --bg: #F7F9FC;             --surface: #FFFFFF;    --surface-2: #F1F5FA;
  --border: #DEE6F0;         --border-strong: #CBD6E3;
  --text: #1B2B40;           --muted: #62758B;      --subtle: #8496AB;
  --ok: #2F6B4F;    --ok-bg: #EEF5F0;     --ok-border: #C9DDD0;
  --warn: #7A5A1E;  --warn-bg: #F8F3E8;   --warn-border: #E6D8B8;
  --danger: #9E3D35; --danger-bg: #F8EEEC; --danger-border: #E6CBC7;
  --focus: 0 0 0 3px rgba(53, 104, 163, .22);
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --measure: 68ch;
}
/* marca acompanha o azul dessaturado */
.studio.academic .brand-mark rect { fill: var(--brand); }
.studio.academic .brand-mark path:first-of-type { fill: #9CB6D8; }
.studio.academic .brand-mark path:nth-of-type(2), .studio.academic .brand-mark circle { stroke: #E3ECF8; fill: #E3ECF8; }
.studio.academic .brand-mark path:nth-of-type(2) { fill: none; }

/* cabeçalho: faixa editorial, sem cara de navbar */
.studio.academic .topbar { height: 56px; background: var(--bg); border-bottom: 1px solid var(--border); }
.studio.academic .topbar .lab-title { font: 500 .9rem/1.2 var(--serif); color: var(--text); letter-spacing: 0; }
.studio.academic .topbar #btn-leave { background: transparent; border-color: var(--border); color: var(--muted); }
.studio.academic .topbar #btn-leave:hover { color: var(--text); border-color: var(--border-strong); }
.studio.academic .ex-nav { gap: 2px; margin-left: var(--s2); }
.studio.academic .ex-nav button { width: 26px; height: 26px; border-radius: 50%; border-color: transparent; background: transparent; color: var(--subtle); font-weight: 500; }
.studio.academic .ex-nav button:hover { color: var(--brand); border-color: var(--border-strong); }
.studio.academic .ex-nav button.in_progress { background: transparent; color: var(--text); border-color: var(--border-strong); }
.studio.academic .ex-nav button.passed { background: var(--accent); color: var(--accent-ink); border: 1px dashed var(--brand); }
.studio.academic .ex-nav button.completed { background: var(--accent-2); color: var(--accent-ink); border-color: var(--accent-2); }
.studio.academic .ex-nav button.locked { background: transparent; border: 1px dashed var(--border-strong); color: var(--subtle); }
.studio.academic .ex-nav button.current { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: none; }

/* coluna de leitura */
.studio.academic .lab-left { background: var(--surface); }
.studio.academic .tabs { padding: 0 var(--s6); }
.studio.academic .lab-scroll { padding: var(--s6) var(--s6) var(--s7); }
.studio.academic .lab-scroll > * { max-width: var(--measure); }
.studio.academic .ex-meta .lang { margin-left: 6px; }
.studio.academic .ex-meta { gap: 6px 5px; font-size: .7rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s3); }
.studio .ex-meta .lib { font: 400 .68rem/1.4 var(--mono); color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.studio.academic .ex-meta .lib { letter-spacing: 0; text-transform: none; border: 1px solid var(--border); }
.studio.academic .ex-meta .lang { font: 500 .68rem/1.4 var(--mono); letter-spacing: 0; text-transform: none; background: transparent; color: var(--brand); border: 1px solid var(--accent-border); padding: 0 6px; border-radius: 999px; }
.studio.academic #ex-title { font: 600 1.6rem/1.25 var(--serif); letter-spacing: -.01em; margin: 0 0 var(--s4); }
.studio.academic .instructions { font-size: 1rem; line-height: 1.75; color: var(--text); }
.studio.academic .instructions p { margin: 0 0 var(--s4); }
.studio.academic .instructions strong { font-weight: 600; color: var(--text); }
.studio.academic .instructions blockquote { background: var(--accent); border-left-color: var(--brand); color: var(--text); }

/* código inline: chip discreto, com fio fino */
.studio.academic .instructions code, .studio.academic .reflection code {
  font-size: .84em; color: var(--accent-ink); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 3px; padding: .05em .32em; white-space: nowrap;
}
.studio.academic .instructions pre code { border: 0; padding: 0; white-space: pre; background: none; }
.studio.academic .instructions pre { background: var(--surface-2); border-color: var(--border); }
.studio.academic .param { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent-border); border-radius: 3px; }

/* dica: ação de texto, e a dica aberta como nota de margem */
.studio.academic .ex-actions { margin-top: var(--s5); gap: var(--s3); }
.studio.academic #btn-hint { height: 30px; padding: 0 12px; border-radius: 999px; background: transparent; border-color: var(--accent-border); color: var(--brand); font-weight: 500; }
.studio.academic #btn-hint:hover { background: var(--accent); border-color: var(--brand); }
.studio.academic #hint-count { font-size: .78rem; color: var(--subtle); }
.studio.academic .hint { background: var(--accent); color: var(--text); border: 0; border-left: 3px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 14px; font-size: .92rem; line-height: 1.6; }
.studio.academic .hint .ico { color: var(--brand); }

/* feedback e reflexão mais sóbrios */
.studio.academic .feedback, .studio.academic .reflection { border-radius: var(--radius); border-color: var(--border); }
.studio.academic .feedback .fb-head { font-size: .85rem; border-bottom: 1px solid var(--border); }
.studio.academic .reflection h3 { font: 600 1.05rem/1.3 var(--serif); }

/* Anterior / Próximo: dois blocos com o título do vizinho */
.studio.academic .ex-pager { gap: var(--s3); margin-top: var(--s7); padding-top: var(--s5); }
.studio.academic .ex-pager .pg { flex: 1 1 0; min-width: 0; height: auto; padding: 10px 14px; gap: 10px; justify-content: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; white-space: normal; }
.studio.academic .ex-pager .pg.next { justify-content: flex-end; text-align: right; }
.studio.academic .ex-pager .pg span { display: grid; gap: 2px; min-width: 0; }
.studio.academic .ex-pager .pg small { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.studio.academic .ex-pager .pg b { font: 500 .88rem/1.35 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio.academic .ex-pager .pg .ico { color: var(--brand); }
.studio.academic .ex-pager .pg:hover { border-color: var(--brand); background: var(--accent); }
.studio.academic .ex-pager .pg:disabled { visibility: hidden; }

/* login no mesmo padrão */

@media (max-width: 860px) {
  .studio.academic .tabs, .studio.academic .lab-scroll { padding-left: var(--s4); padding-right: var(--s4); }
  .studio.academic #ex-title { font-size: 1.35rem; }
}

/* login: animação de entrada (texto sobe, terminal "digita" e as verificações aparecem) */
.studio-auth .hero, .studio-auth .areas li, .studio-auth .pedagogy { animation: lf-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.studio-auth .areas li:nth-child(1) { animation-delay: 4s; }
.studio-auth .areas li:nth-child(2) { animation-delay: 4.12s; }
.studio-auth .areas li:nth-child(3) { animation-delay: 4.24s; }
.studio-auth .areas li:nth-child(4) { animation-delay: 4.36s; }
.studio-auth .pedagogy { animation-delay: 4.6s; }
.studio-auth .terminal { animation: lf-rise .7s .2s cubic-bezier(.2, .7, .2, 1) both; }
.studio-auth .terminal .ln { display: block; }
.studio-auth .terminal .ln[style] { animation: lf-line .5s calc(1.5s + var(--i) * .42s) ease-out both; }
.studio-auth .terminal .typed { display: inline-block; vertical-align: bottom; overflow: hidden; white-space: nowrap;
  width: var(--w, 30ch); animation: lf-type 1.3s .5s steps(var(--n, 30)) both; }
.studio-auth .terminal .caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 4px; vertical-align: -2px;
  background: var(--code-muted); animation: lf-blink 1s steps(1) infinite; }
.studio-auth .brand-mark circle { transform-box: fill-box; transform-origin: center; animation: lf-bubble 3.2s ease-in infinite; }
.studio-auth .brand-mark circle + circle { animation-delay: 1.6s; }
@keyframes lf-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes lf-line { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes lf-type { from { width: 0; } }
@keyframes lf-blink { 50% { opacity: 0; } }
@keyframes lf-bubble { 0% { transform: translateY(2px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-6px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .studio-auth *, .studio-auth *::before { animation: none !important; }
}

/* =====================================================================
   Página inicial institucional (piloto): <body class="... inst">
   Paleta própria do piloto; animação acima preservada (mesma sequência).
   ===================================================================== */
.studio-auth.inst {
  /* paleta: a mesma de .studio.academic; aqui só o terminal em azul profundo */
  --code-bg: #12233A; --code-bar: #172B45; --code-line: #22385A; --code-btn-border: #2E4970;
  --code-text: #E3EAF3; --code-muted: #8DA2BC; --code-ok: #8FD3AE; --code-accent: #9CC0EC;
}
.studio-auth.inst .auth-brand { background: var(--accent); border-right: 1px solid var(--border); gap: var(--s5); padding-top: var(--s6); padding-bottom: var(--s6); }
.studio-auth.inst .eyebrow { background: var(--surface); color: var(--brand); border-color: var(--accent-border); }
.studio-auth.inst .hero h1 { font: 600 clamp(1.6rem, 2.3vw, 2.1rem)/1.18 var(--sans); letter-spacing: -.022em; max-width: 24ch; margin: var(--s3) 0 var(--s3); }
.studio-auth.inst .hero h1 span { color: var(--accent-strong); }
.studio-auth.inst .lead { font-size: 1.02rem; color: var(--text); max-width: 58ch; line-height: 1.6; }
.studio-auth.inst .lead-2 { font-size: .9rem; color: var(--muted); max-width: 62ch; line-height: 1.6; margin: var(--s2) 0 0; }
.studio-auth.inst .terminal { max-width: 640px; border-color: var(--code-line); }
.studio-auth.inst .terminal pre { font-size: 12.5px; line-height: 1.75; }
.studio-auth.inst .stage { color: var(--code-accent); font-weight: 500; }
.studio-auth .areas { list-style: none; padding: 0; margin: 0; max-width: 640px; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s5); }
.studio-auth .areas li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding-top: var(--s3); border-top: 1px solid var(--accent-border); }
.studio-auth .areas .ico { color: var(--accent-strong); width: 17px; height: 17px; margin-top: 1px; }
.studio-auth .areas strong { display: block; color: var(--text); font-weight: 600; font-size: .86rem; margin-bottom: 3px; }
.studio-auth .areas span { display: block; font-size: .78rem; color: var(--muted); line-height: 1.5; }
.studio-auth .pedagogy { display: flex; gap: 10px; align-items: flex-start; max-width: 640px; margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.55; }
.studio-auth .pedagogy .ico { color: var(--brand); margin-top: 1px; }
.studio-auth.inst .auth-panel { background: var(--bg); }
.studio-auth.inst .auth-card h2 { font: 600 1.5rem/1.25 var(--sans); letter-spacing: -.015em; }
.studio-auth.inst .btn.primary { background: var(--brand); border-color: var(--brand); }
.studio-auth.inst .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.studio-auth.inst a { color: var(--accent-strong); }
.studio-auth.inst .auth-legal a { color: var(--muted); }
@media (max-width: 1100px) { .studio-auth .areas { grid-template-columns: 1fr; } }
/* celular: o login vem primeiro; a apresentação (com a animação, simplificada) fica logo abaixo */
@media (max-width: 860px) {
  .studio-auth.inst .auth-brand { display: flex; order: 2; border-right: 0; border-top: 1px solid var(--border); padding: var(--s6) var(--s4); }
  .studio-auth.inst .auth-brand .brand-top { display: none; }
  .studio-auth.inst .auth-panel { order: 1; padding-bottom: var(--s6); }
  .studio-auth.inst .hero h1 { font-size: 1.45rem; }
  .studio-auth.inst .lead-2 { display: none; }
  .studio-auth.inst .terminal pre { font-size: 11px; white-space: pre-wrap; }
  .studio-auth.inst .terminal .ln[style] { padding-left: 0; }
  .studio-auth.inst .terminal .typed { max-width: 100%; }
}

/* =====================================================================
   Demais páginas (painel do aluno, conta, professor, termos, acesso):
   <body class="studio academic page">, padrão do base.html
   ===================================================================== */
.studio.page { min-height: 100vh; }
.studio.page .topbar { position: sticky; top: 0; z-index: 10; }
.studio .topbar .nav-link, .studio .topbar .who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; text-decoration: none; }
.studio .topbar .nav-link:hover, .studio .topbar .who:hover { color: var(--brand); }
.studio.page .container { max-width: 1080px; padding: var(--s6) var(--s5) var(--s7); }
.studio.page .container .container { padding: 0; }
.studio.page .narrow { max-width: 440px; padding-top: 5vh; }
.studio.page h1 { font: 600 2rem/1.2 var(--serif); letter-spacing: -.01em; margin: 0 0 var(--s4); }
.studio.page h2 { font: 600 1.25rem/1.3 var(--serif); margin: var(--s6) 0 var(--s3); }
.studio.page h3 { font-size: 1rem; }
.studio.page .narrow h1 { font-size: 1.6rem; }
.studio.page code { font-size: .86em; color: var(--accent-ink); background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: .02em .3em; }
.studio.page pre code { border: 0; padding: 0; background: none; }
.studio.page .card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: none; padding: var(--s5); }
.studio.page a.card { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.studio.page a.card:hover { border-color: var(--brand); transform: translateY(-1px); }
.studio.page a.card strong { font: 600 1.05rem/1.3 var(--serif); }
.studio.page .grid { gap: var(--s4); }
.studio.page .stack > * + * { margin-top: var(--s4); }
.studio.page table { font-size: .9rem; }
.studio.page th { font-size: .7rem; letter-spacing: .08em; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.studio.page td { padding: 12px; border-bottom: 1px solid var(--border); }
.studio.page tr:last-child td { border-bottom: 0; }
.studio.page tr:hover td { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.studio.page th:hover { background: var(--surface-2); }
.studio.page .card[style*="padding:0"]:not(.results-wrap) { overflow: hidden; }
.studio.page .results-wrap { overflow-x: auto; }
.studio.page input[type=number], .studio.page input[type=datetime-local], .studio.page input[type=date], .studio.page input:not([type]) {
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font: 400 .9375rem/1.4 var(--sans); padding: 8px 10px; color: var(--text); }
.studio.page input:disabled { background: var(--surface-2); color: var(--muted); }
.studio.page textarea.code { font: 13px/1.5 var(--mono); }
.studio.page label { display: block; }
.studio.page input[type=checkbox], .studio.page input[type=radio] { accent-color: var(--brand); }
.studio.page .alert { margin-bottom: var(--s4); }
.studio.page .badge { display: inline-block; border-radius: 999px; padding: 1px 9px; border: 1px solid var(--border); background: var(--surface-2); }
.studio.page .badge.ok { border-color: var(--ok-border); }
.studio.page .badge.warn { border-color: var(--warn-border); }
.studio.page .badge.danger { border-color: var(--danger-border); }
.studio.page .progressbar { height: 5px; background: var(--accent-2); border-radius: 999px; margin-top: var(--s3); }
.studio.page .progressbar > div { background: var(--brand); border-radius: 999px; }
.studio.page .kv dt { color: var(--muted); }
.studio.page details > summary { list-style: none; }
.studio.page .terms { line-height: 1.7; }
.studio.page .terms h2 { font: 600 1.05rem/1.3 var(--serif); }
.studio.page .st.in_progress { color: var(--brand); }
.studio.page .replay { border-color: var(--border); }
@media (max-width: 860px) {
  .studio.page .container { padding: var(--s5) var(--s4) var(--s6); }
  .studio.page h1 { font-size: 1.6rem; }
  .studio.page .topbar .who span, .studio.page .topbar .nav-link { font-size: .8rem; }
}
.studio.page .stack > input[type=hidden] + * { margin-top: 0; }
.studio.page .results th { white-space: nowrap; }
.studio.page input[type=range] { accent-color: var(--brand); }
.studio.page input[type=file] { font: 400 .85rem var(--sans); color: var(--muted); }
.studio.page input[type=file]::file-selector-button { font: 500 .8rem var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 5px 10px; margin-right: 10px; cursor: pointer; }
.studio.page .container:has(> .results-wrap) { max-width: 1480px; }
