/* ==========================================================
   Pantallas de acceso: iniciar_sesion.php, crear_cuenta_gratis.php, recuperar_acceso.php
   Estilos encapsulados bajo body.authTP (no modifica estilos globales).
   Misma línea visual que index.php (homeTP) y panel.php (pagePanel), incluido el modo oscuro
   (.darkMode en html y body, preferencia compartida en localStorage 'tpPanelTema').
   ========================================================== */

body.authTP{
  margin: 0px;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #fafafa;
  /* Luces suaves con los colores de la marca (reemplazan el degradé animado) */
  background-image:
    radial-gradient(55% 45% at 0% 0%, rgba(63, 81, 181, .10), transparent 70%),
    radial-gradient(45% 40% at 100% 0%, rgba(180, 0, 159, .07), transparent 70%),
    radial-gradient(50% 40% at 100% 100%, rgba(255, 152, 0, .08), transparent 70%);
  background-attachment: fixed;
  color: #111;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.authTP a{
  color: #3f51b5;
  font-weight: 500;
  text-decoration: none;
}

.authTP a:hover{
  text-decoration: underline;
}

.authTP .btn:focus-visible,
.authTP a:focus-visible,
.authTP button:focus-visible{
  outline: 2px solid #3f51b5;
  outline-offset: 2px;
  box-shadow: none;
}

/* ---------- Estructura ---------- */

.authTP .authPage{
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0px max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
}

.authTP .authTop{
  width: 100%;
  max-width: 1152px;
  margin: 0px auto;
  min-height: 64px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.authTP .authBrand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
}

.authTP .authBrand:hover{
  text-decoration: none;
}

.authTP .authBrand img{
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.authTP .authBrand span{
  color: #757575;
  font-weight: 500;
}

.authTP .authThemeToggle{
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 17px;
  transition: background-color .15s ease;
}

.authTP .authThemeToggle:hover{
  background-color: rgba(0, 0, 0, .05);
}

.authTP .authMain{
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0px 32px 0px;
}

.authTP .authFoot{
  padding: 8px 0px 24px 0px;
  text-align: center;
  font-size: 13px;
  color: #9e9e9e;
}

.authTP .authFoot a{
  color: #757575;
  font-weight: 400;
}

/* ---------- Tarjeta ---------- */

.authTP .authCard{
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
  background-color: #fff;
  border: 1px solid #ececec;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .06);
}

.authTP .authCardLoading{
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.authTP .authHead{
  margin-bottom: 28px;
  text-align: center;
}

.authTP .authTitle{
  margin: 0px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #111;
}

.authTP .authSub{
  margin: 10px 0px 0px 0px;
  font-size: 15px;
  line-height: 1.5;
  color: #5f6368;
  overflow-wrap: anywhere;
}

.authTP .authSub b{
  color: #111;
  font-weight: 700;
}

/* Ícono redondo arriba del título */
.authTP .authIcon{
  width: 64px;
  height: 64px;
  margin: 0px auto 20px auto;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background-color: #eef0fb;
  color: #3f51b5;
}

.authTP .authIconWp{
  background-color: #e7f8ee;
  color: #1faa59;
  font-size: 30px;
}

.authTP .authIconOk{
  background-color: #e7f8ee;
  color: #29822c;
}

.authTP .authIconAnim{
  animation: authPop .45s cubic-bezier(.2, .9, .3, 1.3) both;
}

@keyframes authPop {
  0%   { transform: scale(.6); opacity: 0; }
  100% { transform: scale(1);  opacity: 1; }
}

/* Entrada suave al cambiar de paso */
.authTP .authStep{
  animation: authFadeIn .25s ease both;
}

@keyframes authFadeIn {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0px); }
}

/* ---------- Campos con label flotante (mismo diseño que .floatField del panel) ----------
   Marcado: <div class="authField"><input class="form-control" placeholder="..."><label>…</label></div>
   El estado "con valor" sale de :placeholder-shown, así funciona también con .val() */

.authTP .authField{
  position: relative;
  margin-top: 14px;
}

.authTP .authField:first-child{
  margin-top: 0px;
}

.authTP .authField > .form-control{
  display: block;
  width: 100%;
  height: 56px;
  padding: 24px 14px 7px 14px;
  border: solid 1px #e0e0e0;
  border-radius: 14px;
  background-color: #fff;
  color: #111;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.authTP .authField > .form-control:hover{
  border-color: #c9c9c9;
}

