
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,Arial,sans-serif;background:#f5f6f8}
.wrap{max-width:1200px;margin:auto;padding:1rem}
.app-header{background:#fff;border-bottom:1px solid #ddd}
h1{font-size:1.2rem;margin:0}
@media(min-width:768px){
 h1{font-size:1.5rem}
}

/* Cabecera estilos */
/* ===== CABECERA INSTITUCIONAL COMPACTA ===== */

.app-header {
  background: #fff;
  border-bottom: 1px solid #cfcfcf;
}

.header-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  max-width: 1200px;
  margin: auto;
}

/* Logos */
.logo-left img,
.logo-right img {
  max-height: 55px;  
  width: auto;
}

/* Títulos */
.header-title {
  text-align: center;
  line-height: 1.2;
}

.header-title h1 {
  margin: 0;
  font-size: 1.05rem;   
  font-weight: 700;
  color: #000;
}

.header-title h2 {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #000;
}

/* Barra roja */
.header-bar {
  height: 5px;
  background: #8b1c2b;
  width: 100%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-top {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .logo-left,
  .logo-right {
    justify-self: center;
  }

  .logo-left img,
  .logo-right img {
    max-height: 45px;
  }

  .header-title h1 {
    font-size: 0.95rem;
  }

  .header-title h2 {
    font-size: 0.85rem;
  }
}


main.container {
  padding-top: 1rem; /* normalmente basta */
}

/* --- CABECERA NORMAL POR DEFECTO (móvil) --- */
.app-header {
  position: static;
  background: #ffffff;
  z-index: auto;
}

/* --- CABECERA STICKY SOLO EN DESKTOP --- */
@media (min-width: 992px) {
  .app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
  }
}

/* Tamaño de texto del contenido (sin afectar cabecera) */
.container {
  font-size: 16px;
  line-height: 1.4;
}

/* Un pelín más grande en escritorio */
@media (min-width: 992px) {
  .container {
    font-size: 17px;
    line-height: 1.45;
  }
}

/* ====== MÓVIL: aprovechar ancho ====== */
@media (max-width: 768px) {
  .container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  /* Si tu portada usa bs-wrap/cards */
  .bs-wrap {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Evita que las cards queden “pequeñas” */
  .bs-card {
    border-radius: 12px;
  }
}

.container-fluid { padding-left: 12px; padding-right: 12px; }
@media (min-width: 992px){
  .container-fluid{ max-width: 1100px; margin:0 auto; }
}

/* ====== AJUSTE TIPOGRÁFICO EN MÓVIL ====== */
@media (max-width: 768px) {

  /* Tamaño base del contenido */
  body {
    font-size: 16px;
  }

  /* Textos principales */
  main {
    font-size: 1rem;
    line-height: 1.45;
  }

  /* Títulos de secciones */
  h1 {
    font-size: 1.3rem;
  }
  h2 {
    font-size: 1.15rem;
  }
  h3 {
    font-size: 1.05rem;
  }

  /* Listas y párrafos (IMPORTANTE, Instrucciones, etc.) */
  p,
  li {
    font-size: 1rem;
  }

  /* Botones: que se lean bien con el dedo */
  .btn {
    font-size: 1rem;
  }
}

/* ====== FIX: texto demasiado pequeño en móvil (forzado) ====== */
@media (max-width: 768px) {

  /* fuerza el tamaño base del área de contenido */
  main,
  main * {
    font-size: 16px !important;
    line-height: 1.45 !important;
  }

  /* títulos dentro del contenido */
  main h1 { font-size: 20px !important; line-height: 1.2 !important; }
  main h2 { font-size: 18px !important; line-height: 1.25 !important; }
  main h3 { font-size: 17px !important; line-height: 1.3 !important; }

  /* listas más cómodas */
  main li { margin-bottom: 6px; }

  /* botones legibles */
  main .btn,
  main input[type="button"],
  main input[type="submit"] {
    font-size: 16px !important;
  }

  /* inputs para iOS (evita zoom) */
  main input,
  main select,
  main textarea {
    font-size: 16px !important;
  }
}

/* ====== AJUSTE TIPOGRAFÍA DESKTOP ====== */
@media (min-width: 992px) {

  /* Tamaño base del contenido */
  main {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  /* Títulos */
  main h1 { font-size: 1.6rem; }
  main h2 { font-size: 1.35rem; }
  main h3 { font-size: 1.15rem; }

  /* Listas y texto largo */
  main p,
  main li {
    font-size: 1.05rem;
  }

  /* Botones */
  main .btn,
  main .p-btn {
    font-size: 1.05rem;
  }
}

.bs-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .3px;
}

/* ====== Sticky footer ====== */
html, body {
  height: 100%;
}

.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1 0 auto;
}

.footer{
  margin-top: auto;              /* clave: empuja abajo */
  padding: 12px 0;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  text-align: center;
  font-size: .9rem;
  color: #6c757d;
}

