/* app/public/css/auth.css — lote entrada: pantallas de entrada (region:auth, region:reset).
   Sobre base.css (kit). Maqueta: mockups/app/entrada.html. Prefijo .ent-. */

/* Marco: cabecera de la web (68 px) + escena de la ballena + formulario + pie */
.ent {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr); /* las pestañas nunca ensanchan la página */
  min-height: 100vh;
  min-height: 100dvh;
  background: rgb(var(--c-bg));
}
.ent .skip-link { position: absolute; }

.ent-top { position: relative; z-index: 3; background: rgb(var(--c-bg)); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.ent-top > .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.ent-top .appbar__brand { gap: 11px; }
.ent-top .appbar__name { display: inline; font-size: 24px; }
.ent-top .appbar__mark { width: 32px; height: 32px; }

.ent-main { position: relative; display: flex; align-items: center; min-height: 0; overflow: clip; }
.ent-scene { position: absolute; top: 0; right: 0; bottom: 0; width: min(66%, 1120px); margin: 0; }
.ent-scene img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 78% 50%; }
/* velo de legibilidad (el único degradado permitido), como en la portada */
.ent-scene::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgb(var(--c-bg)) 0%, rgb(var(--c-bg) / 0.72) 18%, rgb(var(--c-bg) / 0) 46%);
}
.ent-credit {
  position: absolute; z-index: 2; right: 16px; bottom: 16px;
  padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: rgb(var(--c-bg) / 0.78); color: rgb(var(--c-soft));
  font: 500 var(--fs-xs) / 1.2 var(--font-sans);
}
.ent-col { position: relative; z-index: 2; width: 100%; padding-block: 48px; }
.ent-form { width: min(100%, 400px); }
.ent-form:focus { outline: none; }

/* Pestañas: .tabs de la web; la clase .tab es hook del JS (showTab) */
.ent-tabs { margin-bottom: 24px; }
.ent-back {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); margin: 0 0 12px; padding: 0;
  background: none; border: 0; cursor: pointer; text-decoration: none; font: 500 var(--fs-ui) / 1.2 var(--font-sans);
}
.ent-back:hover { text-decoration: underline; text-decoration-color: rgb(var(--c-coral) / 0.7); text-underline-offset: 4px; }
.ent-title { font: 600 var(--fs-h3) / 1.15 var(--font-serif); letter-spacing: -0.01em; }
.ent-sub { margin-top: 8px; color: rgb(var(--c-soft)); font-size: var(--fs-ui); line-height: 1.5; }
.ent-body { margin-top: 24px; }
.ent-body > form { display: flex; flex-direction: column; gap: 16px; }
.ent-body > form > .btn { margin-top: 8px; }
.ent-body .fgroup + .fgroup { margin-top: 0; }
.ent-body > .btn { margin-top: 0; }

/* Contraseña con botón de ver (PROPUESTA ver-contrasena) */
.ent-pw { position: relative; }
.ent-pw > .field { padding-right: 52px; }
.ent-pw__toggle { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); color: rgb(var(--c-muted)); }

/* Mensaje del formulario: authMsg() escribe className = 'msg' + ' ok|err' */
.ent .msg { min-height: 0; margin-top: 12px; font-size: var(--fs-small); line-height: 1.45; color: rgb(var(--c-soft)); }
.ent .msg:empty { display: none; }
.ent .msg.err { color: rgb(var(--c-warn)); }
.ent .msg.ok { color: rgb(var(--c-live)); }

.ent-aux { margin-top: 12px; color: rgb(var(--c-soft)); font-size: var(--fs-small); line-height: 1.5; }
.ent-aux b { color: rgb(var(--c-text)); font-weight: 600; }
.ent-aux .link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0; background: none; border: 0; cursor: pointer; font: inherit; }
.ent-notice { margin-top: 16px; }

/* Google (routes/oauth.js): «o» + botón de línea a todo el ancho */
.ent-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: rgb(var(--c-muted)); font-size: var(--fs-small); }
.ent-or::before, .ent-or::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line-2); }
.ent-google { gap: 12px; }
.ent-google .g { width: 18px; height: 18px; flex: none; }

/* Pie */
.ent-foot { position: relative; z-index: 3; border-top: 1px solid var(--line); background: rgb(var(--c-bg)); padding-bottom: env(safe-area-inset-bottom, 0px); }
.ent-foot > .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 56px; padding-block: 10px; color: rgb(var(--c-muted)); font-size: var(--fs-xs); }
.ent-foot a { display: inline-flex; align-items: center; min-height: 36px; color: rgb(var(--c-muted)); font-weight: 400; text-underline-offset: 3px; }
.ent-foot a:hover { color: rgb(var(--c-text)); }
.ent-foot__links { display: flex; flex-wrap: wrap; gap: 0 16px; }
@media (pointer: coarse) { .ent-foot a { min-height: var(--tap); } }

/* 641–1039: franja de escena arriba, formulario centrado */
@media (max-width: 1039.98px) {
  .ent-main { flex-direction: column; align-items: stretch; }
  .ent-scene { position: relative; width: 100%; height: 220px; flex: none; }
  .ent-scene img { object-position: 70% 42%; }
  .ent-scene::before { background: linear-gradient(0deg, rgb(var(--c-bg)) 0%, rgb(var(--c-bg) / 0) 55%); }
  .ent-credit { right: 12px; bottom: 10px; }
  .ent-col { padding-block: 24px 40px; }
  .ent-form { margin-inline: auto; }
}
@media (max-width: 819.98px) {
  .ent-top > .wrap { height: 56px; }
  .ent-top .appbar__name { font-size: 21px; }
  .ent-top .appbar__mark { width: 28px; height: 28px; }
}
@media (max-width: 640.98px) {
  .ent-scene { height: 140px; }
  .ent-credit { padding: 4px 8px; font-size: 12px; }
  .ent-tabs { margin-bottom: 20px; }
  .ent-tabs [role='tab'] { padding-inline: 10px; } /* tres pestañas (beta cerrada) caben a 360 px */
  .ent-body { margin-top: 20px; }
}
/* teclado abierto (resizes-content): la franja se va y el formulario queda entero */
@media (max-height: 560px) and (max-width: 1039.98px) { .ent-scene { display: none; } }
