/* ============================================================
   Capacitando Abogados — Design System
   Paleta derivada del logo (#372D23) y de la marca de la academia
   (navy #001824 + oro #D2BA7E). Contrastes verificados WCAG AA.
   ============================================================ */

/* ---------- Tokens ---------- */
:root,
[data-theme="light"] {
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F5F3EF;
  --bg-tertiary:   #EAE6DE;
  --bg-deep:       #001824;
  --text-primary:  #001824;
  --text-secondary:#44545E;
  --text-muted:    #63717D;
  --text-on-deep:  #F2EFE9;
  --border:        #DCD7CC;
  --border-strong: #C3BCAD;
  --accent:        #001824;
  --accent-hover:  #0A2C3C;
  --accent-text:   #FFFFFF;
  --gold:          #80632D;
  --gold-brand:    #D2BA7E;
  --gold-line:     #C8AE71;
  --sepia:         #372D23;
  --danger:        #A32017;
  --success:       #1A6E45;
  --warning:       #8A4D08;
  --surface:       #FFFFFF;
  --surface-alt:   #F5F3EF;
  --shadow-sm:     0 1px 2px rgba(0,24,36,.06);
  --shadow-md:     0 6px 24px rgba(0,24,36,.10);
  --shadow-lg:     0 18px 48px rgba(0,24,36,.16);
  --ripple-color:  rgba(0,24,36,.16);
}

