/* Plataforma IA para Psicologos: estilos. Sem fontes externas, sem requisicoes a terceiros. */
:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #1b2733;
  --muted: #5b6b7a;
  --line: #d9e0e6;
  --primary: #0f5c6e;
  --primary-700: #0b4653;
  --primary-100: #dff1f4;
  --accent: #c7791a;
  --accent-100: #fdf0dc;
  --success: #1f7a4d;
  --success-100: #e0f3e8;
  --danger: #b42318;
  --danger-100: #fde7e5;
  --warn: #9a6700;
  --warn-100: #fff4d6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; }
a { color: var(--primary); }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .92em; }
pre { background: #1b2733; color: #e6edf3; padding: 1rem; border-radius: 8px; overflow: auto; }
pre code { background: none; padding: 0; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.right { text-align: right; }
.center { text-align: center; }

/* Layout */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: .6rem 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-weight: 700; color: var(--primary-700); text-decoration: none; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #1d8a9f); display: inline-block; }
.nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.nav a, .nav button { color: var(--text); text-decoration: none; padding: .45rem .7rem; border-radius: 8px; font-size: .95rem; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav a:hover, .nav button:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary-100); color: var(--primary-700); font-weight: 600; }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
.narrow { max-width: 760px; }
.footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1.5rem 16px; color: var(--muted); font-size: .85rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer a { color: var(--muted); }

/* Admin shell */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #10232b; color: #cfe3e8; padding: 1rem; position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidebar .brand { color: #fff; margin-bottom: 1rem; }
.sidebar a { display: block; color: #cfe3e8; text-decoration: none; padding: .55rem .7rem; border-radius: 8px; font-size: .95rem; }
.sidebar a:hover { background: rgba(255,255,255,.08); }
.sidebar a.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.sidebar .section { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; color: #8fb3bb; margin: 1rem .7rem .3rem; }
.admin-main { padding: 1.5rem 24px 3rem; min-width: 0; }
.admin-toggle { display: none; }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { display: none; }
  .sidebar.open nav { display: block; }
  .admin-toggle { display: inline-block; float: right; background: none; border: 1px solid #4b6b74; color: #fff; border-radius: 6px; padding: .3rem .6rem; }
  .admin-main { padding: 1rem 16px 3rem; }
}

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .value { font-size: 1.8rem; font-weight: 700; color: var(--primary-700); }
.stat .label { color: var(--muted); font-size: .85rem; }

/* Auth card */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 440px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1rem; border-radius: 9px; border: 1px solid transparent; background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; font-size: .95rem; font-family: inherit; line-height: 1.2; }
.btn:hover { background: var(--primary-700); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f1b12; }
.btn-ghost { background: none; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-100); }
.btn-sm { padding: .35rem .65rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Forms */
.field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .92rem; }
.hint { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-100); border-color: var(--primary); }
textarea { min-height: 120px; resize: vertical; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; min-height: 320px; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .3rem; }
.inline-form { display: inline; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* Alerts */
.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--success-100); color: var(--success); border-color: #bfe3cd; }
.alert-error { background: var(--danger-100); color: var(--danger); border-color: #f4c7c3; }
.alert-info { background: var(--primary-100); color: var(--primary-700); border-color: #b8dde3; }
.alert-warn { background: var(--warn-100); color: var(--warn); border-color: #f1dc9c; }

/* Badges and progress */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge-primary { background: var(--primary-100); color: var(--primary-700); }
.badge-success { background: var(--success-100); color: var(--success); }
.badge-warn { background: var(--warn-100); color: var(--warn); }
.badge-danger { background: var(--danger-100); color: var(--danger); }
.badge-accent { background: var(--accent-100); color: var(--accent); }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #fafbfc; }

/* Lesson list */
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li { display: flex; gap: .75rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.lesson-list li:last-child { border-bottom: 0; }
.lesson-list .num { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.lesson-list .num.done { background: var(--success-100); color: var(--success); }
.lesson-list a { text-decoration: none; color: var(--text); font-weight: 600; }
.lesson-list a:hover { color: var(--primary); }
.lesson-list .meta { color: var(--muted); font-size: .8rem; }

/* Lesson content */
.lesson-body { font-size: 1.04rem; max-width: 760px; }
.lesson-body h2 { margin-top: 1.8rem; font-size: 1.35rem; }
.lesson-body h3 { margin-top: 1.4rem; font-size: 1.12rem; }
.lesson-body ul, .lesson-body ol { padding-left: 1.4rem; }
.lesson-body li { margin-bottom: .35rem; }
.lesson-body blockquote { border-left: 4px solid var(--line); margin: 1rem 0; padding: .25rem 1rem; color: var(--muted); }
.callout { border-radius: 10px; padding: .9rem 1rem; margin: 1.2rem 0; border: 1px solid; }
.callout p:last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin-bottom: .35rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.callout-aviso { background: var(--danger-100); border-color: #f4c7c3; } .callout-aviso .callout-title { color: var(--danger); }
.callout-dica { background: var(--primary-100); border-color: #b8dde3; } .callout-dica .callout-title { color: var(--primary-700); }
.callout-regra { background: var(--warn-100); border-color: #f1dc9c; } .callout-regra .callout-title { color: var(--warn); }
.callout-exemplo { background: var(--accent-100); border-color: #f1d4a8; } .callout-exemplo .callout-title { color: var(--accent); }
.video-wrap { position: relative; padding-top: 56.25%; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 1.2rem; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

/* Quiz */
.quiz-q { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.quiz-q:last-child { border-bottom: 0; }
.quiz-q .options label { font-weight: 400; display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .4rem; cursor: pointer; }
.quiz-q .options label:hover { background: var(--surface-2); }
.quiz-q .options label.correct { border-color: var(--success); background: var(--success-100); }
.quiz-q .options label.wrong { border-color: var(--danger); background: var(--danger-100); }
.explanation { margin-top: .5rem; padding: .6rem .8rem; background: var(--surface-2); border-radius: 8px; font-size: .92rem; }

/* Certificate */
.cert-preview { border: 6px double var(--primary); padding: 2.5rem; text-align: center; background: #fff; }
.cert-preview .cert-name { font-size: 1.8rem; font-weight: 700; margin: 1rem 0; color: var(--primary-700); }

/* Utilities */
.kbd { font-family: ui-monospace, monospace; background: var(--surface-2); padding: .1rem .4rem; border-radius: 4px; font-size: .85rem; }
.copy-box { display: flex; gap: .5rem; }
.copy-box input { flex: 1; }
.empty { padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--primary-700); border-bottom-color: var(--primary); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media print { .topbar, .footer, .no-print { display: none !important; } body { background: #fff; } .container { padding: 0; } }

/* Blocos interativos das aulas (docs/aulas/SINTAXE_INTERATIVA.md) */
.ia { border: 1px solid var(--line); border-left: 4px solid var(--primary); background: var(--surface); border-radius: 10px; padding: 1rem 1.1rem; margin: 1.4rem 0; box-shadow: var(--shadow); }
.ia-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-bottom: .3rem; }
.ia-title { font-weight: 600; margin-bottom: .6rem; }
.ia-hint, .ia-note { font-size: .85rem; color: var(--muted); margin: .4rem 0; }
.ia-note { background: var(--warn-100); color: var(--warn); border-radius: 6px; padding: .35rem .6rem; display: inline-block; }
.ia-opts { list-style: none; padding-left: 0 !important; margin: .4rem 0; }
.ia-opts li { margin-bottom: .45rem; }
.ia-opts label { display: flex; gap: .55rem; align-items: flex-start; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ia-opts label:hover { background: var(--surface-2); }
.ia-opts input { margin-top: .25rem; flex: none; }
.ia-opts li.is-right label { border-color: var(--success); background: var(--success-100); }
.ia-opts li.is-wrong label { border-color: var(--danger); background: var(--danger-100); }
.ia-opts li.is-missed label { border-color: var(--success); border-style: dashed; }
.ia-why { font-size: .9rem; color: var(--muted); padding: .3rem .7rem 0 2.1rem; }
.ia-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .6rem; }
.ia-result { font-size: .9rem; font-weight: 600; }
.ia-result.ok { color: var(--success); } .ia-result.no { color: var(--danger); }
.ia-pense { border-left-color: var(--accent); }
.ia-pense .ia-label { color: var(--accent); }
.ia-pense summary { cursor: pointer; list-style: none; }
.ia-pense summary::-webkit-details-marker { display: none; }
.ia-reveal { display: inline-block; font-size: .9rem; font-weight: 600; color: var(--primary); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .65rem; }
.ia-pense[open] .ia-reveal { display: none; }
.ia-answer { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.ia-answer p:last-child { margin-bottom: 0; }
.ae-text { background: var(--surface-2); border-radius: 8px; padding: .75rem .9rem; line-height: 1.75; font-family: Georgia, "Times New Roman", serif; }
.ae-text p:last-child { margin-bottom: 0; }
.ae-s { cursor: pointer; border-radius: 4px; padding: .05rem .1rem; transition: background .15s; }
.ae-s:hover, .ae-s:focus { background: var(--primary-100); outline: none; }
.ae-s.is-marked { background: var(--warn-100); box-shadow: inset 0 -2px 0 var(--warn); }
.ae-s.is-hit { background: var(--success-100); box-shadow: inset 0 -2px 0 var(--success); }
.ae-s.is-miss { box-shadow: inset 0 -2px 0 var(--danger); background: var(--danger-100); }
.ae-s.is-false { text-decoration: line-through; text-decoration-color: var(--danger); background: none; box-shadow: none; }
.ae-s[data-n]::after { content: attr(data-n); font: 700 .7rem var(--font); color: #fff; background: var(--muted); border-radius: 9px; padding: 0 .35rem; margin-left: .25rem; vertical-align: super; }
.ae-s.is-hit[data-n]::after { background: var(--success); } .ae-s.is-miss[data-n]::after { background: var(--danger); }
.ae-text.is-done .ae-s { cursor: default; }
.ae-notes { margin-top: .8rem; font-size: .92rem; }
.ia-checklist { border-left-color: var(--success); }
.ia-checklist .ia-label { color: var(--success); }
.ia-checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.ia-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem .8rem; margin: .5rem 0; }
.ia-field span { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .15rem; }
.ia-field input { width: 100%; }
.ia-output { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .75rem; font-size: .92rem; margin: .5rem 0 0; font-family: inherit; }
.ia-output mark { background: var(--primary-100); color: var(--primary-700); border-radius: 3px; padding: 0 .15rem; }
.ia-sim { border-left-color: #6b4fa0; }
.ia-sim .ia-label { color: #6b4fa0; }
.sim-step { animation: ia-in .2s ease-out; }
.sim-choices { display: flex; flex-direction: column; gap: .45rem; margin-top: .7rem; }
.sim-choice { justify-content: flex-start; text-align: left; border: 1px solid var(--line); white-space: normal; }
.sim-bom { border-left: 4px solid var(--success); padding-left: .8rem; }
.sim-parcial { border-left: 4px solid var(--warn); padding-left: .8rem; }
.sim-ruim { border-left: 4px solid var(--danger); padding-left: .8rem; }
.sim-step[class*="sim-"]::before { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.sim-bom::before { content: "Boa condução"; color: var(--success); }
.sim-parcial::before { content: "Ainda falta algo"; color: var(--warn); }
.sim-ruim::before { content: "Problema"; color: var(--danger); }
@keyframes ia-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sim-step { animation: none; } }