/* ===== Login verpreinscripcion0: mejora visual sin tocar HTML ===== */
.vp0-login table {
  width: 100% !important;
  max-width: 720px;
  margin: 0 auto;
}

.vp0-login td {
  padding: 8px 10px;
  vertical-align: middle;
}

.vp0-login input[type="text"],
.vp0-login input[type="password"],
.vp0-login select {
  width: 100% !important;
  max-width: 320px;
}

/* Textos de ayuda (DNI/NIE) */
.vp0-login .help {
  font-size: 0.95rem;
  color: #6c757d;
  line-height: 1.35;
}

/* Botonera */
.vp0-login .actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.vp0-login .actions input,
.vp0-login .actions a {
  min-width: 140px;
}

/* Móvil: apilar y hacer campos más cómodos */
@media (max-width: 768px) {
  .vp0-login table,
  .vp0-login tbody,
  .vp0-login tr,
  .vp0-login td {
    display: block;
    width: 100% !important;
  }

  .vp0-login td {
    padding: 6px 0;
  }

  .vp0-login input[type="text"],
  .vp0-login input[type="password"],
  .vp0-login select {
    max-width: 100% !important;
    font-size: 16px; /* evita zoom iPhone */
  }

  .vp0-login .actions input,
  .vp0-login .actions a {
    width: 100%;
    max-width: 420px;
  }
}

.app-main{
  padding-top: 16px;
}

@media (min-width: 992px){
  .app-main{
    padding-top: 22px;
  }
}

.vp0-login .form-control,
.vp0-login .form-select {
  font-size: 16px; /* iPhone-friendly y más legible */
}

.bs-card-h {
  padding: 18px 20px;
}

.bs-title {
  margin-bottom: 0;
}

.bs-card-b {
  padding: 24px 20px;
}

/* Texto de modales más grande en desktop */
@media (min-width: 992px) {
  .modal-body {
    font-size: 1.05rem;   /* prueba 1.05 / 1.1 según te guste */
    line-height: 1.6;
  }
}

.pd-wrap {
  background: #fdfefe;
  padding: 12px;
  border-radius: 6px;
}

.bs-subhead{
  padding: .5rem .75rem;
  background: #f3f6fb;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .75rem;
}

/* ALERTA VALIDAR flotante (no desplaza el layout) */
#alertValidar{
  position: fixed;
  top: 110px;                 /* ajusta si tu cabecera es más alta */
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, calc(100% - 2rem));
  z-index: 2000;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  border-radius: 10px;
}

/* En móvil, un pelín más arriba */
@media (max-width: 576px){
  #alertValidar{
    top: 85px;
    width: calc(100% - 1rem);
  }
}

/* Portada / cajas de textos: que nunca recorten contenido */
.portada, .portada * {
  box-sizing: border-box;
}

.portada .box, 
.portada .card, 
.portada .card-body,
.portada .contenido {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Si algún contenedor es flex, permitir que el texto encoja/parta */
.portada .box,
.portada .card-body,
.portada .contenido {
  min-width: 0;
}

/* Textos largos: que partan bien */
.portada p, 
.portada li {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word; /* por si hay emails/URLs */
  line-height: 1.3;
}

/* ===== FIX iOS Safari: textos que se cortan en cards ===== */

.bs-grid{
  display:grid;
  gap:16px;
}

.bs-grid-2{
  grid-template-columns: repeat(2, minmax(0,1fr));
}

/* MUY IMPORTANTE: permite encoger contenido en grid */
.bs-grid > *{
  min-width:0;
}

/* evita que textos largos desborden */
.bs-note,
.bs-note *{
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* en móvil: una sola columna */
@media (max-width:768px){
  .bs-grid-2{
    grid-template-columns:1fr;
  }
}

.bs-note{
  background:#f8f9fa;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:1rem 1.25rem;
}
  /* =========================
     MODO DEMO
     ========================= */

  .demo-banner {
    position: sticky;
    top: 0;
    z-index: 1200;
    width: 100%;
    background: linear-gradient(90deg, #b3001b 0%, #c7001e 50%, #b3001b 100%);
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    padding: 0.70rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
  }

  .demo-watermark {
    position: fixed;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-24deg);
    z-index: 50;
    pointer-events: none;
    user-select: none;
    font-weight: 800;
    font-size: clamp(4rem, 16vw, 11rem);
    line-height: 1;
    letter-spacing: 0.08em;
    color: rgba(179, 0, 27, 0.10);
    text-transform: uppercase;
    white-space: nowrap;
  }

  @media (max-width: 768px) {
    .demo-banner {
      font-size: 0.82rem;
      padding: 0.55rem 0.75rem;
    }

    .demo-watermark {
      top: 54%;
      font-size: clamp(3rem, 22vw, 6rem);
      color: rgba(179, 0, 27, 0.08);
    }
  }