/* =========================================================
   Portal Bono del Pescador Artesanal - estilos responsive
   Se carga DESPUÉS de base.css. No depende de las clases
   antiguas (.formulario, .fondo, .bg-login).
   Móvil primero: base = celular, luego tablet y escritorio.
   ========================================================= */

:root {
  --azul: #1f6fb8;
  --azul-oscuro: #14507f;
  --dorado: #ffc93c;
  --texto: #1f2d3a;
  --texto-suave: #5b6b7a;
  --borde: #d5dde5;
  --radio: 16px;
  --sombra: 0 10px 30px rgba(10, 40, 70, .18);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.portal {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: Lato, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texto);
  background: #f3f6f9;
}

/* ---------- Cabecera con logos ---------- */
.portal-top {
  background: #fff;
  border-bottom: 1px solid var(--borde);
  padding: 0 10px;
}
.portal-top__inner {
  max-width: none;               /* sin límite de ancho: los logos llegan casi hasta los bordes */
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.portal-top__logo {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}
.portal-top__logo:nth-child(2) { justify-content: center; }
.portal-top__logo:nth-child(3) { justify-content: flex-end; }
.portal-top__logo img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 42px;
  object-fit: contain;
}
.portal-top__logo img.logo-bicentenario { max-height: 50px; }

/* ---------- Portada ---------- */
.hero {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Imagen con el texto ya incluido (2500x899).
   Menos de 1200px: el alto casi no se reduce y se recortan los lados,
   centrando la zona del texto para que siempre se lea. */
.hero__banner {
  position: relative;
  background: #0f3a82;
  overflow: hidden;
}
/* Celular: la imagen es el fondo y el texto va SIEMPRE encima (aunque tape
   al pescador). El alto del banner lo da el texto. */
.hero__bg {
  position: absolute;
  inset: 0;
  background: #1a4a73 url("../images/fondo-sin-letras.jpg") 12% center / cover no-repeat;
}
.hero__bg::after {            /* capa azul para que el texto se lea bien */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 40, 110, .35) 0%, rgba(8, 40, 110, .72) 45%, rgba(8, 40, 110, .85) 100%);
}

/* ---------- Texto de la portada (antes estaba dentro de la imagen) ---------- */
.hero__texto {
  --t: clamp(30px, 9.4vw, 54px);            /* tamaño base del título */
  position: relative;
  padding: 30px 18px 30px;
  max-width: 640px;
  margin: 0 auto;
  color: #fff;
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.hero__titulo {
  margin: 0;
  font-family: Anton, Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
  font-size: var(--t);
  line-height: .98;
  text-transform: uppercase;
  letter-spacing: .005em;
  text-shadow: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .4));
}
.hero__titulo span { display: block; }
.hero__titulo-1 {
  background: linear-gradient(180deg, #ffd23c 10%, #f5a100 90%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}
.hero__titulo-2 { color: #fff; }

.hero__beneficio {
  display: flex;
  align-items: center;
  gap: .3em;
  margin-top: .3em;
  font-size: var(--t);
}
.hero__beneficio-label {
  font-size: .5em;
  font-weight: 700;
  line-height: 1.02;
}
.hero__monto {
  font-family: Anton, Impact, "Arial Narrow", sans-serif;
  font-size: 1.75em;
  line-height: 1.05;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffd23c 10%, #f5a100 90%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .4));
}

.hero__detalle {
  margin-top: .5em;
  font-size: clamp(14px, 3.9vw, 18px);
  font-weight: 500;
  line-height: 1.4;
}
.hero__detalle p { margin: 0 0 .9em; }
.hero__detalle p:last-child { margin-bottom: 0; }
.hero__detalle strong {
  font-weight: 800;
  color: #ffc21a;
}

.hero__inner {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 28px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Tarjeta de consulta ---------- */
.consulta-card {
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 24px 20px 22px;
  text-align: center;
}
.consulta-card__titulo {
  margin: 0 0 6px;
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--azul);
}
.consulta-card__sub {
  margin: 0 0 18px;
  font-size: .98rem;
  line-height: 1.4;
  color: var(--texto-suave);
}

#dni_busqueda {
  display: block;
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 2px solid var(--borde);
  border-radius: 12px;
  background: #fff;
  color: var(--texto);
  font-size: 1.35rem;               /* >=16px evita el zoom automático en iOS */
  letter-spacing: .18em;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
#dni_busqueda::placeholder {
  font-size: 1rem;
  letter-spacing: normal;
  color: #8a98a6;
}
#dni_busqueda:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(31, 111, 184, .18);
}

.consulta-card__botones {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.consulta-card__botones .btn {
  flex: 1 1 0;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  transition: background-color .15s, transform .05s, box-shadow .15s;
}
.consulta-card__botones .btn:active { transform: translateY(1px); }
#btnBuscarDni {
  background: var(--azul);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 111, 184, .35);
}
#btnBuscarDni:hover { background: var(--azul-oscuro); }
#btnCancelarDni {
  background: #e9eef3;
  color: #3b4a58;
}
#btnCancelarDni:hover { background: #dbe3ea; }
.consulta-card__botones .btn:focus-visible {
  outline: 3px solid rgba(31, 111, 184, .45);
  outline-offset: 2px;
}

