/* =====================================================================
   Academia Fritz — sistema de diseño
   Identidad: rojo Fritz (logo) + tinta azul marino + neutros cálidos.
   Títulos en Barlow Semi Condensed (eco del logotipo condensado), texto en Inter.
   ===================================================================== */

@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 500; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); }

:root {
  color-scheme: light;

  /* Marca */
  --brand: #df0001;
  --brand-hover: #b80001;
  --brand-press: #9c0001;
  --brand-soft: #fff0eb;
  --brand-tint: #ffd9cc;

  /* Tinta y neutros cálidos */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #5f6b7d;
  --faint: #94a3b8;
  --bg: #faf7f5;
  --surface: #ffffff;
  --surface-2: #f6f1ee;
  --surface-3: #efe8e3;
  --line: #ebe3de;
  --line-strong: #dcd1ca;
  --navy: #0f172a;
  --navy-2: #1e293b;

  /* Estados (siempre con ícono y texto, nunca solo color) */
  --ok: #15803d;      --ok-soft: #e7f6ec;
  --warn: #b45309;    --warn-soft: #fdf3e1;
  --bad: #be123c;     --bad-soft: #fde8ec;
  --info: #1d4ed8;    --info-soft: #e6eefc;

  /* Series de gráficos (paleta validada: azul / naranja) */
  --series-1: #2a78d6;
  --series-1-soft: #c9dcf4;
  --series-2: #eb6834;

  /* Tonos de categoría para portadas */
  --tone-1-a: #e3262b; --tone-1-b: #8c0d16;
  --tone-2-a: #e58a14; --tone-2-b: #9a4a08;
  --tone-3-a: #13897f; --tone-3-b: #0d4f4a;
  --tone-4-a: #2f6fe4; --tone-4-b: #1c3a8a;
  --tone-5-a: #7e4ce3; --tone-5-b: #43207e;
  --tone-6-a: #3f4f6b; --tone-6-b: #111a2e;

  /* Forma y ritmo */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, .06), 0 18px 40px rgba(15, 23, 42, .10);
  --ring: 0 0 0 3px rgba(223, 0, 1, .22);

  --font-display: 'Barlow Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --header-h: 64px;
  --tabbar-h: 64px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--font); font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; letter-spacing: -.005em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.2vw, 44px); }
h2 { font-size: clamp(22px, 2.6vw, 28px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; text-wrap: pretty; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-tint); }

.icon { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.icon-sm { width: 16px; height: 16px; vertical-align: -3px; }
.icon-lg { width: 28px; height: 28px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 820px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
}
.eyebrow-muted { color: var(--muted); }
.lead { font-size: 17px; color: var(--ink-2); max-width: 62ch; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------------ botones */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font: 600 14px/1 var(--font); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 4px 12px rgba(223, 0, 1, .22); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }
.btn-dark:hover { background: var(--navy-2); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-light { --btn-bg: rgba(255,255,255,.12); --btn-fg: #fff; --btn-bd: rgba(255,255,255,.28); }
.btn-light:hover { background: rgba(255,255,255,.2); }
.btn-danger { --btn-fg: var(--bad); --btn-bd: #f3c3cd; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ok { --btn-bg: var(--ok); --btn-fg: #fff; --btn-bd: var(--ok); }
.btn-ok:hover { background: #126b33; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.link { color: var(--brand); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-muted { color: var(--muted); text-decoration: none; }
.link-muted:hover { color: var(--ink); }
.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------------ chips, badges, avatar */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; border: 1px solid transparent;
}
a.chip:hover { border-color: var(--line-strong); }
.chip .icon { width: 15px; height: 15px; }
.chip-brand { background: var(--brand-soft); color: var(--brand-hover); }
.chip-outline { background: transparent; border-color: var(--line-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2);
}
.badge .icon { width: 14px; height: 14px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand); color: #fff; }
.badge-dark { background: var(--ink); color: #fff; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; }

.avatar {
  --av: 40px; width: var(--av); height: var(--av); flex: none; border-radius: 50%;
  display: inline-grid; place-items: center; font: 700 calc(var(--av) * .38)/1 var(--font);
  color: #fff; background: linear-gradient(135deg, #e3262b, #8c0d16); letter-spacing: .02em;
}
.avatar-sm { --av: 32px; }
.avatar-lg { --av: 56px; }
.avatar[data-tone="2"] { background: linear-gradient(135deg, var(--tone-2-a), var(--tone-2-b)); }
.avatar[data-tone="3"] { background: linear-gradient(135deg, var(--tone-3-a), var(--tone-3-b)); }
.avatar[data-tone="4"] { background: linear-gradient(135deg, var(--tone-4-a), var(--tone-4-b)); }
.avatar[data-tone="5"] { background: linear-gradient(135deg, var(--tone-5-a), var(--tone-5-b)); }
.avatar[data-tone="6"] { background: linear-gradient(135deg, var(--tone-6-a), var(--tone-6-b)); }

/* ------------------------------------------------------------------ tarjetas y superficies */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-pad-sm { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 20px; }
.card-body { padding: 20px 24px; }
.card-foot { padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.panel { background: var(--surface-2); border-radius: var(--radius); padding: 16px 18px; }

.section { padding: 48px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 4px 0 0; }

/* ------------------------------------------------------------------ progreso */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); min-width: 0; transition: width .4s ease; }
.progress.is-done > span { background: var(--ok); }
.progress-thin { height: 6px; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.progress-label strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.ring {
  --p: 0; --size: 64px; --stroke: 7px; --c: var(--brand);
  width: var(--size); height: var(--size); flex: none; border-radius: 50%; position: relative;
  display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0);
}
.ring::before { content: ''; position: absolute; inset: var(--stroke); border-radius: 50%; background: var(--surface); }
.ring > span { position: relative; font: 700 calc(var(--size) * .26)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ring.is-done { --c: var(--ok); }
.ring-lg { --size: 120px; --stroke: 10px; }
.ring-dark::before { background: var(--navy); }
.ring-dark { background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.14) 0); color: #fff; }

/* ------------------------------------------------------------------ formularios */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); margin: 0; }
.field .error { font-size: 13px; color: var(--bad); font-weight: 500; display: flex; gap: 6px; align-items: center; margin: 0; }
.input, .select, .textarea, input[type=text].input, input[type=email].input, input[type=password].input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.textarea-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; min-height: 260px; }
.select { appearance: none; padding-right: 38px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6b7d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--bad); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 8px; }
fieldset.group { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 4px; margin: 0 0 20px; }
fieldset.group > legend { font: 700 17px var(--font-display); padding: 0 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; }

