/* Lernuva - interfaz de acceso y panel. Tokens de docs/GUIA_VISUAL_LERNUVA.md. Mobile-first. */
:root {
  --brand-ink: #0A1839;
  --brand-indigo: #4639E9;
  --brand-indigo-deep: #293BE3;
  --brand-cyan: #16A9F0;
  --brand-teal: #00CDB5;
  --surface-base: #FFFFFF;
  --surface-soft: #F6F8FC;
  --text-primary: #0A1839;
  --text-secondary: #4D5B73;
  --border-subtle: #DDE3EF;
  --state-success: #087A58;
  --state-error: #B42318;
  --radius: 14px;
  --focus: 0 0 0 3px #fff, 0 0 0 6px var(--brand-indigo-deep);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 18px; }
/* Escritorio: el texto de 18 px pensado para celular se ve enorme con mouse y pantalla grande */
@media (min-width: 900px) { html { font-size: 16px; } }
body {
  margin: 0;
  background: var(--surface-soft);
  color: var(--text-primary);
  font: 1rem/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; }
@media (min-width: 900px) { h1 { font-size: 1.6rem; } }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-indigo-deep); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 40rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .panel .wrap, .topbar .wrap { max-width: 62rem; padding: 0 24px; } }

/* ---- Acceso ---- */
.auth { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px 40px; }
.auth-card {
  width: 100%; max-width: 28rem; background: var(--surface-base);
  border: 1px solid var(--border-subtle); border-radius: 20px; padding: 28px 22px 26px;
  box-shadow: 0 6px 24px rgba(10, 24, 57, .06);
}
.logo-full { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 auto 20px; }
@media (min-width: 900px) { .logo-full { width: 190px; } }
.auth-card h1 { text-align: center; }
.lead { text-align: center; color: var(--text-secondary); margin-bottom: 1.25rem; }

label { display: block; font-weight: 600; margin: 0 0 .25rem; }
.field { margin-bottom: 1rem; }
.hint { color: var(--text-secondary); font-size: .9rem; margin: .25rem 0 0; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: inherit;
  background: #fff; border: 2px solid #9AA6BD; border-radius: 12px;
}
input:focus { border-color: var(--brand-indigo-deep); outline: none; box-shadow: var(--focus); }
.check { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 400; margin: 0 0 .5rem; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand-indigo-deep); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 10px 20px; font: inherit; font-weight: 700; text-decoration: none;
  border-radius: 12px; border: 2px solid transparent; cursor: pointer; width: 100%;
}
.btn-primary { background: var(--brand-indigo-deep); color: #fff; }
.btn-primary:hover { background: var(--brand-indigo); }
.btn-secondary { background: #fff; color: var(--text-primary); border-color: #9AA6BD; }
.btn-secondary:hover { border-color: var(--brand-ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-inline { width: auto; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-indigo-deep); text-decoration: underline; cursor: pointer; min-height: 44px; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; margin-top: 1rem; }
.center { text-align: center; }

.alert { border-radius: 12px; padding: 12px 14px; margin: 0 0 1rem; border: 2px solid; font-size: .98rem; }
.alert-error { background: #FDECEA; border-color: var(--state-error); color: #7A1710; }
.alert-ok { background: #E7F7F1; border-color: var(--state-success); color: #05503A; }
.alert-info { background: #EEF1FD; border-color: var(--brand-indigo-deep); color: var(--brand-ink); }

/* ---- Panel ---- */
.topbar { background: #fff; border-bottom: 1px solid var(--border-subtle); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.topbar img { height: 36px; width: auto; display: block; }
.who { display: flex; align-items: center; gap: 12px; font-size: .95rem; color: var(--text-secondary); }
.who strong { color: var(--text-primary); }
main.panel { flex: 1; padding: 24px 0 48px; }
.hello { margin-bottom: 1.25rem; display: flex; align-items: center; gap: 16px; }
.hello h1 { margin-bottom: .15rem; }
.hello p { margin: 0; }
.hello-avatar { flex: 0 0 auto; width: 88px; height: 88px; }
.cards { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
.card { background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 18px; }
.card h2, .card h3 { margin-bottom: .35rem; }
.card .tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #EEF1FD; color: var(--brand-ink); margin-bottom: .5rem; }
.card.soon { background: var(--surface-soft); border-style: dashed; }
.section { margin: 1.75rem 0 .75rem; }
.course-list { display: grid; gap: 12px; }
@media (min-width: 900px) { .course-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .course-list .lesson { grid-column: 1 / -1; } }
.lesson { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.lesson .btn { width: auto; min-width: 9rem; }
.muted { color: var(--text-secondary); }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 4px solid var(--border-subtle); border-top-color: var(--brand-indigo-deep); animation: giro 1s linear infinite; margin: 2rem auto; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

@media (min-width: 640px) {
  .cards.two { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 34px 32px 30px; }
}