/* ---------- Mensaje de bienvenida (móvil / tablet: tarjeta azul) ---------- */
.bienvenida {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 18px;
  border-radius: var(--radio);
  color: #fff;
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-oscuro) 100%);
  box-shadow: 0 8px 22px rgba(20, 80, 127, .30);
}
/* adorno: círculo suave de fondo */
.bienvenida::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  pointer-events: none;
}

.bienvenida__monto {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.bienvenida__monto-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
}
.bienvenida__monto-valor {
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 900;
  color: var(--dorado);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.bienvenida__monto-valor small {
  font-size: .5em;
  font-weight: 800;
  margin-right: .12em;
  vertical-align: .55em;
}

.bienvenida__texto {
  margin: 0;
  font-size: .98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .95);
}
.bienvenida__texto strong { color: var(--dorado); }

.bienvenida__lema {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .28);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .01em;
  color: #fff;
}

/* ---------- Tablet (>= 768px) ---------- */
@media (min-width: 768px) {
  .portal-top { padding: 0 20px; }
  .portal-top__logo img { max-height: 64px; }
  .portal-top__logo img.logo-bicentenario { max-height: 76px; }

  .hero__inner {
    max-width: 640px;
    padding-bottom: 40px;
    gap: 20px;
  }
  .consulta-card { padding: 32px 36px 30px; }
  .consulta-card__titulo { font-size: 1.7rem; }
  .consulta-card__sub { font-size: 1.05rem; }

  .bienvenida { padding: 24px 28px 22px; gap: 16px; }
  .bienvenida__monto-valor { font-size: 3.1rem; }
  .bienvenida__texto { font-size: 1.05rem; }
  .bienvenida__lema { font-size: 1.15rem; }
}

