/**
 * gesti-login.css — Pantallas de acceso (login, recuperar clave, crear clave).
 * Opción 4 "Tarjeta con sello" (15-oct-2026): una sola tarjeta que une las dos marcas.
 *   Arriba el logo completo del cliente (protagonista); al pie, dentro de la misma
 *   tarjeta, el sello GESTI: franja violeta con "Operado por" + logo gesti.ar.
 *   Celular: la tarjeta ocupa toda la pantalla y el sello queda al pie.
 * Colores y fuentes: gesti-tokens.css (cargarlo antes). Anula bootstrap 2 / beautyadmin.
 */
.gl {
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--gray-50);
    color: var(--gray-900);
    font-family: var(--font-ui);
    font-size: var(--fs-14);
    line-height: var(--lh);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    accent-color: var(--brand-500);
}
.gl *, .gl *::before, .gl *::after { box-sizing: border-box; }
.gl :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

/* ---- Tarjeta ---- */
.gl-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.gl-card {
    width: 100%;
    max-width: 400px;
    background: var(--gray-0);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.gl-cuerpo { padding: 36px 32px 28px; }

/* ---- Sello GESTI (pie de la tarjeta) ---- */
.gl-sello {
    background: var(--brand-500);
    color: var(--on-brand);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 72px;
    padding: 12px 24px calc(14px + env(safe-area-inset-bottom));
}
.gl-sello-txt { font-size: 11px; letter-spacing: .04em; color: var(--on-brand-70); line-height: 1; }
.gl-sello .g-logo { font-size: 24px; line-height: 1; }

/* ---- Identidad del cliente: logo completo arriba ---- */
.gl-brand { text-align: center; margin-bottom: 28px; }
.gl-cliente { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 18px; }
.gl-logo { display: flex; align-items: center; justify-content: center; height: 88px; max-width: 280px; margin: 0 auto; }
.gl-logo img { max-height: 88px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.gl-cliente.gl-con-logo .gl-empresa { display: none; }   /* el logo ya dice quién es */
.gl-mono {
    width: 64px; height: 64px; border-radius: 16px;
    background: var(--gray-50); border: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 600; letter-spacing: .02em; color: var(--gray-700);
}
.gl-empresa { font-size: var(--fs-16); font-weight: 600; color: var(--gray-900); margin: 0; line-height: 1.3; }
.gl-titulo { font-size: var(--fs-14); font-weight: 400; line-height: 1.4; margin: 0; color: var(--gray-500); }

/* Avisos de bloque (sesión expirada, recuperar / crear clave) */
.gl-alert { display: none; border-radius: var(--radius-control); padding: 8px 12px; font-size: var(--fs-14); margin: 0 0 16px; }
.gl-alert b { font-weight: 600; display: block; }
.gl-alert.warning { background: var(--warning-bg); color: var(--warning); }
.gl-alert.error   { background: var(--danger-bg); color: var(--danger); }
.gl-alert.ok      { background: var(--success-bg); color: var(--success); }

/* Error inline bajo el campo */
.gl-field-err { display: none; margin: 4px 0 0; font-size: var(--fs-13); color: var(--danger); }

/* Form — anula estilos de bootstrap 2 / beautyadmin */
.gl form { width: auto; margin: 0; float: none; }
.gl-field { margin: 0 0 16px; }
.gl-label { display: block; font-size: var(--fs-13); font-weight: 500; color: var(--gray-700); margin: 0 0 4px; }
.gl .gl-input {
    display: block;
    width: 100%;
    height: var(--control-h-lg);
    margin: 0;
    padding: 0 12px;
    font: inherit;
    font-size: 16px; /* 16px evita el zoom automático de iOS; en escritorio baja a 14 */
    color: var(--gray-900);
    background: var(--gray-0);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-control);
    box-shadow: none;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
}
.gl .gl-input:hover { border-color: var(--gray-300); }
.gl .gl-input::placeholder { color: var(--gray-400); }
.gl .gl-input:focus,
.gl .gl-input:focus:invalid,
.gl .gl-input:focus:invalid:focus { border-color: var(--brand-500); color: var(--gray-900); box-shadow: inset 0 0 0 1px var(--brand-500); outline: none; } /* una sola línea */
.gl .gl-input[aria-invalid="true"] { border-color: var(--danger); }
.gl-pass { position: relative; }
.gl .gl-pass .gl-input { padding-right: 44px; }
.gl-eye {
    position: absolute;
    top: 0; right: 0;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: 0; background: none; margin: 0; padding: 0;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 0 var(--radius-control) var(--radius-control) 0;
}
.gl-eye:hover, .gl-eye[aria-pressed="true"] { color: var(--gray-700); }
.gl-eye svg { width: 18px; height: 18px; }
.gl-caps { display: none; font-size: var(--fs-12); color: var(--warning); margin: 4px 0 0; }

.gl .gl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: var(--control-h-lg);
    margin: 24px 0 0;
    border: 1.5px solid var(--brand-500);
    border-radius: var(--radius-control);
    background: var(--gray-0);
    color: var(--brand-600);
    font: inherit;
    font-size: var(--fs-14);
    font-weight: 600;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.gl .gl-btn:hover { background: var(--brand-50); border-color: var(--brand-600); color: var(--brand-700); }
.gl .gl-btn:active { background: var(--brand-100); border-color: var(--brand-700); color: var(--brand-700); }
.gl .gl-btn[aria-busy="true"] { background: var(--brand-50); cursor: progress; }
.gl .gl-btn:disabled { opacity: 1; }
.gl-spin {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid var(--brand-200);
    border-top-color: var(--brand-600);
    border-radius: 50%;
    animation: gl-spin .7s linear infinite;
}
.gl-btn[aria-busy="true"] .gl-spin { display: block; }
@keyframes gl-spin { to { transform: rotate(360deg); } }

.gl-forgot {
    display: block;
    width: fit-content;
    margin: 16px auto 0;
    padding: 4px;
    font-size: var(--fs-14);
    color: var(--brand-600);
    text-decoration: none;
}
.gl-forgot:hover, .gl-forgot:focus { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }

/* Texto y avisos extra (recuperar / crear clave) */
.gl-text { font-size: var(--fs-14); color: var(--gray-500); margin: -12px 0 24px; text-align: center; }
.gl-text b { color: var(--gray-900); font-weight: 600; }
.gl-hint { font-size: var(--fs-12); color: var(--gray-500); margin: 4px 0 0; }
.gl .gl-btn.done { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.gl-back {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: var(--fs-14); color: var(--gray-500); text-decoration: none;
    margin: 0 0 24px; padding: 4px 0;
}
.gl-back:hover, .gl-back:focus { color: var(--gray-900); }
.gl-back svg { width: 16px; height: 16px; }
.gl a.gl-btn { text-decoration: none; }
/* Páginas standalone (sin el header de bootstrap) */
body.gl-body { margin: 0; background: var(--gray-50); }

/* ---- Celular: la tarjeta es la pantalla; el sello queda al pie ---- */
@media (max-width: 519px) {
    .gl { background: var(--gray-0); }
    .gl-main { padding: 0; justify-content: stretch; align-items: stretch; }
    .gl-card { max-width: none; flex: 1; border: 0; border-radius: 0; }
    .gl-cuerpo { flex: 1; padding: 40px 24px 28px; display: flex; flex-direction: column; justify-content: center; }
    .gl-sello { min-height: 68px; }
}
@media (min-width: 900px) {
    .gl .gl-input { font-size: var(--fs-14); }
}
/* Celulares con poca altura (o teclado abierto) */
@media (max-height: 620px) and (max-width: 519px) {
    .gl-cuerpo { padding-top: 24px; justify-content: flex-start; }
    .gl-logo, .gl-logo img { height: auto; max-height: 56px; }
    .gl-brand { margin-bottom: 18px; }
    .gl-sello { min-height: 56px; padding-top: 10px; }
    .gl-sello .g-logo { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .gl * { transition: none !important; animation-duration: 1.5s !important; }
}
