/*
 * GrowIT Academy — tema compartido (look & feel de GrowIT Method).
 * Tokens + componentes base. Se enlaza ÚLTIMO en <head> de cada página
 * autenticada y de login. Las páginas usan estos tokens (var(--c-*)) en
 * vez de colores fijos. Azul GrowIT fijo en toda la interfaz; el Brand Kit
 * de cada academia solo aplica al portal público.
 * Fuentes: Barlow Condensed (títulos) + Inter (texto).
 */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --c-primary: #2781bc;
  --c-primary-strong: #1d6394;
  --c-primary-soft: #e3f0f8;
  --c-ink: #231f20;
  --c-paper: #f4f6f8;
  --c-white: #fff;
  --c-border: #dfe4e8;
  --c-muted: #5b6168;
  --c-success: #1e8e5a;
  --c-warning: #b86e00;
  --c-danger: #c62f2f;
  --c-nav: #16222c;
  --c-nav-ink: #dbe6ee;
  --f-heading: "Barlow Condensed","DIN Condensed","Oswald","Arial Narrow",sans-serif;
  --f-body: Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22,34,44,.06), 0 8px 24px rgba(22,34,44,.06);
  --shadow-lg: 0 2px 4px rgba(22,34,44,.08), 0 18px 40px rgba(22,34,44,.14);
  --ring: 0 0 0 3px color-mix(in srgb, var(--c-primary) 30%, transparent);

  /* Tokens heredados (app-shell.css y páginas) apuntando al tema nuevo */
  --panel-primary: var(--c-primary);
  --panel-secondary: var(--c-nav);
  --panel-tertiary: var(--c-primary-soft);
  --gs-primary: var(--c-primary);
  --line: var(--c-border);
  --ink: var(--c-ink);
  --muted: var(--c-muted);
  --bg: var(--c-paper);
  --card: var(--c-white);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --c-primary: #4aa3dd; --c-primary-strong: #2781bc; --c-primary-soft: #14303f;
    --c-ink: #f1f4f6; --c-paper: #12161a; --c-white: #1b2025; --c-border: #2e353b; --c-muted: #a4acb3; --c-nav: #0d1419;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.5), 0 18px 40px rgba(0,0,0,.5);
  }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Base ---------- */
body { font-family: var(--f-body); color: var(--c-ink); background: var(--c-paper); line-height: 1.55; -webkit-font-smoothing: antialiased; }
body h1, body h2, body h3 { font-family: var(--f-heading); text-transform: uppercase; letter-spacing: .03em; line-height: 1.1; font-weight: 700; }
body h1 { font-size: 1.9rem; } body h2 { font-size: 1.4rem; } body h3 { font-size: 1.1rem; }
body h2.section-title { font-size: 1.25rem; }
a { text-underline-offset: 3px; }
::selection { background: var(--c-primary); color: #fff; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }

/* ---------- Formularios ---------- */
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),
body select, body textarea {
  border: 1.5px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-white); color: var(--c-ink); transition: border-color .15s, box-shadow .15s;
}
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):focus,
body select:focus, body textarea:focus { border-color: var(--c-primary); box-shadow: var(--ring); outline: none; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--c-primary); }
label { color: var(--c-ink); }

/* ---------- Botones (el color primario ya viene tokenizado en cada página) ---------- */
body button { border-radius: var(--radius-sm); font-family: var(--f-body); transition: filter .15s, transform .12s, box-shadow .15s; }
body button:not(:disabled):hover { filter: brightness(1.06); }
body button.ghost, body button.secondary { color: var(--c-primary-strong); }

/* ---------- Tarjetas, paneles, tablas ---------- */
body .card { background: var(--c-white); border-color: var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); }
body .panel { color: var(--c-ink); }
body table { border-collapse: separate; border-spacing: 0; }
body th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--c-muted); font-weight: 700; }
body th, body td { border-color: var(--c-border); }
body tbody tr:hover { background: color-mix(in srgb, var(--c-primary-soft) 55%, transparent); }
body .modal { background: var(--c-white); color: var(--c-ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
body .tabs .tab, body .tab { font-weight: 600; }
body .pill { border-radius: 999px; }
body .empty-hint { color: var(--c-muted); }

/* ---------- Mensajes ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .error { background: #431a1a !important; border-color: #6b2a2a !important; color: #f19999 !important; }
  :root:not([data-theme="light"]) .success { background: #123826 !important; border-color: #1e5a3d !important; color: #7bd8a8 !important; }
  :root:not([data-theme="light"]) .student-view-banner { background: #1f2547; color: #b9c2ff; border-color: #2e356b; }
  :root:not([data-theme="light"]) .student-view-banner a { color: #b9c2ff; }
}
body .link-btn, body .logout-link, body a.back, body .footer-links a { color: var(--c-primary-strong); }

/* ---------- Páginas de acceso (login, recuperar, invitación, magic link) ---------- */
body.auth-page { padding: 0; margin: 0; background: var(--c-paper); }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth__hero {
  background: radial-gradient(1200px 600px at 10% 0, color-mix(in srgb, var(--c-primary) 55%, transparent), transparent 60%), linear-gradient(160deg, #0f1b24, #1a3347 60%, #1d6394);
  color: #fff; padding: 3rem clamp(1.5rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth__hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255,255,255,.05); }
.auth__brand { display: flex; align-items: center; gap: .7rem; font: 700 1.6rem var(--f-heading); text-transform: uppercase; letter-spacing: .05em; }
.auth__mark { width: 44px; height: 44px; border-radius: 12px; background: var(--c-primary); display: grid; place-items: center; font: 700 1.1rem var(--f-heading); letter-spacing: .04em; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.auth__hero h2 { font-size: clamp(2rem, 4vw, 3.2rem); color: #fff; max-width: 14ch; margin: 0 0 .8rem; }
.auth__hero p { color: #c9dae6; max-width: 42ch; margin: 0; }
.auth__points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; }
.auth__points li { display: flex; gap: .7rem; align-items: center; color: #e3eef6; }
.auth__points svg { background: rgba(255,255,255,.12); padding: 7px; border-radius: 10px; box-sizing: content-box; flex: none; }
.auth__hero small { opacity: .7; position: relative; z-index: 1; }
.auth__panel { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--c-paper); }
.auth .wrap { max-width: 420px; width: 100%; margin: 0 auto; }
.auth .card { padding: 28px 26px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__hero { padding: 1.75rem 1.5rem; gap: 1.25rem; }
  .auth__hero h2 { font-size: 1.9rem; max-width: none; }
  .auth__points, .auth__hero small { display: none; }
}