[data-theme="dark"] {
  --bg-primary:    #00131C;
  --bg-secondary:  #001824;
  --bg-tertiary:   #0A2632;
  --bg-deep:       #000C12;
  --text-primary:  #F2EFE9;
  --text-secondary:#A9B4BC;
  --text-muted:    #7C8B96;
  --text-on-deep:  #F2EFE9;
  --border:        #123240;
  --border-strong: #1D4557;
  --accent:        #D2BA7E;
  --accent-hover:  #E2CE9B;
  --accent-text:   #001824;
  --gold:          #D2BA7E;
  --gold-brand:    #D2BA7E;
  --gold-line:     #8A7442;
  --sepia:         #4A3D30;
  --danger:        #E8776B;
  --success:       #4FC08A;
  --warning:       #E0A050;
  --surface:       #001824;
  --surface-alt:   #0A2632;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.4);
  --shadow-md:     0 6px 24px rgba(0,0,0,.5);
  --shadow-lg:     0 18px 48px rgba(0,0,0,.6);
  --ripple-color:  rgba(210,186,126,.28);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  overscroll-behavior-y: none;
  transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: .005em;
  /* Cormorant usa cifras old-style por defecto: "11" se leería como "II". */
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
h1 { font-size: clamp(30px, 6vw, 46px); }
h2 { font-size: clamp(24px, 4.6vw, 34px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
p  { margin: 0 0 1rem; }

/* Etiqueta de sección: versalitas con filete dorado */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .85rem;
  font-family: Inter, system-ui, sans-serif;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold-line);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.seccion { padding: 4rem 0; }
.seccion--alt { background: var(--bg-secondary); }
.seccion--deep {
  background: var(--bg-deep);
  color: var(--text-on-deep);
}
.seccion--deep h1, .seccion--deep h2, .seccion--deep h3 { color: var(--text-on-deep); }
.seccion--deep .eyebrow { color: var(--gold-brand); }
.seccion--deep .eyebrow::before { background: var(--gold-brand); }
.seccion--deep p { color: #B9C4CC; }

#app { min-height: 100vh; }
.main-content { padding-bottom: 88px; }

@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  .seccion   { padding: 2.75rem 0; }
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1.5rem;
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) {
  .app-header { background: var(--bg-primary); }
}
.app-header__logo { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.app-header__logo img { height: 80px; width: auto; max-width: 180px; object-fit: contain; border-radius: 4px; }
.app-header__nav { display: flex; gap: .25rem; margin-left: auto; }
.app-header__nav a {
  padding: .5rem .85rem;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  position: relative;
}
.app-header__nav a:hover { background: var(--bg-secondary); color: var(--text-primary); }
.app-header__nav a.active { color: var(--text-primary); font-weight: 600; }
.app-header__nav a.active::after {
  content: "";
  position: absolute;
  left: .85rem; right: .85rem; bottom: .25rem;
  height: 2px;
  background: var(--gold-line);
}
.app-header__acciones { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.app-header__nav + .app-header__acciones { margin-left: .5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
}
.icon-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.icon-btn svg { width: 19px; height: 19px; }

@media (max-width: 900px) { .app-header__nav { display: none; } }
@media (max-width: 768px) { .app-header { padding: .6rem 1rem; } }
/* Academia e instalación siguen accesibles desde "Ver más" en mobile. */
@media (max-width: 640px) {
  .app-header__academia,
  .app-header [data-accion="instalar-app"] { display: none !important; }
  .app-header__nav + .app-header__acciones { margin-left: auto; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  padding: .7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--primary { background: var(--accent); color: var(--accent-text); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--gold {
  background: var(--gold-brand);
  color: #001824;
  font-weight: 600;
}
.btn--gold:hover { background: #E2CE9B; }
.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--bg-secondary); }
.btn--sobre-oscuro {
  background: transparent;
  color: #F2EFE9;
  border-color: rgba(210,186,126,.55);
}
.btn--sobre-oscuro:hover { background: rgba(210,186,126,.14); }
.btn--sm {
  /* Compacto pero nunca por debajo del mínimo táctil de 44px (skill 03). */
  min-height: 44px;
  padding: .5rem 1rem;
  font-size: 13.5px;
}
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* Ripple (skill 31) */
.ripple { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: var(--ripple-color);
  transform: scale(0);
  animation: ripple-anim .6s linear;
  pointer-events: none;
}
.btn--primary .ripple-wave,
.btn--gold .ripple-wave { background: rgba(255,255,255,.35); }
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* ---------- Hero (composición asimétrica) ---------- */
.hero {
  position: relative;
  background: var(--bg-deep);
  color: var(--text-on-deep);
  overflow: hidden;
  padding: 4.5rem 0 4rem;
}
.hero__fondo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .30;
}
.hero__velo {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, #001824 12%, rgba(0,24,36,.90) 46%, rgba(0,24,36,.55) 100%);
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2.5rem;
  align-items: center;
}
.hero__contenido { max-width: 620px; }
.hero h1 { color: #FFFFFF; margin-bottom: 1rem; }
.hero h1 em {
  font-style: italic;
  color: var(--gold-brand);
}
.hero__sub {
  color: #BAC5CD;
  font-size: 16.5px;
  max-width: 52ch;
  margin-bottom: 1.75rem;
}
.hero__acciones { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero__sello {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.cert-foto {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(210,186,126,.4);
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}

/* ---------- Historia (foto junto al texto, en el HOME) ---------- */
.historia-home__grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2.5rem;
  align-items: center;
}
.historia-home__foto {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px var(--shadow);
}
.historia-home__foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 900px) {
  .historia-home__grid { grid-template-columns: 1fr; }
  .historia-home__foto { order: -1; aspect-ratio: 16 / 10; }
}

/* ---------- Fondo fotográfico en secciones "seccion--deep" (CTA academia) ---------- */
.seccion--deep-foto { position: relative; overflow: hidden; }
.seccion--deep-foto .container { position: relative; z-index: 1; }
.hero__datos {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 2.25rem;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(210,186,126,.28);
}
.hero__dato strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  font-size: 34px;
  font-weight: 600;
  color: var(--gold-brand);
  line-height: 1;
}
.hero__dato span {
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #93A2AC;
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero__sello { display: none; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero__datos { gap: 1.5rem; margin-top: 2rem; }
  .hero__dato strong { font-size: 27px; }
}

/* ---------- Tarjetas (con filete dorado, no cajas genéricas) ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px 14px 14px 4px;
  padding: 1.5rem 1.4rem 1.4rem;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold-line);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card__num {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .12em;
}
.card h3 { margin: .5rem 0 .5rem; }
.card p { color: var(--text-secondary); font-size: 14.5px; margin: 0; }
.card__icono {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--gold);
  margin-bottom: .9rem;
}
.card__icono svg { width: 21px; height: 21px; }
.seccion--deep .card {
  background: rgba(255,255,255,.045);
  border-color: rgba(210,186,126,.22);
}
.seccion--deep .card p { color: #AFBBC3; }
.seccion--deep .card__icono { background: rgba(210,186,126,.14); color: var(--gold-brand); }

/* Tarjeta de curso */
.curso {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.curso:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.curso__img {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--bg-deep);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.curso__img img { width: 100%; height: 100%; object-fit: cover; }
.curso__badge {
  position: absolute;
  top: .7rem; left: .7rem;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: var(--gold-brand);
  color: #001824;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.curso__body { padding: 1.15rem 1.15rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.curso__body h3 { font-size: 19px; margin-bottom: .45rem; }
.curso__desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.curso__pie {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: .9rem;
  border-top: 1px solid var(--border);
}
.curso__precio { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.curso__precio--consultar { color: var(--gold); font-size: 13.5px; font-weight: 600; }

/* ---------- Formularios ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .45rem;
}
.form-control {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  font-size: 16px; /* 16px evita el zoom automático en iOS */
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  outline: none;
  border-color: var(--gold-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-line) 25%, transparent);
}
.form-control[aria-invalid="true"] { border-color: var(--danger); }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: .35rem; }
.form-error { font-size: 13px; color: var(--danger); margin-top: .35rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; gap: 0; } }

/* Campo de contraseña con ojo (skill 31) */
.password-field { position: relative; }
.password-field .form-control { padding-right: 3rem; }
.toggle-password {
  position: absolute;
  right: .45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
}
.toggle-password:hover { color: var(--text-primary); background: var(--bg-secondary); }
.toggle-password svg { width: 19px; height: 19px; }

/* ---------- Panel de autenticación ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth__aside {
  position: relative;
  background: var(--bg-deep);
  color: #F2EFE9;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.auth__aside-fondo { position: absolute; inset: 0; opacity: .22; background-size: cover; background-position: center; }
.auth__aside-cont { position: relative; max-width: 420px; }
.auth__aside h2 { color: #fff; margin-bottom: .9rem; }
.auth__aside p { color: #B0BCC5; }
.auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg-primary);
}
.auth__form { width: 100%; max-width: 400px; }
.auth__logo { height: 144px; width: auto; max-width: 100%; object-fit: contain; margin-bottom: 1.6rem; border-radius: 5px; }
.auth__pie { margin-top: 1.4rem; font-size: 14px; color: var(--text-secondary); text-align: center; }
.auth__pie a { color: var(--gold); font-weight: 600; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__panel { min-height: 100vh; }
}

/* ---------- Perfil ---------- */
.perfil-cabecera {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.6rem;
  background: var(--bg-deep);
  border-radius: 16px;
  color: #F2EFE9;
  margin-bottom: 1.75rem;
}
.avatar {
  width: 82px; height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-brand);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}
.avatar--placeholder {
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-variant-numeric: lining-nums;
  font-size: 30px;
  font-weight: 600;
  color: var(--gold-brand);
  background: rgba(210,186,126,.14);
}
.perfil-cabecera h2 { color: #fff; font-size: 26px; }
.perfil-cabecera .rol {
  display: inline-block;
  margin-top: .4rem;
  padding: .2rem .6rem;
  border: 1px solid rgba(210,186,126,.5);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-brand);
}
.avatar-editor { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
@media (max-width: 560px) {
  .perfil-cabecera { flex-direction: column; text-align: center; gap: .9rem; }
}

/* ---------- Footer nav mobile (skill 31) ---------- */
.app-footer-nav { display: none; }
@media (max-width: 900px) {
  .app-footer-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 66px;
    display: flex;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    z-index: 940;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app-footer-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
    min-height: 44px;
  }
  .app-footer-nav a svg { width: 21px; height: 21px; }
  .app-footer-nav a.active { color: var(--gold); font-weight: 600; }
  .app-footer-nav a.active::before {
    content: "";
    position: absolute;
    top: 0; left: 22%; right: 22%;
    height: 2px;
    background: var(--gold-line);
  }
}

/* Menú "Ver más": todo lo del desktop accesible en mobile */
.menu-completo { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.menu-completo a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.05rem .5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12.5px;
  text-align: center;
  color: var(--text-primary);
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  min-height: 88px;
}
.menu-completo a:hover { background: var(--bg-secondary); }
.menu-completo a svg { width: 22px; height: 22px; color: var(--gold); }

/* ---------- Modal ---------- */
.modal-wrapper {
  position: fixed;
  inset: 0;
  background: rgba(0,12,18,.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modal-in .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes modal-in { from { transform: translateY(14px); opacity: 0; } }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
}
.modal__header h3 { font-size: 21px; }
.modal__body { flex: 1; overflow-y: auto; padding: 1.35rem; }
.modal__footer {
  display: flex;
  gap: .7rem;
  justify-content: flex-end;
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  border-radius: 0 0 16px 16px;
}
@media (max-width: 640px) {
  .modal-wrapper { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal__footer { border-radius: 0; }
  .modal__footer .btn { flex: 1; }
}

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 9999;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.1rem;
  border-radius: 12px;
  font-size: 14px;
  color: #fff;
  box-shadow: var(--shadow-md);
  animation: toast-in .25s ease;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
.toast--error   { background: var(--danger); }
.toast--success { background: var(--success); }
.toast--warning { background: var(--warning); }
.toast--info    { background: #0A2C3C; }

/* ---------- Estados ---------- */
.estado {
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 420px;
  margin: 0 auto;
}
.estado__icono {
  width: 62px; height: 62px;
  margin: 0 auto 1.1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--gold);
}
.estado__icono svg { width: 27px; height: 27px; }
.estado h3 { margin-bottom: .5rem; }
.estado p { color: var(--text-secondary); font-size: 14.5px; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 37%, var(--bg-secondary) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 10px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skeleton--card { height: 210px; }

/* ---------- Cursos: buscador y chips de filtro ---------- */
.cursos-filtros {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* ---------- Historia: línea editorial ---------- */
.historia-linea { position: relative; max-width: 760px; margin-top: 1rem; }
.historia-linea::before {
  content: ''; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 1px;
  background: var(--gold-line);
}
.historia-item { position: relative; display: flex; gap: 1.5rem; padding-bottom: 2.75rem; }
.historia-item:last-child { padding-bottom: 0; }
.historia-item__num {
  flex-shrink: 0; width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--gold-line);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  font-size: 20px; font-weight: 600; color: var(--gold);
  z-index: 1;
}
.historia-item__cont { padding-top: .55rem; }
.historia-item__cont h3 { margin-bottom: .5rem; }
.historia-item__cont p { color: var(--text-secondary); }
.historia-item__img {
  margin-top: 1rem; max-width: 100%; border-radius: 12px; display: block;
  box-shadow: var(--shadow-md);
}
@media (max-width: 560px) {
  .historia-linea::before { left: 21px; }
  .historia-item { gap: 1rem; }
  .historia-item__num { width: 44px; height: 44px; font-size: 16px; }
}

/* ---------- Galería ---------- */
.galeria-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem;
}
@media (max-width: 900px) { .galeria-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .galeria-grid { grid-template-columns: repeat(2, 1fr); } }
.galeria-item {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  cursor: pointer; background: var(--bg-tertiary); border: 1px solid var(--border);
}
.galeria-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.galeria-item:hover img { transform: scale(1.06); }
.galeria-item__velo {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: .6rem .7rem;
  background: linear-gradient(180deg, transparent 55%, rgba(0,24,36,.78));
  opacity: 0; transition: opacity .2s;
}
.galeria-item:hover .galeria-item__velo, .galeria-item:focus-visible .galeria-item__velo { opacity: 1; }
.galeria-item__velo span { color: #fff; font-size: 12.5px; font-weight: 600; }

.lightbox {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,10,16,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.lightbox__cerrar {
  position: absolute; top: 1rem; right: 1rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: none; color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.lightbox__cerrar:hover { background: rgba(255,255,255,.18); }
.lightbox img { max-width: 92vw; max-height: 78vh; border-radius: 10px; object-fit: contain; }
.lightbox__pie { color: #E8E2D6; margin-top: 1rem; text-align: center; max-width: 60ch; font-size: 14.5px; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: none; color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.lightbox__nav:hover { background: rgba(255,255,255,.18); }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }
@media (max-width: 640px) { .lightbox__nav { display: none; } }

/* ---------- Contacto ---------- */
.contacto-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.75rem; align-items: start; }
@media (max-width: 860px) { .contacto-grid { grid-template-columns: 1fr; } }
.contacto-card {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.15rem; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); margin-bottom: 1rem; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.contacto-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.contacto-card__icono {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 10px;
  background: rgba(210,186,126,.14); color: var(--gold);
  display: grid; place-items: center;
}
.contacto-card h4 { margin: 0 0 .2rem; font-size: 15.5px; color: var(--text-primary); }
.contacto-card p { margin: 0; font-size: 13.5px; color: var(--text-secondary); }
.contacto-redes { display: flex; gap: .6rem; margin-top: 1.5rem; }

/* ---------- WhatsApp flotante (skill 14) ---------- */
.whatsapp-float {
  position: fixed; right: 16px; bottom: 88px; z-index: 950;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}
.whatsapp-float:hover { background: #21BC5C; }
.whatsapp-float svg { width: 27px; height: 27px; }
@media (min-width: 901px) { .whatsapp-float { bottom: 24px; } }

/* ---------- Panel admin ---------- */
.admin-layout { display: flex; min-height: calc(100vh - 64px); align-items: flex-start; }
.admin-sidebar {
  width: 232px; flex-shrink: 0; padding: 1.75rem 1rem;
  position: sticky; top: 0;
}
.admin-sidebar__nav { display: flex; flex-direction: column; gap: .2rem; }
.admin-sidebar__nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .9rem; border-radius: 10px;
  min-height: 44px;
  color: var(--text-secondary); font-size: 14px; font-weight: 600;
  text-decoration: none;
}
.admin-sidebar__nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-sidebar__nav a:hover { background: var(--bg-secondary); color: var(--text-primary); }
.admin-sidebar__nav a.active { background: var(--accent); color: var(--accent-text); }
.admin-content { flex: 1; min-width: 0; padding: 1.75rem 1.5rem 3rem; }
.admin-content__head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem; margin-bottom: 1.5rem;
}
.admin-content__head h2 { margin: 0; }
.admin-tabs-mobile { display: none; }
@media (max-width: 900px) {
  .admin-layout { flex-direction: column; align-items: stretch; }
  .admin-sidebar { display: none; }
  .admin-tabs-mobile {
    display: flex; gap: .5rem; overflow-x: auto; padding: 1rem 1rem .25rem;
    -webkit-overflow-scrolling: touch;
  }
  .admin-tabs-mobile a {
    flex-shrink: 0; display: flex; align-items: center; gap: .4rem;
    padding: 0 1rem; min-height: 44px; border-radius: 999px;
    border: 1px solid var(--border); font-size: 13px; font-weight: 600;
    color: var(--text-secondary); white-space: nowrap; text-decoration: none;
  }
  .admin-tabs-mobile a svg { width: 15px; height: 15px; }
  .admin-tabs-mobile a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
  .admin-content { padding: 1rem 1rem 3rem; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi-card {
  padding: 1.25rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
}
.kpi-card__num {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  font-size: 34px; font-weight: 600; color: var(--text-primary); line-height: 1;
}
.kpi-card__label { margin-top: .4rem; font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

.tabla-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.tabla th, .tabla td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tabla td.wrap { white-space: normal; }
.tabla th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--bg-secondary); }
.tabla tr:last-child td { border-bottom: none; }
.tabla tr:hover td { background: var(--bg-secondary); }
.tabla .acciones-cel { display: flex; gap: .4rem; }

/* ---------- Filtros y búsqueda del admin (skill: cards en mobile, nunca tablas) ---------- */
.admin-filtros {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.admin-filtros__buscar { flex: 1 1 220px; min-width: 180px; }
.admin-filtros .chips { flex-wrap: wrap; }

/* ---------- Tarjetas admin (reemplazan la tabla en mobile) ---------- */
.tarjetas-admin { display: none; flex-direction: column; gap: .75rem; }
.tarjeta-admin {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .6rem;
}
.tarjeta-admin__cab { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.tarjeta-admin__tit { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.tarjeta-admin__sub { font-size: 12.5px; color: var(--text-muted); margin-top: .1rem; }
.tarjeta-admin__meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: 13px; color: var(--text-secondary); align-items: center; }
.tarjeta-admin__meta span { display: inline-flex; align-items: center; gap: .3rem; }
.tarjeta-admin__meta svg { width: 14px; height: 14px; flex-shrink: 0; }
.tarjeta-admin__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.tarjeta-admin__acciones { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .1rem; }
.tarjeta-admin__acciones .btn { flex: 1 1 auto; }

@media (max-width: 900px) {
  .tabla-wrap { display: none; }
  .tarjetas-admin { display: flex; }
}

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge--ok      { background: rgba(26,122,74,.14);  color: var(--success); }
.badge--danger  { background: rgba(192,57,43,.14);  color: var(--danger); }
.badge--admin   { background: rgba(210,186,126,.18); color: var(--gold); }
.badge--muted   { background: var(--bg-tertiary); color: var(--text-muted); }

.form-switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; }
.form-switch__label { font-size: 14.5px; font-weight: 600; }
.form-switch__hint { font-size: 12.5px; color: var(--text-muted); font-weight: 400; margin-top: .15rem; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; }
.switch__track {
  position: absolute; inset: 0; background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 999px; transition: background .15s;
}
.switch__track::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s;
}
.switch input:checked + .switch__track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch__track::before { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--gold); outline-offset: 2px; }

.admin-seccion-config {
  padding: 1.4rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.admin-seccion-config h3 { margin: 0 0 .3rem; font-size: 17px; }
.admin-seccion-config > p.hint { margin: 0 0 1.1rem; font-size: 13px; color: var(--text-muted); }
.galeria-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .85rem; }
.galeria-admin-item { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.galeria-admin-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galeria-admin-item .icon-btn {
  position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; width: 34px; height: 34px;
}
.galeria-admin-item .icon-btn:hover { background: rgba(0,0,0,.75); }

/* ---------- Asistente IA flotante (skill 17) ---------- */
.ai-float-btn {
  position: fixed; left: 16px; bottom: 88px; z-index: 950;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg-deep); border: 2px solid var(--gold-brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.28); overflow: hidden; cursor: pointer;
  color: var(--gold-brand);
}
.ai-float-btn img { width: 100%; height: 100%; object-fit: cover; }
.ai-float-btn svg { width: 25px; height: 25px; }
@media (min-width: 901px) { .ai-float-btn { bottom: 24px; } }

.ai-chat-panel {
  position: fixed; left: 16px; bottom: 158px; z-index: 950;
  width: min(340px, calc(100vw - 32px)); max-height: min(480px, 65vh);
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: 16px;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
@media (min-width: 901px) { .ai-chat-panel { bottom: 92px; } }
.ai-chat-panel__head {
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.ai-chat-panel__head strong { font-size: 14.5px; }
.ai-chat-panel__msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; min-height: 160px; }
.ai-msg { max-width: 85%; padding: .55rem .8rem; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.ai-msg--user { align-self: flex-end; background: var(--accent); color: var(--accent-text); }
.ai-msg--bot  { align-self: flex-start; background: var(--bg-secondary); color: var(--text-primary); }
.ai-chat-panel__form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--border); }
.ai-chat-panel__form input {
  flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 0 1rem; min-height: 40px;
  background: var(--bg-secondary); color: var(--text-primary); font-size: 13.5px;
}
.ai-chat-panel__form button {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  border: none; display: grid; place-items: center; flex-shrink: 0; cursor: pointer;
}

/* ---------- Banner offline ---------- */
/* Fixed y por encima del header (sticky) para que siempre se vea, pero sin
   taparlo: body.ca-offline empuja el contenido con la altura real del banner
   (medida en JS, admite texto en 2 líneas en pantallas angostas). */
#offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1200;
  background: var(--warning); color: #fff; text-align: center;
  padding: .5rem 1rem; font-size: 13px; font-weight: 600;
  display: none; align-items: center; justify-content: center; gap: .5rem;
}
#offline-banner.visible { display: flex; }
body.ca-offline { padding-top: var(--offline-banner-h, 0px); }
body.ca-offline .app-header { top: var(--offline-banner-h, 0px); }

/* ---------- Instalar app (PWA, skill 09) ---------- */
[data-accion="instalar-app"][hidden] { display: none !important; }
.instalar-modal { text-align: center; padding: .25rem 0 .5rem; }
.instalar-modal__icono {
  width: 64px; height: 64px; margin: 0 auto 1.1rem;
  display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(150deg, rgba(210,186,126,.22), rgba(0,24,36,.06));
  color: var(--gold);
}
.instalar-modal__icono svg { width: 30px; height: 30px; }
.instalar-modal p { color: var(--text-secondary); max-width: 42ch; margin: 0 auto; }
.instalar-modal__pasos {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 1rem; text-align: left;
}
.instalar-modal__pasos li { display: flex; align-items: center; gap: .9rem; font-size: 14px; color: var(--text-primary); }
.instalar-modal__paso-num {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-secondary); border: 1px solid var(--gold-line);
  display: grid; place-items: center; color: var(--gold);
}
.instalar-modal__paso-num svg { width: 17px; height: 17px; }

/* ---------- Utilidades ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-2 { margin-bottom: 1.5rem; }
.seccion__cabecera { max-width: 680px; margin-bottom: 2.25rem; }
.seccion__cabecera p { color: var(--text-secondary); font-size: 16px; }
.divisor-oro { width: 52px; height: 2px; background: var(--gold-line); margin: 1.25rem 0; }
.acciones-fin { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Páginas legales (privacidad, baja de cuenta) — requisito de Google Play
   ============================================================ */
.legal { max-width: 820px; }
.legal__bloque { padding: 0 0 1.6rem 1.25rem; margin-bottom: 1.6rem; border-left: 2px solid var(--gold); }
.legal__bloque h2 { font-size: 20px; margin-bottom: .6rem; }
.legal__bloque p,
.legal__bloque li { color: var(--text-secondary); font-size: 15px; line-height: 1.7; }
.legal__bloque p { margin: 0 0 .75rem; }
.legal__bloque ul { margin: 0 0 .75rem; padding-left: 1.2rem; }
.legal__bloque li { margin-bottom: .3rem; }
@media (max-width: 768px) {
  .legal__bloque { padding-left: 1rem; }
  .legal__bloque h2 { font-size: 18px; }
}