/* ---------- Laptop y escritorio (>= 992px): imagen a pantalla completa ---------- */
@media (min-width: 992px) {
  .portal-top { padding: 0 24px; }
  .portal-top__logo img { max-height: 76px; }
  .portal-top__logo img.logo-bicentenario { max-height: 90px; }

  /* La tarjeta se coloca sobre la zona libre (tercio derecho) de la imagen:
     el texto de la imagen llega hasta ~64% del ancho, la tarjeta empieza en ~67%. */
  .consulta-card { padding: 26px 26px 22px; }
  .consulta-card__titulo { font-size: 1.55rem; }

  /* Mensaje de bienvenida SOBRE la imagen, sin recuadro */
  .bienvenida {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    justify-self: start;
    width: 100%;
    max-width: 640px;
    flex-direction: row;
    align-items: stretch;
    gap: 22px;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  }
  .bienvenida::after { display: none; }

  .bienvenida__monto {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding-right: 22px;
    border-right: 3px solid var(--dorado);
  }
  .bienvenida__monto-label { font-size: .72rem; }
  .bienvenida__monto-valor { font-size: 3.4rem; }

  .bienvenida__cuerpo { align-self: center; }
  .bienvenida__texto { font-size: .98rem; line-height: 1.5; color: #fff; }
  .bienvenida__lema {
    margin-top: 10px;
    padding-top: 0;
    border-top: 0;
    font-size: 1.15rem;
    color: var(--dorado);
  }
}

/* Pantallas grandes (>= 1400px) */
@media (min-width: 1400px) {
  .consulta-card { padding: 36px 34px 30px; }
  .consulta-card__titulo { font-size: 1.6rem; }
  .bienvenida { max-width: 700px; }
  .bienvenida__monto-valor { font-size: 3.9rem; }
  .bienvenida__texto { font-size: 1.08rem; }
  .bienvenida__lema { font-size: 1.3rem; }
}

/* Tablet y laptop pequeña (768px a 1199px): el texto va AL LADO del pescador,
   sobre la imagen. La imagen tiene alto fijo (--H) y se alinea a la izquierda,
   así el pescador ocupa ~77% de --H de ancho y el texto empieza justo después. */
@media (min-width: 768px) and (max-width: 1199px) {
  .hero__banner { --H: 500px; height: var(--H); }
  .hero__bg::after { display: none; }
  .hero__bg {
    height: var(--H);
    background-size: cover;
    background-position: left center;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .hero__texto {
    --t: min(52px, calc((100vw - var(--H) * .77 - 48px) / 9.8));
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: calc(var(--H) * .77 + 24px);
    right: 20px;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .hero__beneficio { margin-top: .22em; gap: .35em; }
  .hero__detalle { font-size: 15px; line-height: 1.38; margin-top: .35em; }
  .hero__detalle p { margin-bottom: .8em; }
}

/* Escritorio (>= 1200px): imagen completa, texto y tarjeta SOBRE la imagen.
   Todo escala con el ancho del banner (cqw), con tamaños mínimos legibles. */
@media (min-width: 1200px) {
  /* El banner ocupa todo el alto libre de la pantalla (debajo del encabezado) */
  .hero { position: relative; flex: 1 0 auto; }
  .hero__banner {
    container-type: inline-size;
    flex: 1 1 auto;
    min-height: max(36vw, 540px);   /* nunca más bajo que la imagen/texto */
  }
  .hero__bg::after { display: none; }
  .hero__bg {
    position: absolute;
    inset: 0;
    height: auto;
    background-size: cover;
    background-position: 12% center;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .hero__texto {
    --t: max(44px, 4.3cqw);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 27.6cqw;
    width: 40cqw;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .hero__beneficio { margin-top: .22em; gap: .35em; }
  .hero__detalle {
    margin-top: .35em;
    font-size: max(13px, .78cqw);
    line-height: 1.38;
  }
  .hero__detalle p { margin-bottom: .8em; }

  .hero__inner {
    position: absolute;
    top: 50%;
    right: 2.5vw;
    transform: translateY(-50%);
    width: clamp(280px, 29vw, 440px);
    max-width: none;
    margin: 0;
    padding: 0;
  }
}

/* Celulares muy pequeños (<= 360px) */
@media (max-width: 360px) {
  .consulta-card { padding: 20px 14px 18px; }
  .consulta-card__titulo { font-size: 1.15rem; }
  #dni_busqueda { font-size: 1.2rem; letter-spacing: .12em; }
  .consulta-card__botones .btn { font-size: .98rem; }
  .bienvenida { padding: 16px 16px 14px; }
  .bienvenida__monto-valor { font-size: 2.3rem; }
}


/* Respeta la preferencia de "reducir movimiento" */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Ventana de carga (blockUI): sin recuadro */
.blockMsg, .blockPage {
  background-color: transparent !important;
  border: transparent !important;
}

/* ---------- Celular (< 768px): portada con las proporciones del diseño móvil ----------
   Diseño de referencia: 512 x 845 px. Todo se mide en cqw (1cqw = 1% del ancho
   del banner), así que escala igual en cualquier celular. */
@media (max-width: 767px) {
  .hero { container-type: inline-size; }
  .hero__banner {
    min-height: 173cqw;                 /* 845/512 + 8cqw extra: baja al pescador para que la tarjeta no tape su gorro */
    background: linear-gradient(180deg, #1b5ad0 0%, #1a4cb8 40%, #17418f 100%);
  }
  .hero__bg {
    background:
      linear-gradient(180deg, #1a4cb8 0%, rgba(26, 76, 184, 0) 40%) left bottom / 100% 109cqw no-repeat,
      url("../images/fondo-sin-letras.jpg") -24cqw bottom / auto 109cqw no-repeat;
  }
  .hero__bg::after { display: none; }

  .hero__texto {
    --t: 9.6cqw;
    max-width: none;
    margin: 0;
    padding: 7.5cqw 5cqw 6cqw;
    text-align: center;
  }
  .hero__titulo { text-align: center; }

  .hero__beneficio,
  .hero__detalle { margin-left: 37.5cqw; text-align: left; }
  .hero__beneficio {
    display: block;
    margin-top: 56cqw;
    font-size: var(--t);
  }
  .hero__beneficio-label {
    display: block;
    font-size: max(11px, 3.1cqw);
    font-weight: 600;
    white-space: nowrap;
    margin-bottom: .6cqw;
  }
  .hero__beneficio-label br { display: none; }
  .hero__monto { display: block; font-size: 1.85em; line-height: 1; }
  .hero__detalle {
    margin-top: 3cqw;
    font-size: max(11px, 2.75cqw);
    line-height: 1.38;
    font-weight: 500;
  }
  .hero__detalle p { margin-bottom: 1.2em; }
}

/* ---------- Celular: el formulario de consulta va sobre la portada, entre el título y el monto ---------- */
@media (max-width: 767px) {
  .hero { position: relative; }
  .hero__inner {
    position: absolute;
    top: 33cqw;
    left: 10.5cqw;
    width: 79cqw;
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 0;
  }
  .consulta-card {
    padding: 4.2cqw 4.5cqw 4cqw;
    border-radius: 2.4cqw;
  }
  .consulta-card__titulo {
    font-size: max(12px, 3.3cqw);
    margin-bottom: 1cqw;
    letter-spacing: .01em;
  }
  .consulta-card__sub {
    font-size: max(9px, 2.3cqw);
    margin-bottom: 3.5cqw;
  }
  #dni_busqueda {
    height: 8.6cqw;
    min-height: 40px;
    font-size: 16px;                  /* evita el zoom automático en iOS */
    border-width: 1px;
    border-radius: 2.4cqw;
  }
  #dni_busqueda::placeholder { font-size: max(11px, 2.7cqw); }
  .consulta-card__botones { gap: 2.2cqw; margin-top: 2.6cqw; }
  .consulta-card__botones .btn {
    min-height: 8.6cqw;
    height: 8.6cqw;
    font-size: max(11px, 2.8cqw);
    border-radius: 2.4cqw;
  }
}

/* Celulares angostos: los mínimos de fuente y altura hacen la tarjeta más alta
   que en el diseño, así que se baja el bloque del monto para que no se tape. */
@media (max-width: 767px) and (max-width: 420px) {
  .hero__beneficio { margin-top: 66cqw; }
}
@media (max-width: 350px) {
  .hero__beneficio { margin-top: 72cqw; }
}
