/* Aula · Yoner Ojeda Pinto — sistema visual sobrio (verde bosque, latón, marfil) */
:root {
	--base: #143A2E;
	--base-2: #1F4A3C;
	--base-3: #285444;
	--brass: #C2A15F;
	--brass-ink: #6B5426;
	--ivory: #F6F3EC;
	--paper: #FFFFFF;
	--sand: #ECE6D8;
	--line: #DDD5C4;
	--line-2: #B9B2A1;
	--ink: #1E2421;
	--ink-2: #444B47;
	--muted: #59605C;
	--ok: #1E6B45;
	--ok-bg: #E4F0E8;
	--warn: #8A5A00;
	--warn-bg: #FBF0D9;
	--bad: #A23A2E;
	--bad-bg: #F8E6E3;
	--acc: var(--base);
	--radius: 4px;
	--serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
	--sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--shadow: 0 1px 2px rgba(20, 58, 46, .06), 0 4px 16px rgba(20, 58, 46, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
h1, h2, h3, .h1, .h2, .mono, .stat b, .proj h1, .live-hero .ttl { font-variant-numeric: lining-nums; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: var(--brass-ink); }
a:hover { color: #45361A; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Encabezado ---------- */
.topbar { background: var(--base); color: #F2EEE4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; min-height: 60px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; color: #F2EEE4; text-decoration: none; }
.mono { width: 38px; height: 38px; border: 1.5px solid var(--brass); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 600; font-size: 15px; letter-spacing: .5px; color: var(--brass); flex: none; }
.brand-txt { font-size: 12px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; border-radius: 50%; background: var(--base-2); color: #F2EEE4; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--base-3); color: #fff; }
.top-link { color: #F2EEE4; text-decoration: none; font-size: 14px; font-weight: 600; padding: 10px 12px; border-radius: var(--radius); }
.top-link:hover, .top-link[aria-current="page"] { background: var(--base-2); color: #fff; }

/* ---------- Estructura ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 96px; }
.wrap-narrow { max-width: 680px; }
.kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--brass-ink); }
.h1 { margin: 0 0 12px; font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; color: var(--base); }
.h2 { margin: 28px 0 12px; font-family: var(--serif); font-weight: 600; font-size: 25px; line-height: 1.15; color: var(--base); }
.h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.lead { color: var(--ink-2); margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sep { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------- Tarjetas ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-acc { border-top: 4px solid var(--acc); }
.card-link { display: block; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.card-link:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(20, 58, 46, .12); color: inherit; }
.course-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--acc); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.course-head { display: flex; gap: 12px; align-items: center; }
.course-head .h3 { margin: 0; }
.cover { background: var(--acc); color: #fff; padding: 22px 16px; position: relative; overflow: hidden; }
.cover::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.cover::before { content: ""; position: absolute; right: 30px; bottom: -70px; width: 140px; height: 140px; border: 1px solid rgba(194,161,95,.45); border-radius: 50%; }
.cover .kicker { color: var(--brass); }
.cover .h1 { color: #fff; margin: 0; }
.cover p { margin: 6px 0 0; color: rgba(255,255,255,.85); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent; font-family: var(--sans); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--base); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--base-2); color: #fff; }
.btn-brass { background: var(--brass); color: var(--base); }
.btn-brass:hover:not(:disabled) { background: #CFB074; color: var(--base); }
.btn-ghost { background: transparent; border-color: var(--base); color: var(--base); }
.btn-ghost:hover:not(:disabled) { background: var(--sand); color: var(--base); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--brass-ink); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 14px; margin: 0 0 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 700; }
.input, select.input, textarea.input { width: 100%; min-height: 48px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; padding: 10px 12px; font-family: var(--sans); font-size: 16px; color: var(--ink); }
textarea.input { min-height: 140px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--base); outline: 2px solid rgba(20, 58, 46, .18); }
.help { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--base); }
.trap { position: absolute; left: -9999px; }
.privacy { display: flex; gap: 10px; align-items: flex-start; background: var(--sand); padding: 12px; font-size: 13px; color: var(--ink-2); margin: 0; }
.privacy svg { flex: none; color: var(--base); margin-top: 1px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.links { text-align: center; font-size: 14px; margin: 14px 0 0; }
details.ask { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.ask summary { cursor: pointer; color: var(--brass-ink); font-size: 14px; text-decoration: underline; }
details.ask .form { margin-top: 12px; }

/* ---------- Avisos ---------- */
.notice { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin: 0 0 14px; }
.notice-error { background: var(--bad-bg); color: var(--bad); border: 1px solid #E8C3BD; }
.notice-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #BFDCC9; }
.notice-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #EBD3A1; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--sand); color: var(--ink-2); white-space: nowrap; }
.badge-open { background: var(--base); color: #fff; }
.badge-open::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); animation: pulse 1.6s infinite; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .badge-open::before { animation: none; } * { scroll-behavior: auto !important; } }

/* ---------- Páginas de cuenta ---------- */
.auth-main { display: flex; justify-content: center; padding: 28px 16px 60px; }
.auth-card { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--base); padding: 24px 20px; box-shadow: var(--shadow); }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 10px 16px 30px; }

/* ---------- Actividad abierta (estudiante) ---------- */
.live-hero { background: var(--base); color: #F2EEE4; border-radius: var(--radius); padding: 18px; display: block; text-decoration: none; box-shadow: var(--shadow); }
.live-hero:hover { color: #fff; background: var(--base-2); }
.live-hero .kicker { color: var(--brass); }
.live-hero .ttl { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 2px 0 8px; color: #fff; }
.clock { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .5px; }
.clock-xl { font-size: 46px; line-height: 1; }
.bar { height: 6px; background: var(--base-3); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--brass); transition: width 1s linear; }
.timer { position: sticky; top: 60px; z-index: 15; background: var(--base); color: #F2EEE4; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timer .clock { font-size: 26px; }
.timer.low { background: #6B2D24; }
.timer .meta { font-size: 13px; color: #D6D0C1; text-align: right; }
.q { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.q-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.q-prompt { font-size: 16px; margin-bottom: 12px; }
.q-prompt p { margin: 0 0 8px; }
.intro { background: var(--paper); border: 1px solid var(--line); border-left: 0; border-top: 4px solid var(--acc); padding: 16px; border-radius: var(--radius); }
.intro p:first-child { margin-top: 0; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius); margin: 8px 0; cursor: pointer; background: #fff; min-height: 48px; }
.opt input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--base); }
.opt:has(input:checked) { border-color: var(--base); background: #EEF4F0; box-shadow: inset 0 0 0 1px var(--base); }
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.counter.over { color: var(--bad); font-weight: 700; }
.files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.file { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; background: var(--ivory); max-width: 100%; font-size: 13px; }
.file img { width: 54px; height: 54px; object-fit: cover; border-radius: 3px; }
.file .x { background: none; border: 0; color: var(--bad); cursor: pointer; font-size: 13px; text-decoration: underline; min-height: 36px; }
.saved { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.saved.err { color: var(--bad); }
.submit-bar { position: sticky; bottom: 0; background: rgba(246, 243, 236, .96); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin-top: 18px; }
.done { text-align: center; padding: 26px 16px; }
.done .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--base); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }

/* ---------- Listas y tablas ---------- */
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.list li { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--sand); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 16px 0; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px; font: inherit; font-weight: 700; font-size: 15px; color: var(--muted); cursor: pointer; white-space: nowrap; min-height: 46px; }
.tab[aria-selected="true"] { color: var(--base); border-bottom-color: var(--brass); }

/* ---------- Panel en vivo (docente) ---------- */
.live-panel { background: var(--base); color: #F2EEE4; border-radius: var(--radius); padding: 18px; }
.live-panel .h1 { color: #fff; font-size: 26px; }
.live-clock { font-size: 64px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.ctrl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.ctrl .btn { min-height: 64px; font-size: 18px; }
.ctrl .btn-ghost { border-color: #F2EEE4; color: #F2EEE4; }
.ctrl .btn-ghost:hover:not(:disabled) { background: var(--base-2); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 30px; font-family: var(--serif); color: var(--base); line-height: 1.1; }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.who .p { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: var(--radius); padding: 8px 10px; font-size: 14px; }
.who .p.submitted { border-left-color: var(--ok); }
.who .p.working { border-left-color: var(--brass); }
.who .p.nolink { opacity: .6; }

/* ---------- Editor ---------- */
.qed { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 14px; margin: 12px 0; }
.qed .row-between { margin-bottom: 8px; }
.optrow { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.optrow .input { min-height: 42px; }
.optrow input[type=checkbox], .optrow input[type=radio] { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- Diálogo y mensajes ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 560px; width: calc(100% - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(20, 30, 26, .55); }
.dlg { padding: 20px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius); z-index: 100; font-size: 14px; max-width: calc(100% - 24px); box-shadow: var(--shadow); }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- Proyector ---------- */
body.projector { background: var(--base); color: #F2EEE4; }
.proj { min-height: 100vh; display: flex; flex-direction: column; padding: 4vh 5vw; gap: 3vh; }
.proj .kicker { color: var(--brass); font-size: 1.6vw; }
.proj h1 { font-family: var(--serif); font-size: 4.2vw; margin: 0; color: #fff; line-height: 1.05; }
.proj .big { font-size: 15vw; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; color: #fff; }
.proj .txt { font-size: 1.8vw; line-height: 1.5; color: #E5E0D3; max-width: 70ch; }
.proj .foot2 { margin-top: auto; display: flex; justify-content: space-between; font-size: 1.6vw; color: #D6D0C1; }

@media (min-width: 760px) {
	.wrap { padding: 28px 24px 96px; }
	.h1 { font-size: 38px; }
	.cover { padding: 30px 26px; border-radius: var(--radius); }
}
@media print { .topbar, .submit-bar { display: none; } }