/* ------------------------------------------------------------------ avisos */
.flash {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  background: var(--ok-soft); color: #14532d; border: 1px solid #bfe5cb; margin-bottom: 20px; font-weight: 500;
}
.flash .icon { margin-top: 1px; }
.flash-error { background: var(--bad-soft); color: #881337; border-color: #f6c5d0; }
.flash-info { background: var(--info-soft); color: #1e3a8a; border-color: #c8d8f7; }
.flash-warn { background: var(--warn-soft); color: #78350f; border-color: #f2d9a8; }
.flash p { margin: 0; }
.flash .grow { min-width: 0; overflow-wrap: anywhere; }
.flash-close { margin-left: auto; background: none; border: 0; padding: 2px; color: inherit; opacity: .6; cursor: pointer; border-radius: 6px; }
.flash-close:hover { opacity: 1; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 16px; }

/* ------------------------------------------------------------------ pestañas segmentadas */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs .count { background: var(--surface-3); color: var(--ink-2); }
.tabs a[aria-current="page"] .count { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------------ tablas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: #fcfaf9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table th.num { text-align: right; }
.table a.row-link { text-decoration: none; font-weight: 600; }
.table a.row-link:hover { color: var(--brand); }
.cell-person { display: flex; gap: 12px; align-items: center; min-width: 200px; }
.cell-person .who { min-width: 0; }
.cell-person .who strong { display: block; line-height: 1.3; }
.cell-person .who span { font-size: 13px; color: var(--muted); }
.cell-progress { min-width: 140px; }
.cell-progress .progress { margin-top: 4px; }

/* =====================================================================
   Estructura: cabecera, navegación, pie
   ===================================================================== */
.app-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header .container { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { width: 62px; height: auto; display: block; }
.brand-text { font: 700 19px/1 var(--font-display); letter-spacing: .01em; color: var(--ink); text-transform: uppercase; }
.brand-text small { display: block; font: 600 10px/1.2 var(--font); letter-spacing: .14em; color: var(--muted); margin-top: 3px; }
.main-nav { display: flex; gap: 4px; height: 100%; }
.main-nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%;
  text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); position: relative;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--ink); }
.main-nav a[aria-current="page"]::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface-2); }
.user-menu > summary .who { line-height: 1.2; text-align: left; }
.user-menu > summary .who strong { display: block; font-size: 14px; }
.user-menu > summary .who span { font-size: 12px; color: var(--muted); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.menu-pop .menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-pop .menu-head strong { display: block; }
.menu-pop .menu-head span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; font-weight: 500; font-size: 14px;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }

