/* ============================================================================
 *  Yalibis Drive — assets/css/auth.css
 *  Pantallas públicas (login, sesión expirada, recuperar contraseña).
 *  Réplica 1:1 de Destrezas/login.php y sesion_expirada.php: mismos valores de
 *  color, medidas y componentes (.dz-field, .dz-tabs-seg, .dz-pin-*). Los
 *  tokens se fijan en .yd-lg para que se vea igual que en Destrezas aunque el
 *  resto de la aplicación use tokens propios con contraste AA.
 * ============================================================================ */

.yd-lg {
  --bg: #F4F6FA; --surface: #FFFFFF; --text: #1F2937; --text2: #6B7280;
  --border: #EAECEF; --hover: #F4F6FA; --teal: #0DCAA8; --teal-2: #00B894; --danger: #EF4444;
  min-height: 100vh; min-height: 100dvh; display: flex;
  background: var(--bg); color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
[data-theme="dark"] .yd-lg {
  --bg: #0B1220; --surface: #16213E; --text: #F1F5F9; --text2: #94A3B8;
  --border: #243049; --hover: #1E2A45;
}
body.yd-lg-body { background: var(--bg); }

/* ---- Panel de marca ----------------------------------------------------------- */
.yd-lg-brand {
  width: 46%; max-width: 620px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #16213E 0%, #1B2A4A 55%, #0E5C4F 130%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 46px 48px;
}
.yd-lg-circ { position: absolute; border-radius: 50%; }
.yd-lg-circ.a { right: -80px; top: -60px; width: 280px; height: 280px; background: rgba(13,202,168,.16); animation: flo 7s ease-in-out infinite; }
.yd-lg-circ.b { left: -60px; bottom: 40px; width: 200px; height: 200px; background: rgba(13,202,168,.1); animation: flo 9s ease-in-out infinite; }
@keyframes flo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.yd-lg-marca { position: relative; display: flex; align-items: center; gap: 13px; }
.yd-lg-marca img { width: 74px; height: 48px; object-fit: contain; display: block; }
.yd-lg-marca .n { color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.3px; line-height: 1.1; }
.yd-lg-marca .s { color: #0DCAA8; font-weight: 700; font-size: 10px; line-height: 1.25; letter-spacing: .7px; text-transform: uppercase; }
.yd-lg-hero { position: relative; }
.yd-lg-hero h2 { margin: 0 0 14px; color: #fff; font-size: 33px; font-weight: 800; line-height: 1.18; letter-spacing: -.6px; }
.yd-lg-hero h2 span { color: #0DCAA8; }
.yd-lg-hero p { margin: 0 0 28px; color: #AEB8CC; font-size: 14.5px; line-height: 1.6; max-width: 380px; }
.yd-lg-lista { display: flex; flex-direction: column; gap: 13px; }
.yd-lg-item { display: flex; align-items: center; gap: 12px; color: #E8ECF4; font-size: 13.5px; font-weight: 600; }
.yd-lg-item i {
  width: 30px; height: 30px; border-radius: 9px; background: rgba(13,202,168,.18); color: #0DCAA8;
  display: flex; align-items: center; justify-content: center; flex: 0 0 30px;
}
.yd-lg-pie { position: relative; color: #8FA0C0; font-size: 12px; }

/* ---- Panel de formulario ---------------------------------------------------------- */
.yd-lg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 24px; }
.yd-lg-top { display: flex; justify-content: flex-end; gap: 8px; }
.yd-lg-icono {
  width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 17px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; font-family: inherit; padding: 0;
}
.yd-lg-icono.txt { font-size: 13px; }
.yd-lg-centro { flex: 1; display: flex; align-items: center; justify-content: center; }
.yd-lg-caja { width: 100%; max-width: 400px; }
.yd-lg-caja.centrado { text-align: center; }
.yd-lg-cab { margin-bottom: 28px; }
.yd-lg-cab .m { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.yd-lg-cab .m img { width: 58px; height: 38px; object-fit: contain; display: block; }
.yd-lg-cab .m span { font-weight: 800; font-size: 16px; color: var(--text); text-transform: uppercase; }
.yd-lg-cab h1 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.yd-lg-cab p { margin: 7px 0 0; font-size: 14px; color: var(--text2); }

.yd-lg-error {
  display: flex; align-items: center; gap: 10px; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3);
  color: #EF4444; font-size: 13px; font-weight: 600; padding: 11px 14px; border-radius: 12px; margin-bottom: 16px;
}
.yd-lg-error[hidden] { display: none; }
.yd-lg-info {
  display: flex; align-items: center; gap: 10px; background: rgba(14,165,233,.12); border: 1px solid rgba(14,165,233,.3);
  color: var(--text); font-size: 13px; font-weight: 600; padding: 11px 14px; border-radius: 12px; margin-bottom: 16px;
}
.yd-lg-ok {
  display: flex; align-items: center; gap: 10px; background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3);
  color: var(--text); font-size: 13px; font-weight: 600; padding: 11px 14px; border-radius: 12px; margin-bottom: 16px;
}

.yd-lg-form { display: flex; flex-direction: column; gap: 15px; }
.yd-lg-form label.l { font-size: 12.5px; font-weight: 700; color: var(--text); }
.yd-lg-link { font-size: 12.5px; font-weight: 700; color: #0DCAA8; text-decoration: none; }
.yd-lg-link:hover { text-decoration: underline; }
.yd-lg-recordar { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text2); }
.yd-lg-recordar input { width: 16px; height: 16px; accent-color: #0DCAA8; }
.yd-lg-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(135deg, #0DCAA8, #00B894); color: #fff; border: none; cursor: pointer; text-decoration: none;
  font-family: inherit; font-weight: 800; font-size: 15px; padding: 14px; border-radius: 13px;
  box-shadow: 0 10px 22px rgba(13,202,168,.34);
}
.yd-lg-btn:hover { color: #fff; filter: brightness(1.03); }
.yd-lg-btn:disabled { opacity: .65; cursor: not-allowed; }
.yd-lg-sub { text-align: center; margin: 26px 0 0; font-size: 13.5px; color: var(--text2); }
.yd-lg-sub a { font-weight: 800; color: #0DCAA8; text-decoration: none; }
.yd-lg-ayuda {
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 13px; color: var(--text2);
}
.yd-lg-aviso {
  width: 74px; height: 74px; border-radius: 20px; background: rgba(239,68,68,.13); color: #EF4444;
  display: flex; align-items: center; justify-content: center; font-size: 34px; margin: 0 auto 22px;
}
.yd-lg-caja.centrado h1 { margin: 0 0 10px; font-size: 23px; font-weight: 800; letter-spacing: -.4px; line-height: 1.3; }
.yd-lg-caja.centrado p.t { margin: 0 0 28px; font-size: 14px; color: var(--text2); line-height: 1.6; }

/* ---- Campo con icono (.dz-field) y pestañas (.dz-tabs-seg) de Destrezas -------------------- */
.yd-lg .dz-field {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.yd-lg .dz-field:focus-within { border-color: var(--teal); }
.yd-lg .dz-field > i { color: var(--text2); font-size: 15px; }
.yd-lg .dz-field input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 14px; color: var(--text); box-shadow: none;
}
.yd-lg .dz-field button { border: none; background: transparent; color: var(--text2); cursor: pointer; font-size: 16px; padding: 0; }
.yd-lg .dz-field.tiene-error { border-color: var(--danger); }

.yd-lg .dz-tabs-seg { display: flex; gap: 4px; background: var(--hover); border: 1px solid var(--border); padding: 4px; border-radius: 12px; margin-bottom: 20px; }
.yd-lg .dz-tabs-seg button {
  flex: 1; padding: 9px 12px; border-radius: 9px; border: none; background: transparent;
  font-family: inherit; font-weight: 700; font-size: 13px; color: var(--text2); cursor: pointer;
}
.yd-lg .dz-tabs-seg button i { margin-right: 6px; }
.yd-lg .dz-tabs-seg button.on { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; }

/* ---- Acceso con PIN (cuadrícula de cuentas + teclado) -------------------------------------- */
.yd-lg .dz-pin-msg { text-align: center; font-size: 13px; color: var(--text2); padding: 18px 8px; grid-column: 1 / -1; }
.yd-lg .dz-pin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; max-height: min(58vh, 470px); overflow-y: auto; padding: 2px; }
.yd-lg .dz-pin-user {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 6px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-family: inherit; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.yd-lg .dz-pin-user:hover, .yd-lg .dz-pin-user:focus-visible { border-color: var(--teal); transform: translateY(-2px); outline: none; }
.yd-lg .dz-pin-av {
  width: 56px; height: 56px; border-radius: 16px; color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.yd-lg .dz-pin-name { font-size: 12.5px; font-weight: 700; line-height: 1.2; text-align: center; }
.yd-lg .dz-pin-rol { font-size: 10.5px; color: var(--text2); font-weight: 600; text-align: center; line-height: 1.2; }
.yd-lg .dz-pin-titulo { text-align: center; font-weight: 800; font-size: 17px; color: var(--text); }
.yd-lg .dz-pin-sub { text-align: center; font-size: 12.5px; color: var(--text2); margin-top: 3px; }
.yd-lg .dz-pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.yd-lg .dz-pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); transition: background .12s, border-color .12s; }
.yd-lg .dz-pin-dots span.on { background: var(--teal); border-color: var(--teal); }
.yd-lg .dz-pin-dots.error span { border-color: var(--danger); animation: dzshake .35s; }
.yd-lg .dz-pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 290px; margin: 0 auto; }
.yd-lg .dz-pin-pad button {
  height: 58px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  font-family: inherit; font-size: 22px; font-weight: 800; color: var(--text); cursor: pointer;
}
.yd-lg .dz-pin-pad button:hover { background: var(--hover); }
.yd-lg .dz-pin-pad button:active { transform: scale(.96); }
.yd-lg .dz-pin-pad button.muted { font-size: 15px; color: var(--text2); }
@keyframes dzshake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.yd-lg :focus-visible { outline: 3px solid #0A6FD6; outline-offset: 2px; }
[data-theme="dark"] .yd-lg :focus-visible { outline-color: #7CC0FF; }

@media (max-width: 880px) {
  .yd-lg-brand { display: none !important; }
  /* Evita el zoom automático de iOS al enfocar un campo (<16 px). */
  .yd-lg .dz-field input { font-size: 16px; }
}
@media (max-width: 380px) {
  .yd-lg-main { padding: 16px; }
  .yd-lg-cab h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .yd-lg-circ, .yd-lg .dz-pin-dots.error span { animation: none; }
}
