/*
 * Pantalla de acceso (login) — Greckpos
 * Ver doc/login/SPEC.md
 *
 * CSS propio, escrito a mano: el Tailwind del proyecto está purgado y no hay
 * pipeline de build, así que las utilidades tw-* nuevas no existirían (RN-01).
 * Todas las clases van prefijadas .gk-login-* para no colisionar con
 * AdminLTE / Bootstrap 3, que ya imponen estilos globales sobre body/input/label.
 */

/* ── Base ─────────────────────────────────────────────────────────── */

html,
body.gk-login-body {
    height: 100%;
}

/* Pace.js viene en vendor.js y pinta una barra de progreso y un spinner.
   En el login no aporta nada y se superpone al diseño. */
body.gk-login-body .pace {
    display: none;
}

body.gk-login-body {
    margin: 0;
    padding: 0;
    background: #f4f3f1;
    color: #1c1c1c;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.gk-login {
    display: flex;
    min-height: 100vh;
}

/* ── Panel izquierdo (marca) ──────────────────────────────────────── */

.gk-login-brand {
    width: 45%;
    background: #1c1c1c;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px;
    box-sizing: border-box;
}

.gk-login-brand-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gk-login-logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 10px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.gk-login-logo svg {
    width: 21px;
    height: 21px;
}

.gk-login-brand-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.gk-login-brand-sub {
    font-size: 12px;
    color: #8a8a8a;
    line-height: 1.4;
    margin-top: 1px;
}

.gk-login-brand-body {
    max-width: 600px;
}

.gk-login-headline {
    font-size: 33px;
    line-height: 1.2;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px;
    letter-spacing: -0.5px;
}

.gk-login-tagline {
    font-size: 14px;
    line-height: 1.75;
    color: #8a8a8a;
    margin: 0;
    max-width: 340px;
}

.gk-login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    color: #2563eb;
}

.gk-login-divider::before,
.gk-login-divider::after {
    content: "";
    height: 1px;
    background: #3a3a3a;
}

.gk-login-divider::before {
    width: 34px;
}

.gk-login-divider::after {
    width: 22px;
}

.gk-login-divider svg {
    width: 14px;
    height: 14px;
}

.gk-login-copyright {
    font-size: 12px;
    color: #6b6b6b;
    margin: 0;
}

/* ── Panel derecho (formulario) ───────────────────────────────────── */

.gk-login-main {
    width: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    box-sizing: border-box;
}

.gk-login-card {
    width: 100%;
    max-width: 380px;
}

.gk-login-title {
    font-size: 25px;
    font-weight: 700;
    color: #1c1c1c;
    margin: 0 0 6px;
    letter-spacing: -0.4px;
}

.gk-login-subtitle {
    font-size: 13px;
    color: #6b6b6b;
    margin: 0 0 28px;
}

.gk-login-field {
    margin-bottom: 16px;
}

.gk-login-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 12px;
}

.gk-login-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #1c1c1c;
    margin: 0 0 6px;
}

.gk-login-label-row .gk-login-label {
    margin-bottom: 0;
}

.gk-login-forgot {
    font-size: 12.5px;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}

.gk-login-forgot:hover,
.gk-login-forgot:focus {
    color: #1d4ed8;
    text-decoration: underline;
}

.gk-login-input-wrap {
    position: relative;
}

.gk-login-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    box-sizing: border-box;
    font-size: 14px;
    color: #1c1c1c;
    background: #fff;
    border: 1px solid #dcdad7;
    border-radius: 8px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

/* el campo de contraseña deja sitio al botón del ojo */
.gk-login-input--has-icon {
    padding-right: 44px;
}

.gk-login-input::placeholder {
    color: #a3a3a3;
}

.gk-login-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.gk-login-field.has-error .gk-login-input {
    border-color: #dc2626;
}

.gk-login-field.has-error .gk-login-input:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

.gk-login-error {
    display: block;
    font-size: 12px;
    color: #dc2626;
    margin-top: 5px;
}

/* Botón mostrar/ocultar contraseña */
.gk-login-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    color: #6b6b6b;
}

.gk-login-eye:hover {
    color: #1c1c1c;
}

.gk-login-eye:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.gk-login-eye svg {
    width: 19px;
    height: 19px;
    display: block;
}

/* Recordarme.
   Es un <label>, y Bootstrap 3 le impone font-weight:700 — se neutraliza aquí.
   El checkbox se dibuja a mano porque los estilos heredados de AdminLTE lo
   pintaban como un cuadro sólido. */
.gk-login-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 18px 0 22px;
    cursor: pointer;
    font-weight: 400;
}

.gk-login-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 16px;
    background: #fff;
    border: 1px solid #c9c6c2;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: background-color .12s ease, border-color .12s ease;
}

.gk-login-checkbox:checked {
    background-color: #2563eb;
    border-color: #2563eb;
    /* palomita blanca */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
}

.gk-login-checkbox:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.gk-login-remember-text {
    font-size: 13px;
    font-weight: 400;
    color: #3f3f3f;
}

/* Botón principal */
.gk-login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .15s ease;
}

.gk-login-submit:hover {
    background: #1d4ed8;
}

.gk-login-submit:active {
    background: #1e40af;
}

.gk-login-submit:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.gk-login-submit svg {
    width: 15px;
    height: 15px;
}

/* Separador con punto */
.gk-login-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 18px;
}

.gk-login-rule::before,
.gk-login-rule::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dcdad7;
}

.gk-login-rule span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid #c9c6c2;
}

.gk-login-foot {
    font-size: 12.5px;
    color: #6b6b6b;
    text-align: center;
    margin: 0;
}

.gk-login-foot strong {
    color: #2563eb;
    font-weight: 600;
}

/* reCAPTCHA (solo si está habilitado) */
.gk-login-recaptcha {
    margin-bottom: 16px;
}

/* Botones de acceso demo (solo en APP_ENV=demo) */
.gk-login-demo {
    margin-bottom: 20px;
    padding: 14px;
    background: #fff;
    border: 1px solid #dcdad7;
    border-radius: 8px;
}

.gk-login-demo p {
    font-size: 12px;
    color: #6b6b6b;
    margin: 0 0 10px;
}

/* ── Responsive: una sola columna, sin panel de marca ──────────────── */

@media (max-width: 991px) {
    .gk-login {
        display: block;
    }

    .gk-login-brand {
        display: none;
    }

    .gk-login-main {
        width: 100%;
        min-height: 100vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gk-login-input,
    .gk-login-submit {
        transition: none;
    }
}