.page { padding: 32px 0 64px; min-height: calc(100vh - var(--header-h) - 120px); }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 6px 0 8px; }
.page-head .lead { margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .icon { width: 14px; height: 14px; }

.app-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 13px; }
.app-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Barra inferior en el teléfono */
.tabbar { display: none; }
@media (max-width: 860px) {
  .main-nav, .user-menu > summary .who, .hide-mobile { display: none !important; }
  .app-header .container { gap: 12px; }
  .brand img { width: 52px; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
  .tabbar a .icon { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar a[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .page { padding-top: 20px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (min-width: 861px) { .hide-desktop { display: none !important; } }

/* =====================================================================
   Portadas y tarjetas de curso
   ===================================================================== */
.cover {
  --a: var(--tone-1-a); --b: var(--tone-1-b);
  position: relative; overflow: hidden; aspect-ratio: 16 / 8.5; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(135deg, var(--a), var(--b));
}
.cover[data-tone="2"] { --a: var(--tone-2-a); --b: var(--tone-2-b); }
.cover[data-tone="3"] { --a: var(--tone-3-a); --b: var(--tone-3-b); }
.cover[data-tone="4"] { --a: var(--tone-4-a); --b: var(--tone-4-b); }
.cover[data-tone="5"] { --a: var(--tone-5-a); --b: var(--tone-5-b); }
.cover[data-tone="6"] { --a: var(--tone-6-a); --b: var(--tone-6-b); }
.cover::before { /* trama de líneas finas */
  content: ''; position: absolute; inset: 0; opacity: .14;
  background-image: repeating-linear-gradient(135deg, #fff 0 1px, transparent 1px 14px);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.cover .cover-icon { position: absolute; right: -14px; bottom: -22px; width: 46%; height: auto; aspect-ratio: 1; opacity: .2; stroke-width: 1.4; }
.cover .cover-badge {
  position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; background: rgba(15,23,42,.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 12px; font-weight: 600;
}
.cover .cover-badge .icon { width: 14px; height: 14px; }
.cover img.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .cover-state { position: absolute; right: 12px; top: 12px; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.course-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; position: relative;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.course-card:hover .course-title { color: var(--brand); }
.course-card .course-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.course-card .course-title { font: 700 20px/1.18 var(--font-display); margin: 0; transition: color .15s; }
.course-card .course-desc { font-size: 14px; color: var(--muted); margin: 0; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-meta .icon { width: 15px; height: 15px; }
.course-card .course-foot { margin-top: auto; padding-top: 10px; }

/* =====================================================================
   Inicio
   ===================================================================== */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(223,0,1,.55), transparent 60%),
    radial-gradient(60% 80% at 0% 100%, rgba(223,0,1,.18), transparent 70%),
    var(--navy);
}
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .07; background-image: repeating-linear-gradient(135deg, #fff 0 1px, transparent 1px 18px); }
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lead { color: rgba(255,255,255,.82); }
.hero .eyebrow { color: #ffb3a1; }

.welcome { padding: 40px 0 72px; }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.welcome h1 { font-size: clamp(32px, 4.4vw, 48px); margin: 10px 0 12px; }
.welcome-stats { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.welcome-stats div { min-width: 90px; }
.welcome-stats strong { display: block; font: 700 34px/1 var(--font-display); }
.welcome-stats span { font-size: 13px; color: rgba(255,255,255,.72); }

.resume-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-xl);
  padding: 22px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.resume-card .label-sm { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.65); }
.resume-card h2 { color: #fff; font-size: 24px; margin: 8px 0 6px; }
.resume-card .row { gap: 18px; }
.resume-card .muted { color: rgba(255,255,255,.7); }
.resume-card .progress { background: rgba(255,255,255,.14); }

.overlap { margin-top: -40px; position: relative; z-index: 2; }
.continue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.continue-item {
  display: flex; gap: 16px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.continue-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.continue-item .thumb { width: 64px; height: 64px; border-radius: 14px; flex: none; display: grid; place-items: center; aspect-ratio: 1; }
.continue-item .thumb .icon { width: 28px; height: 28px; opacity: .95; }
.continue-item .thumb::before { display: none; }
.continue-item h3 { font-size: 17px; margin: 0 0 6px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cat-card {
  display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius-lg); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-card .cat-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; aspect-ratio: 1; }
.cat-card .cat-icon .icon { width: 26px; height: 26px; }
.cat-card .cat-icon::before { display: none; }
.cat-card strong { display: block; font: 700 18px/1.2 var(--font-display); }
.cat-card span { font-size: 13px; color: var(--muted); }
.cat-card .chev { margin-left: auto; color: var(--faint); }

.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.pillar { padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.pillar .pillar-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.pillar h3 { font-size: 22px; margin-bottom: 8px; }
.pillar p:last-child { margin-bottom: 0; }
.pillar-dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.pillar-dark .pillar-icon { background: rgba(255,255,255,.1); color: #ffb3a1; }
.pillar-dark p { color: rgba(255,255,255,.82); }
.values { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 4px; }
.value { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--surface-2); border-radius: var(--radius); font-weight: 600; }
.value .icon { color: var(--brand); margin-top: 2px; }
.notice-admin { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }

/* Portada pública (sin sesión) */
.landing-hero { padding: 72px 0 96px; }
.landing-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 48px; align-items: center; }
.landing-hero h1 { font-size: clamp(38px, 6vw, 64px); max-width: 14ch; margin: 14px 0 18px; }
.landing-art { position: relative; aspect-ratio: 1; max-width: 420px; justify-self: end; width: 100%; }
.landing-art .tile {
  position: absolute; border-radius: 22px; display: grid; place-items: center; color: #fff; box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
.landing-art .tile .icon { width: 40%; height: 40%; }
.landing-art .t1 { inset: 0 38% 38% 0; background: linear-gradient(135deg, var(--tone-1-a), var(--tone-1-b)); }
.landing-art .t2 { inset: 8% 0 52% 66%; background: linear-gradient(135deg, var(--tone-4-a), var(--tone-4-b)); }
.landing-art .t3 { inset: 66% 50% 0 10%; background: linear-gradient(135deg, var(--tone-3-a), var(--tone-3-b)); }
.landing-art .t4 { inset: 50% 0 6% 56%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.landing-art .t4 strong { font: 700 44px/1 var(--font-display); display: block; text-align: center; }
.landing-art .t4 span { font-size: 13px; color: rgba(255,255,255,.75); }

/* =====================================================================
   Catálogo
   ===================================================================== */
.catalog-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 32px 0 0; }
.catalog-head h1 { margin: 6px 0 18px; }
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.searchbar .input-icon { flex: 1 1 320px; }
.searchbar .input { min-height: 50px; border-radius: 999px; font-size: 15px; background: var(--surface-2); border-color: transparent; }
.searchbar .input:focus { background: var(--surface); }
.searchbar .select { min-height: 50px; border-radius: 999px; width: auto; min-width: 220px; flex: 0 1 280px; }
.cat-scroller { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); }
.cat-scroller::-webkit-scrollbar { display: none; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; flex: none;
  border: 1px solid var(--line-strong); background: var(--surface); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.cat-pill:hover { border-color: var(--ink); color: var(--ink); }
.cat-pill[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-pill .n { font-weight: 500; color: var(--faint); font-size: 13px; }
.cat-pill[aria-current="true"] .n { color: rgba(255,255,255,.6); }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 20px; }

/* =====================================================================
   Ficha del curso
   ===================================================================== */
.course-hero { color: #fff; position: relative; overflow: hidden; }
.course-hero.cover { aspect-ratio: auto; }
.course-hero .container { position: relative; z-index: 1; padding-top: 28px; padding-bottom: 40px; }
.course-hero .crumbs, .course-hero .crumbs a { color: rgba(255,255,255,.78); }
.course-hero .crumbs a:hover { color: #fff; }
.course-hero h1 { color: #fff; max-width: 22ch; margin: 12px 0 12px; }
.course-hero .lead { color: rgba(255,255,255,.88); }
.course-hero .chip { background: rgba(255,255,255,.16); color: #fff; }
.course-hero .cover-icon { width: 34%; max-width: 380px; right: 2%; bottom: -12%; opacity: .16; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 22px; }
.fact { display: flex; gap: 10px; align-items: center; }
.fact .icon { width: 20px; height: 20px; opacity: .85; }
.fact strong { display: block; font-size: 15px; line-height: 1.2; }
.fact span { font-size: 12px; opacity: .78; }

.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; margin-top: -28px; position: relative; z-index: 2; }
.course-side { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; }
.cta-card { padding: 22px; }
.cta-card .ring { margin-bottom: 4px; }
.cta-card .btn-block + .btn-block { margin-top: 8px; }
.ficha-section { padding: 26px; }
.ficha-section + .ficha-section { margin-top: 20px; }
.ficha-section h2 { font-size: 24px; display: flex; gap: 10px; align-items: center; }
.ficha-section h2 .icon { color: var(--brand); width: 22px; height: 22px; }
.objectives { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.objectives li { display: flex; gap: 12px; align-items: flex-start; }
.objectives li .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin-top: 1px; }
.objectives li .tick .icon { width: 14px; height: 14px; }
.skills { display: flex; flex-wrap: wrap; gap: 8px; }
.prose { font-size: 16px; line-height: 1.72; color: var(--ink-2); overflow-wrap: anywhere; }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); margin: 1.4em 0 .5em; }
.prose h2 { font-size: 26px; } .prose h3 { font-size: 21px; } .prose h4 { font-size: 18px; }
.prose a { color: var(--brand); }
.prose img { border-radius: var(--radius); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 4px; }
.prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--brand); color: var(--ink); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; }
.prose iframe { border: 0; }
.prose figure { margin: 1.2em 0; }

.syllabus { list-style: none; margin: 0; padding: 0; counter-reset: mod; }
.syllabus > li { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.syllabus > li + li { margin-top: 10px; }
.syllabus details > summary { list-style: none; display: flex; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; }
.syllabus details > summary::-webkit-details-marker { display: none; }
.syllabus details > summary:hover { background: var(--surface-2); }
.syllabus .mod-n { counter-increment: mod; flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font: 700 15px var(--font-display); color: var(--ink-2); }
.syllabus .mod-n::before { content: counter(mod, decimal-leading-zero); }
.syllabus .is-done .mod-n { background: var(--ok-soft); color: var(--ok); }
.syllabus .mod-title { font-weight: 600; flex: 1; min-width: 0; }
.syllabus .mod-sub { font-size: 13px; color: var(--muted); font-weight: 400; display: block; }
.syllabus details[open] .chev { transform: rotate(180deg); }
.syllabus .chev { color: var(--muted); transition: transform .2s; }
.syllabus .mod-items { list-style: none; margin: 0; padding: 4px 16px 12px 62px; display: grid; gap: 2px; }
.syllabus .mod-items a, .syllabus .mod-items span.item { display: flex; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.syllabus .mod-items a:hover { color: var(--brand); }
.syllabus .mod-items .icon { width: 16px; height: 16px; color: var(--faint); }
.syllabus .mod-items .done .icon { color: var(--ok); }

.team-pick { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; margin: 6px 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.team-pick label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.team-pick label:hover { background: var(--surface-2); }
.team-pick label.is-off { opacity: .55; cursor: default; }
.team-pick input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.team-pick .who { flex: 1; min-width: 0; line-height: 1.25; }
.team-pick .who span { display: block; font-size: 12px; color: var(--muted); }

.celebrate {
  display: flex; gap: 18px; align-items: center; padding: 20px 22px; border-radius: var(--radius-lg); margin-bottom: 20px;
  background: linear-gradient(135deg, #0f7a3c, #15803d); color: #fff; box-shadow: var(--shadow-lg);
}
.celebrate .icon { width: 40px; height: 40px; flex: none; }
.celebrate h2 { color: #fff; margin: 0 0 4px; font-size: 24px; }
.celebrate p { margin: 0; opacity: .9; }

/* =====================================================================
   Reproductor (lecciones y quizzes)
   ===================================================================== */
body.player { background: var(--surface); }
.player-top {
  position: sticky; top: 0; z-index: 40; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--navy); color: #fff;
}
.player-top .back { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 8px; min-width: 0; }
.player-top .back:hover { background: rgba(255,255,255,.08); }
.player-top .back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.player-top .top-progress { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.player-top .top-progress .progress { width: 160px; background: rgba(255,255,255,.16); }
.player-top .top-progress strong { font-variant-numeric: tabular-nums; }
.player-top .btn-outline-toggle { display: none; }
.player-shell { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.player-side { border-right: 1px solid var(--line); background: var(--bg); position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.player-side .side-head { padding: 20px 20px 12px; }
.player-side .side-head h2 { font-size: 18px; margin: 4px 0 10px; }
.player-main { padding: 36px clamp(16px, 5vw, 64px) 120px; }
.player-main .inner { max-width: 820px; margin: 0 auto; }
.player-main h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 6px 0 22px; }

.outline { list-style: none; margin: 0; padding: 0 10px 24px; }
.outline ol { list-style: none; margin: 0; padding: 0 0 0 18px; }
.outline .step {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; text-decoration: none;
  color: var(--ink-2); font-size: 14px; line-height: 1.35;
}
.outline a.step:hover { background: var(--surface-3); color: var(--ink); }
.outline .step-lesson { font-weight: 600; color: var(--ink); margin-top: 4px; }
.outline .step-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; margin-top: 0; background: var(--surface); }
.outline .step-dot .icon { width: 12px; height: 12px; }
.outline .step-quiz .step-dot { border-radius: 6px; }
.outline .is-done .step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.outline .is-current { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); outline: 1px solid var(--line); }
.outline .is-current .step-dot { border-color: var(--brand); }
.outline .is-current.is-done .step-dot { border-color: var(--ok); }
.outline .step-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); display: block; margin-top: 2px; }

.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: #000; margin: 0 0 28px; box-shadow: var(--shadow); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose .video-embed { margin: 1.2em 0; }

.topic-list { display: grid; gap: 10px; margin: 24px 0; }
.topic-link { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.topic-link:hover { border-color: var(--line-strong); background: var(--surface-2); }
.topic-link .step-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.topic-link.is-done .step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.topic-link .step-dot .icon { width: 14px; height: 14px; }

.step-actions {
  position: sticky; bottom: 0; z-index: 5; margin-top: 40px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 0; background: linear-gradient(to top, var(--surface) 70%, rgba(255,255,255,0));
}
.step-actions .complete { margin: 0 auto; }
.done-pill { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 14px; }

/* Quiz */
.quiz-intro { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 28px; }
.quiz-intro .stat strong { display: block; font: 700 22px/1 var(--font-display); }
.quiz-intro .stat span { font-size: 12px; color: var(--muted); }
.quiz-intro .divider { width: 1px; align-self: stretch; background: var(--line-strong); }
.question { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 22px 18px; margin: 0 0 18px; background: var(--surface); }
.question > legend, .question .q-n { font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); padding: 0; float: left; width: 100%; margin-bottom: 8px; }
.question > legend + * { clear: both; }
.question .q-text { font-size: 17px; font-weight: 500; color: var(--ink); margin-bottom: 16px; }
.question .q-text p:last-child { margin-bottom: 0; }
.question .q-help { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin: -6px 0 12px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: border-color .12s, background .12s; margin-bottom: 8px;
}
.choice:hover { border-color: var(--line-strong); background: #fcfaf9; }
.choice input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice span p { margin: 0; }
.sort-item select { width: 78px; flex: none; min-height: 38px; padding: 6px 30px 6px 12px; }
.sort-item { align-items: center; }
.cloze-text { line-height: 2.2; }
.cloze { display: inline-block; width: 160px; min-height: 34px; padding: 4px 10px; border: 0; border-bottom: 2px solid var(--line-strong); background: var(--surface-2); border-radius: 6px 6px 0 0; }
.cloze:focus { outline: none; border-bottom-color: var(--brand); background: var(--brand-soft); }
.quiz-submit { position: sticky; bottom: 0; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; margin-top: 8px; background: var(--navy); color: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 5; }
.quiz-submit .answered { font-size: 14px; }
.quiz-submit .answered strong { font-variant-numeric: tabular-nums; }

.result-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 26px; border-radius: var(--radius-xl); margin-bottom: 28px; }
.result-hero.is-pass { background: linear-gradient(135deg, #e9f8ef, #d6f1e0); }
.result-hero.is-fail { background: linear-gradient(135deg, #fff2ee, #ffe3da); }
.result-hero.is-pending { background: var(--info-soft); }
.result-hero h1 { margin: 4px 0 6px; font-size: clamp(26px, 3.4vw, 36px); }
.result-hero .ring::before { background: #f3fbf6; }
.result-hero.is-fail .ring::before { background: #fff3ef; }
.review { position: relative; }
.review .review-tag { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.review-correct { border-left: 4px solid var(--ok); }
.review-incorrect { border-left: 4px solid var(--bad); }
.review-pending { border-left: 4px solid var(--info); }
.given { display: grid; gap: 6px; }
.given-item { padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 15px; }
.given-item p { margin: 0; }
.given-item.pre { white-space: pre-wrap; }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); font-size: 15px; }

@media (max-width: 960px) {
  .player-shell { grid-template-columns: 1fr; }
  .player-side { position: fixed; inset: 60px auto 0 0; width: min(88vw, 360px); z-index: 45; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.outline-open .player-side { transform: none; }
  body.outline-open::after { content: ''; position: fixed; inset: 60px 0 0; background: rgba(15,23,42,.35); z-index: 44; }
  .player-top .btn-outline-toggle { display: inline-flex; }
  .player-top .top-progress .progress { width: 80px; }
  .player-top .back span { max-width: 38vw; }
  .player-main { padding-top: 24px; }
}
@media (max-width: 560px) {
  .player-top .top-progress .progress, .player-top .top-progress .lbl { display: none; }
}

/* =====================================================================
   Mi equipo
   ===================================================================== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.kpi .kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .kpi-label .icon { width: 16px; height: 16px; }
.kpi .kpi-value { font: 700 34px/1.05 var(--font-display); margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .kpi-value small { font-size: 18px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kpi .kpi-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi.is-alert .kpi-value { color: var(--bad); }
.kpi.is-good .kpi-value { color: var(--ok); }
.kpi .progress { margin-top: 10px; }

.member { overflow: hidden; }
.member + .member { margin-top: 16px; }
.member-head { display: flex; gap: 14px; align-items: center; padding: 18px 22px; }
.member-head h3 { margin: 0; font-size: 20px; }
.member-head .sub { font-size: 13px; color: var(--muted); }
.member-courses { border-top: 1px solid var(--line); }
.member-course { display: grid; grid-template-columns: minmax(0, 1fr) 180px 150px; gap: 16px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); }
.member-course:first-child { border-top: 0; }
.member-course a { text-decoration: none; font-weight: 600; }
.member-course a:hover { color: var(--brand); }
@media (max-width: 720px) {
  .member-course { grid-template-columns: 1fr; gap: 8px; }
}

/* =====================================================================
   Login
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art.hero { background: radial-gradient(90% 70% at 100% 0%, rgba(223,0,1,.6), transparent 60%), radial-gradient(70% 60% at 0% 100%, rgba(223,0,1,.25), transparent 70%), var(--navy); }
.auth-art .brand-text { color: #fff; }
.auth-art .brand-text small { color: rgba(255,255,255,.6); }
.auth-art h1 { color: #fff; font-size: clamp(36px, 4.6vw, 56px); max-width: 13ch; }
.auth-art p { color: rgba(255,255,255,.8); max-width: 42ch; font-size: 17px; }
.auth-form { display: grid; place-items: center; padding: 48px 24px; }
.auth-form .box { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 34px; margin-bottom: 6px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 40px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 20px 32px; min-height: 0; }
  .auth-art h1 { font-size: 32px; margin-top: 28px; }
  .auth-art .hide-mobile { display: none; }
  .auth-form { padding: 28px 20px 48px; place-items: start center; }
}

/* =====================================================================
   Panel de administración
   ===================================================================== */
body.admin { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--navy); color: #cbd5e1; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.admin-side .brand { padding: 20px 20px 18px; }
.admin-side .brand-text { color: #fff; }
.admin-side .brand-text small { color: rgba(255,255,255,.55); }
.admin-nav { padding: 6px 12px 16px; display: grid; gap: 2px; }
.admin-nav .nav-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(203,213,225,.55); padding: 16px 10px 6px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 500; color: #cbd5e1; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a[aria-current="page"] { background: rgba(223,0,1,.16); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.admin-nav a .icon { width: 18px; height: 18px; opacity: .9; }
.admin-nav a .count { margin-left: auto; }
.admin-side .side-foot { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-side .side-foot a, .admin-side .side-foot button { display: flex; align-items: center; gap: 10px; color: #cbd5e1; text-decoration: none; font-size: 14px; padding: 8px 6px; background: none; border: 0; cursor: pointer; width: 100%; border-radius: 8px; }
.admin-side .side-foot a:hover, .admin-side .side-foot button:hover { color: #fff; background: rgba(255,255,255,.06); }
.admin-main { min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 30; background: rgba(250,247,245,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.admin-top .inner { display: flex; align-items: center; gap: 14px; padding: 14px clamp(16px, 3vw, 36px); min-height: 64px; }
.admin-top h1 { font-size: 24px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-top .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.admin-content { padding: 28px clamp(16px, 3vw, 36px) 64px; max-width: 1400px; }
.admin-menu-btn { display: none; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar .input, .toolbar .select { width: auto; min-height: 40px; }
.toolbar .input-icon { flex: 1 1 260px; }
.toolbar .input-icon .input { width: 100%; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; }
.filters .select { width: auto; min-height: 40px; max-width: 280px; }
.filters .label { font-size: 13px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.admin-outline { list-style: none; margin: 0; padding: 0; }
.admin-outline li { border-top: 1px solid var(--line); }
.admin-outline li:first-child { border-top: 0; }
.admin-outline .item { display: flex; gap: 12px; align-items: center; padding: 12px 20px; }
.admin-outline .item.is-topic { padding-left: 52px; }
.admin-outline .item.is-quiz { padding-left: 52px; }
.admin-outline .item.is-topic.is-quiz { padding-left: 84px; }
.admin-outline .item .kind { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.admin-outline .item .kind .icon { width: 15px; height: 15px; }
.admin-outline .item a.t { text-decoration: none; font-weight: 600; flex: 1; min-width: 0; }
.admin-outline .item a.t:hover { color: var(--brand); }
.admin-outline .item .acts { display: flex; gap: 6px; opacity: .85; }

/* Gráficos (HTML/CSS) */
.chart-card .card-head { border-bottom: 0; padding-bottom: 6px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.colchart { --h: 220px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 10px 24px 8px; }
.colchart .yaxis { position: relative; height: var(--h); font-size: 11px; color: var(--muted); text-align: right; }
.colchart .yaxis span { position: absolute; right: 0; transform: translateY(50%); font-variant-numeric: tabular-nums; }
.colchart .plot { position: relative; height: var(--h); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 6px; border-bottom: 1px solid var(--line-strong); }
.colchart .grid-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.colchart .month { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 6px; }
.colchart .month:hover { background: rgba(15,23,42,.035); }
.colchart .bar { width: min(16px, 40%); border-radius: 4px 4px 0 0; min-height: 0; }
.colchart .bar.b1 { background: var(--series-1); }
.colchart .bar.b2 { background: var(--series-2); }
.colchart .tip {
  position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translate(-50%, 4px); opacity: 0; pointer-events: none; z-index: 3;
  background: var(--ink); color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transition: opacity .12s, transform .12s; box-shadow: var(--shadow-lg);
}
.colchart .tip b { display: block; margin-bottom: 4px; }
.colchart .tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.colchart .month:hover .tip, .colchart .month:focus .tip { opacity: 1; transform: translate(-50%, 0); }
.colchart .xaxis { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; font-size: 11px; color: var(--muted); text-align: center; padding-top: 6px; }
.hbars { display: grid; gap: 12px; padding: 4px 24px 22px; }
.hbar .hbar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 5px; }
.hbar .hbar-top .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hbar .hbar-top .val { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.hbar .track { position: relative; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hbar .track span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.hbar .track .t1 { background: var(--series-1-soft); }
.hbar .track .t2 { background: var(--series-1); }
.table-view { margin: 0 24px 18px; }
.table-view > summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.table-view .table { margin-top: 10px; }

@media (max-width: 1100px) {
  .split, .split-even { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-102%); transition: transform .25s; }
  body.admin-menu-open .admin-side { transform: none; box-shadow: var(--shadow-lg); }
  body.admin-menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 55; }
  .admin-menu-btn { display: inline-flex; }
  .admin-top h1 { font-size: 20px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
}

/* =====================================================================
   Layouts de ficha / responsive general
   ===================================================================== */
@media (max-width: 1020px) {
  .course-layout { grid-template-columns: 1fr; margin-top: -20px; }
  .course-side { position: static; order: -1; }
  .welcome-grid, .landing-grid { grid-template-columns: 1fr; }
  .landing-art { display: none; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .card-pad, .ficha-section { padding: 18px; }
  .card-head, .card-body { padding-left: 18px; padding-right: 18px; }
  .course-grid { grid-template-columns: 1fr; gap: 16px; }
  .facts { gap: 12px 20px; }
  .searchbar .select { flex: 1 1 100%; }
  .welcome-stats { gap: 20px; }
  .question { padding: 18px 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .app-header, .tabbar, .admin-side, .admin-top .actions, .player-top, .player-side, .step-actions { display: none !important; }
  body { background: #fff; }
}
.step-actions.is-static { position: static; background: none; margin-top: 24px; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kpis-4 { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .step-actions { gap: 8px; padding: 10px 0; }
  .step-actions .complete { order: 3; flex: 1 1 100%; margin: 0; display: flex; justify-content: center; }
  .step-actions form.complete .btn { width: 100%; }
}
@media (max-width: 560px) {
  .step-actions:not(.is-static) { background: var(--surface); box-shadow: 0 -10px 18px rgba(255,255,255,.95); }
}
.cover.side-cover { width: 240px; flex: none; aspect-ratio: auto; min-height: 180px; }
.course-side:has(#solicitar) { position: static; }

/* =====================================================================
   Inicio (estructura tipo portal) y Nosotros
   ===================================================================== */
.btn-outline-light { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.85); border-width: 2px; border-radius: 6px; letter-spacing: .02em; }
.btn-outline-light:hover { background: #fff; color: var(--ink); }

/* Carrusel */
.carousel { position: relative; background: var(--navy); }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: auto; min-height: clamp(380px, 52vh, 520px); display: flex; align-items: center; }
.slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,23,42,.55), rgba(15,23,42,0) 70%); pointer-events: none; }
.slide .cover-icon { width: min(42vw, 460px); right: 4%; bottom: auto; top: 50%; transform: translateY(-50%); opacity: .18; }
.slide-inner { position: relative; z-index: 1; padding-top: 48px; padding-bottom: 64px; }
.slide .eyebrow { color: rgba(255,255,255,.85); }
.slide-title { color: #fff; font-size: clamp(34px, 5.4vw, 60px); max-width: 16ch; margin: 12px 0 14px; text-transform: uppercase; letter-spacing: .01em; }
.slide-text { color: rgba(255,255,255,.88); font-size: 18px; max-width: 46ch; margin-bottom: 28px; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(15,23,42,.35); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.carousel-btn:hover { background: rgba(15,23,42,.6); }
.carousel-btn.prev { left: 16px; } .carousel-btn.next { right: 16px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 20px; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.carousel-dots button { width: 10px; height: 10px; border-radius: 999px; border: 0; padding: 0; background: rgba(255,255,255,.45); cursor: pointer; transition: width .2s, background .2s; }
.carousel-dots button[aria-selected="true"] { width: 28px; background: #fff; }
@media (max-width: 700px) { .carousel-btn { display: none; } .slide .cover-icon { width: 70vw; right: -18%; opacity: .14; } }

/* Frase de quiénes somos */
.intro { background: var(--surface-2); padding: 56px 0; border-bottom: 1px solid var(--line); }
.intro-text { font: 500 clamp(19px, 2.3vw, 25px)/1.45 var(--font); color: var(--ink-2); margin: 0 auto 28px; max-width: 50ch; text-wrap: balance; }
.intro .btn { border-radius: 6px; }

/* Franja con lema */
.band { background: var(--brand); color: #fff; padding: 30px 0; }
.band-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; }
.band h2 { color: #fff; margin: 0; font-size: clamp(24px, 3vw, 34px); max-width: 24ch; }
.band-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.band-stats strong { display: block; font: 700 32px/1 var(--font-display); }
.band-stats span { font-size: 13px; opacity: .85; }

.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.center-head { flex-direction: column; align-items: center; text-align: center; }
.center-head .lead { margin: 4px auto 0; }

/* Oferta de formación: tiles como tarjetas de producto */
.offer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.offer { aspect-ratio: auto; min-height: 300px; border-radius: var(--radius-lg); text-decoration: none; display: flex; align-items: flex-end; transition: transform .18s, box-shadow .18s; }
.offer:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.offer::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,23,42,.72), rgba(15,23,42,0) 65%); }
.offer .cover-icon { width: 58%; right: -6%; top: -8%; bottom: auto; opacity: .22; }
.offer-n { position: absolute; left: 18px; top: 18px; z-index: 1; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 12px; font-weight: 600; }
.offer-body { position: relative; z-index: 1; display: grid; gap: 8px; padding: 22px; }
.offer-body strong { font: 700 24px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.offer-text { font-size: 14px; color: rgba(255,255,255,.88); line-height: 1.5; }
.offer-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin-top: 4px; }
.offer:hover .offer-link { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1020px) { .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .offer-grid { grid-template-columns: 1fr; } .offer { min-height: 240px; } }

/* Valores */
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.value-card { position: relative; padding: 26px 22px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); border-top: 4px solid var(--brand); }
.value-card .value-n { font: 700 14px var(--font-display); color: var(--brand); letter-spacing: .06em; }
.value-card h3 { font-size: 24px; margin: 6px 0 8px; }
.value-card p { color: var(--muted); font-size: 15px; margin: 0; }

/* Cierre */
.cta-band { padding: 64px 0; }
.cta-band h2 { color: #fff; font-size: clamp(28px, 3.6vw, 40px); }
.cta-band .lead { color: rgba(255,255,255,.82); }
.cta-band .eyebrow { color: #ffb3a1; }

/* Nosotros */
.page-hero { padding: 40px 0 56px; }
.page-hero h1 { color: #fff; }
.page-hero .crumbs, .page-hero .crumbs a { color: rgba(255,255,255,.75); }
.page-hero .lead { color: rgba(255,255,255,.85); }
.about-story { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.story-stats { display: grid; gap: 14px; }
.story-stats div { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); }
.story-stats strong { display: block; font: 700 34px/1 var(--font-display); }
.story-stats span { font-size: 14px; color: var(--muted); }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.social-card { display: flex; gap: 20px; align-items: flex-start; padding: 28px; border-radius: var(--radius-xl); background: var(--brand-soft); border: 1px solid var(--brand-tint); }
.social-card .pillar-icon { background: var(--brand); color: #fff; flex: none; }
@media (max-width: 860px) { .about-story { grid-template-columns: 1fr; } .social-card { flex-direction: column; } }
.social-card .pillar-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }

/* =====================================================================
   Fotos reales de Fritz (solo páginas del sitio: inicio, nosotros, login)
   Capas: foto → tinte del tono → trama → sombra para el texto → contenido
   ===================================================================== */
.has-photo { position: relative; overflow: hidden; isolation: isolate; }
.has-photo > img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.has-photo > .tint { position: absolute; inset: 0; z-index: -1; background: linear-gradient(135deg, var(--a), var(--b)); mix-blend-mode: multiply; opacity: .5; }
.has-photo > .shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(15,23,42,.92) 0%, rgba(15,23,42,.72) 45%, rgba(15,23,42,.35) 100%); }
.cover.has-photo::before { z-index: 0; opacity: .08; }
.cover.has-photo::after { z-index: 0; }

/* Carrusel con foto */
.slide.has-photo::after { background: linear-gradient(90deg, rgba(15,23,42,.88) 0%, rgba(15,23,42,.6) 45%, rgba(15,23,42,.1) 100%); }
.slide.has-photo > img.photo { object-position: center 30%; }
@media (max-width: 700px) { .slide.has-photo::after { background: linear-gradient(0deg, rgba(15,23,42,.92) 0%, rgba(15,23,42,.65) 60%, rgba(15,23,42,.35) 100%); } }

/* Áreas con foto */
.offer.has-photo > img.photo { object-position: center 25%; transition: transform .5s ease; }
.offer.has-photo:hover > img.photo { transform: scale(1.05); }
.offer.has-photo > .tint { opacity: .42; }
.offer.has-photo::after { background: linear-gradient(to top, rgba(15,23,42,.9) 0%, rgba(15,23,42,.55) 45%, rgba(15,23,42,.05) 75%); }
.offer-n { display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: rgba(15,23,42,.35); }
.offer { min-height: 340px; }

/* Nuestra gente: mosaico */
.people-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: 230px 230px; gap: 14px; }
.people-grid .ph { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-3); }
.people-grid .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.people-grid .ph:hover img { transform: scale(1.04); }
.people-grid .ph figcaption { position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(15,23,42,.72); color: #fff; font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.people-grid .ph-a { grid-row: 1 / 3; }
.people-grid .ph-b img { object-position: center 20%; }
.people-grid .ph-e img { object-position: center 15%; }
@media (max-width: 860px) {
  .people-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 260px 180px 180px; }
  .people-grid .ph-a { grid-column: 1 / 3; grid-row: auto; }
}

/* Nosotros con fotos */
.page-hero.has-photo { padding: 72px 0 88px; }
.page-hero.has-photo > img.photo { object-position: center 35%; }
.story-photo { margin: 0; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4 / 3.4; }
.story-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.story-stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .story-stats-row { grid-template-columns: 1fr; } }
.social-card { align-items: center; }
.social-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 0 0 min(44%, 420px); }
.social-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-lg); display: block; }
@media (max-width: 860px) { .social-photos { flex-basis: auto; width: 100%; } }

/* Login con foto */
.auth-art.has-photo > img.photo { object-position: center 20%; }
.auth-art.has-photo > .shade { background: linear-gradient(160deg, rgba(15,23,42,.55) 0%, rgba(15,23,42,.8) 55%, rgba(140,13,22,.88) 100%); }
.auth-art.has-photo::after { display: none; }
.hero.has-photo::after { opacity: .03; }
.auth-art.has-photo > img.photo { object-position: 85% 15%; }
@media (max-width: 430px) { .app-header .header-actions .btn-ghost.hide-desktop { display: none; } }
.slide.has-photo:first-child > img.photo { object-position: center center; }