.authTP .authField > .form-control:focus{
  border-color: #111;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .06);
  outline: none;
}

.authTP .authField > .form-control:not(:focus)::placeholder{
  color: transparent;
}

.authTP .authField > .form-control:focus::placeholder{
  color: #bdbdbd;
}

/* Autocompletado del navegador: sin fondo amarillo */
.authTP .authField > .form-control:-webkit-autofill{
  -webkit-box-shadow: 0 0 0 40px #fff inset;
  -webkit-text-fill-color: #111;
}

.authTP .authField > label{
  position: absolute;
  top: 28px;
  left: 15px;
  z-index: 2;
  max-width: calc(100% - 30px);
  margin: 0px;
  overflow: hidden;
  color: #9e9e9e;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
  transform: translateY(-50%);
  transition: top .15s ease, font-size .15s ease, color .15s ease;
}

.authTP .authField > .form-control:focus + label,
.authTP .authField > .form-control:not(:placeholder-shown) + label,
.authTP .authField > .form-control:-webkit-autofill + label{
  top: 16px;
  color: #757575;
  font-size: 12px;
  font-weight: 500;
}

.authTP .authField > .form-control:focus + label{
  color: #333;
}

/* Dos campos en una fila (ej.: Nombre / Apellido) */
.authTP .authRow2{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.authTP .authRow2:first-child{
  margin-top: 0px;
}

.authTP .authRow2 > .authField{
  margin-top: 0px;
}

@media only screen and (max-width: 360px) {
  .authTP .authRow2{
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

/* Contraseña con botón mostrar/ocultar */
.authTP .authPass > .form-control{
  padding-right: 52px;
}

.authTP .authEye{
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background-color: transparent;
  color: #9e9e9e;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}

.authTP .authEye:hover{
  background-color: #f3f3f3;
  color: #333;
}

/* Código de 6 dígitos */
.authTP .authField > .form-control.authCode{
  height: 68px;
  padding: 0px 14px;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .45em;
  text-indent: .45em;  /* compensa el espaciado del último dígito */
  font-variant-numeric: tabular-nums;
}

.authTP .authField > .form-control.authCode:not(:focus)::placeholder,
.authTP .authField > .form-control.authCode::placeholder{
  color: #d0d0d0;
  letter-spacing: .45em;
}

/* ---------- Requisitos de contraseña ---------- */

.authTP .authReqs{
  margin: 12px 0px 0px 0px;
  padding: 0px 4px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: #757575;
}

.authTP .authReqs li{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s ease;
}

.authTP .authReqs li i{
  font-size: 13px;
  color: #c4c4c4;
  transition: color .15s ease;
}

.authTP .authReqs li.authReqOk{
  color: #29822c;
}

.authTP .authReqs li.authReqOk i{
  color: #29822c;
}

/* ---------- Botones ---------- */

.authTP .authBtn{
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}

.authTP .authBtn + .authBtn{
  margin-top: 10px;
}

/* Bootstrap 5 deja el fondo transparente en :active si el botón no tiene variante */
.authTP .btn.btnPrimary:hover,
.authTP .btn.btnPrimary:active,
.authTP .btn.btnPrimary:focus{
  background-color: #3b3b3b;
  border-color: #3b3b3b;
  color: #fff;
}

.authTP .btn.btnPrimary:disabled{
  background-color: #000;
  border-color: #000;
  color: #fff;
  opacity: .7;
}

.authTP .btn.authBtnGhost{
  background-color: #f3f3f3;
  border-color: #f3f3f3;
  color: #111;
}

.authTP .btn.authBtnGhost:hover,
.authTP .btn.authBtnGhost:active{
  background-color: #e9e9e9;
  border-color: #e9e9e9;
  color: #111;
}

.authTP .btn.authBtnGhost:disabled{
  background-color: #f7f7f7;
  border-color: #f7f7f7;
  color: #9e9e9e;
  opacity: 1;
}

.authTP .authSpin{
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: authSpin .7s linear infinite;
}

.authTP .authCardLoading .authSpin{
  width: 28px;
  height: 28px;
  color: #9e9e9e;
}

@keyframes authSpin {
  100% { transform: rotate(360deg); }
}

/* ---------- Textos y links ---------- */

.authTP .authRowEnd{
  margin-top: 12px;
  text-align: right;
  font-size: 14px;
}

.authTP .authRowEnd a{
  display: inline-block;
  padding: 4px 2px;
}

.authTP .authAlt{
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #f0f0f0;
  text-align: center;
  font-size: 14px;
  color: #5f6368;
}

.authTP .authAlt a{
  display: inline-block;
  padding: 4px 2px;
}

.authTP .authNote{
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background-color: #fff7e6;
  color: #8a5a00;
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

.authTP .authNote i{
  margin-top: 2px;
}

.authTP .authNoteInfo{
  background-color: #eef0fb;
  color: #303f9f;
}

/* Paso del recupero: subtítulo de la sección "nueva contraseña" */
.authTP .authDivider{
  margin: 24px 0px 16px 0px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

/* ---------- Mensajes (fcn_showMessage) ---------- */

.authTP .msjConsoleItem{
  padding: 18px 44px 18px 20px;
  border-radius: 16px;
  line-height: 1.45;
  position: relative;
}

.authTP .msjConsoleClose{
  position: absolute;
  top: 10px;
  right: 10px;
  float: none;
  margin: 0px;
  padding: 0px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 15px;
}

.authTP .msjConsoleClose:hover{
  background-color: rgba(0, 0, 0, .06);
  color: inherit;
}

/* ---------- Mobile ---------- */

@media only screen and (max-width: 480px) {

  .authTP .authBrand span{
    display: none;
  }

  .authTP .authMain{
    align-items: flex-start;
    padding-top: 8px;
  }

  .authTP .authCard{
    padding: 28px 20px;
    border-radius: 20px;
  }

  .authTP .authHead{
    margin-bottom: 24px;
  }

  .authTP .authTitle{
    font-size: 23px;
  }

  /* 16px evita el zoom automático de iOS al enfocar */
  .authTP .authField > .form-control{
    font-size: 16px;
  }

  .authTP .authField > .form-control.authCode{
    font-size: 26px;
    letter-spacing: .35em;
    text-indent: .35em;
  }

}

@media (prefers-reduced-motion: reduce) {
  .authTP .authStep,
  .authTP .authIconAnim{
    animation: none;
  }
}

/* =====================================================================
   MODO OSCURO (mismos tonos que panel.php)
   Fondo #121214 · Superficie #1c1c1f · Superficie 2 #26262a · Borde #2c2c31
   Texto #e8e8ea · Secundario #a1a1aa · Acento #8c9eff
   ===================================================================== */

html.darkMode{
  color-scheme: dark;
  background-color: #121214;
}

html.darkMode ::-webkit-scrollbar-track-piece{
  background-color: #121214;
}

html.darkMode ::-webkit-scrollbar-thumb{
  background-color: #4a4a52;
}

body.authTP.darkMode{
  background-color: #121214;
  background-image:
    radial-gradient(55% 45% at 0% 0%, rgba(140, 158, 255, .10), transparent 70%),
    radial-gradient(45% 40% at 100% 0%, rgba(180, 0, 159, .08), transparent 70%),
    radial-gradient(50% 40% at 100% 100%, rgba(255, 152, 0, .05), transparent 70%);
  color: #e8e8ea;
}

.authTP.darkMode a{
  color: #8c9eff;
}

.authTP.darkMode .btn:focus-visible,
.authTP.darkMode a:focus-visible,
.authTP.darkMode button:focus-visible{
  outline-color: #8c9eff;
}

.authTP.darkMode .authBrand{
  color: #e8e8ea;
}

.authTP.darkMode .authBrand img{
  box-shadow: 0 0 0 1px #34343a;
}

.authTP.darkMode .authBrand span,
.authTP.darkMode .authFoot a{
  color: #a1a1aa;
}

.authTP.darkMode .authFoot{
  color: #6b6b74;
}

.authTP.darkMode .authThemeToggle{
  color: #ffd54f;
}

.authTP.darkMode .authThemeToggle:hover{
  background-color: #26262a;
}

.authTP.darkMode .authCard{
  background-color: #1c1c1f;
  border-color: #2c2c31;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

.authTP.darkMode .authTitle,
.authTP.darkMode .authSub b,
.authTP.darkMode .authDivider{
  color: #e8e8ea;
}

.authTP.darkMode .authSub,
.authTP.darkMode .authAlt{
  color: #a1a1aa;
}

.authTP.darkMode .authAlt,
.authTP.darkMode .authDivider{
  border-top-color: #2c2c31;
}

.authTP.darkMode .authIcon{
  background-color: #262a45;
  color: #8c9eff;
}

.authTP.darkMode .authIconWp,
.authTP.darkMode .authIconOk{
  background-color: #1d3326;
  color: #5fd38d;
}

.authTP.darkMode .authField > .form-control{
  background-color: #1c1c1f;
  border-color: #3a3a40;
  color: #e8e8ea;
}

.authTP.darkMode .authField > .form-control:hover{
  border-color: #4a4a52;
}

.authTP.darkMode .authField > .form-control:focus{
  border-color: #e8e8ea;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .08);
}

.authTP.darkMode .authField > .form-control:focus::placeholder,
.authTP.darkMode .authField > .form-control.authCode::placeholder{
  color: #5c5c66;
}

.authTP.darkMode .authField > .form-control:-webkit-autofill{
  -webkit-box-shadow: 0 0 0 40px #1c1c1f inset;
  -webkit-text-fill-color: #e8e8ea;
}

.authTP.darkMode .authField > label{
  color: #8a8a93;
}

.authTP.darkMode .authField > .form-control:focus + label,
.authTP.darkMode .authField > .form-control:not(:placeholder-shown) + label,
.authTP.darkMode .authField > .form-control:-webkit-autofill + label{
  color: #a1a1aa;
}

.authTP.darkMode .authField > .form-control:focus + label{
  color: #d4d4d8;
}

.authTP.darkMode .authEye{
  color: #8a8a93;
}

.authTP.darkMode .authEye:hover{
  background-color: #26262a;
  color: #e8e8ea;
}

.authTP.darkMode .authReqs{
  color: #a1a1aa;
}

.authTP.darkMode .authReqs li i{
  color: #4a4a52;
}

.authTP.darkMode .authReqs li.authReqOk,
.authTP.darkMode .authReqs li.authReqOk i{
  color: #5fd38d;
}

.authTP.darkMode .btn.btnPrimary,
.authTP.darkMode .btn.btnPrimary:disabled{
  background-color: #f2f2f4;
  border-color: #f2f2f4;
  color: #111;
}

.authTP.darkMode .btn.btnPrimary:hover,
.authTP.darkMode .btn.btnPrimary:active,
.authTP.darkMode .btn.btnPrimary:focus{
  background-color: #d9d9de;
  border-color: #d9d9de;
  color: #111;
}

.authTP.darkMode .btn.authBtnGhost{
  background-color: #26262a;
  border-color: #26262a;
  color: #e8e8ea;
}

.authTP.darkMode .btn.authBtnGhost:hover,
.authTP.darkMode .btn.authBtnGhost:active{
  background-color: #2e2e33;
  border-color: #2e2e33;
  color: #e8e8ea;
}

.authTP.darkMode .btn.authBtnGhost:disabled{
  background-color: #222226;
  border-color: #222226;
  color: #6b6b74;
}

.authTP.darkMode .authNote{
  background-color: #33291a;
  color: #f5c46b;
}

.authTP.darkMode .authNoteInfo{
  background-color: #262a45;
  color: #b3c0ff;
}

.authTP.darkMode .msjConsoleItem{
  background-color: rgba(38, 38, 42, .92);
  color: #e8e8ea;
}

/* Los tipos E/S/W usan fondos claros con !important: en oscuro se reemplazan por tonos oscuros */
.authTP.darkMode .msjConsoleItem.bgColorRojoTransparencia{
  background-color: rgba(74, 32, 32, .94) !important;
  border-color: rgba(74, 32, 32, .94) !important;
}

.authTP.darkMode .msjConsoleItem.bgColorVerdeTransparencia{
  background-color: rgba(29, 51, 38, .94) !important;
  border-color: rgba(29, 51, 38, .94) !important;
}

.authTP.darkMode .msjConsoleItem.bgColorNaranjaTransparencia{
  background-color: rgba(51, 41, 26, .94) !important;
  border-color: rgba(51, 41, 26, .94) !important;
}

.authTP.darkMode .msjConsoleClose:hover{
  background-color: rgba(255, 255, 255, .08);
}
