/* ============================================================
   GestiFalla — Login06
   Design system tokens + estilos pantalla de acceso PWA
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ---- Tokens ---- */
:root {
    --gf-primary:      #1558A8;
    --gf-accent:       #72C0E8;
    --gf-primary-dark: #0d3d7a;
    --gf-primary-soft: #EEF4FC;
    --gf-bg:           #f5f6f8;
    --gf-card:         #ffffff;
    --gf-border:       #e4e8ed;
    --gf-text:         #0d2a50;
    --gf-muted:        #8a9ab5;
    --gf-gold:         #FFD166;
    --gf-r-md:         12px;
    --gf-shadow-pop:   0 8px 28px rgba(13,42,80,0.16);
    --gf-font:         'Manrope', -apple-system, system-ui, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--gf-font);
    background: var(--gf-bg);
    color: var(--gf-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
}

/* ============================================================
   Layout principal
   ============================================================ */
.gf-screen {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Bloque azul superior */
.gf-login-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 200px;
    background: var(--gf-primary);
    z-index: 0;
}
.gf-login-top::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gf-accent);
}

/* Cuerpo centrado */
.gf-login-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 24px 40px;
    padding-top: max(env(safe-area-inset-top, 0px), 0px);
}

/* ============================================================
   Marca: logo + nombre app
   ============================================================ */
.gf-login-brand {
    text-align: center;
    margin-bottom: 28px;
    margin-top: 40px;
}

/* Recuadro blanco redondeado que enmarca el logo */
.gf-login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--gf-shadow-pop);
    margin-bottom: 14px;
    overflow: hidden;
}
.gf-login-icon img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    display: block;
}

/* Nombre de la app — negro fijo (visible sobre azul y sobre gris) */
.gf-login-logo {
    font-size: 26px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.gf-login-logo b {
    font-weight: 800;
    /* mismo negro — color único */
}

/* ============================================================
   Card del formulario
   ============================================================ */
.gf-card {
    background: var(--gf-card);
    border-radius: var(--gf-r-md);
    box-shadow: var(--gf-shadow-pop);
    padding: 24px 22px 22px;
}
.gf-card-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--gf-text);
    margin-bottom: 3px;
}
.gf-card-sub {
    font-size: 12px;
    font-weight: 600;
    color: var(--gf-muted);
    margin-bottom: 22px;
}

/* ============================================================
   Campos de formulario
   ============================================================ */
.gf-field {
    margin-bottom: 14px;
}
.gf-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--gf-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.gf-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* Input base — compatible con clases dinámicas Scriptcase */
.gf-input,
input.scFormObjectOdd,
input.scFormObjectEven {
    width: 100%;
    height: 50px;
    border-radius: var(--gf-r-md);
    border: 1.5px solid var(--gf-border);
    background: var(--gf-bg);
    padding: 0 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--gf-font);
    color: var(--gf-text);
    outline: none;
    transition: border .15s, background .15s;
    -webkit-appearance: none;
}
.gf-input:focus,
input.scFormObjectOdd:focus,
input.scFormObjectEven:focus,
input.scFormObjectOddFocus,
input.scFormObjectEvenFocus {
    border-color: var(--gf-primary);
    background: #fff;
}
.gf-input::placeholder {
    color: var(--gf-muted);
    font-weight: 500;
}
.gf-input--icon {
    padding-right: 48px;
}

/* Botón toggle contraseña (nativo) */
.gf-eye {
    position: absolute;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gf-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Compatibilidad icono toggle Scriptcase */
span.sc-ui-pwd-toggle-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    cursor: pointer;
    color: var(--gf-muted);
}

/* ============================================================
   ¿Olvidaste la contraseña?
   ============================================================ */
.gf-forgot {
    text-align: right;
    margin-bottom: 18px;
}
.gf-forgot a,
.gf-forgot span {
    font-size: 12px;
    font-weight: 700;
    color: var(--gf-primary);
    text-decoration: none;
    cursor: pointer;
}

/* ============================================================
   Botón Acceder — compatible con input[type=button] Scriptcase
   ============================================================ */
.gf-btn,
input.button.button-block,
input.gf-btn.button-block,
.gf-field .button-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    border-radius: var(--gf-r-md);
    background: var(--gf-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    font-family: var(--gf-font);
    letter-spacing: -0.01em;
    border: none;
    cursor: pointer;
    transition: transform .08s, filter .15s;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
}
.gf-btn:active,
input.button.button-block:active {
    transform: scale(0.985);
    filter: brightness(0.95);
}

/* ============================================================
   Extras: remember me / nuevo usuario
   ============================================================ */
#txtremember,
.gf-extras {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--gf-muted);
    margin-top: 14px;
}
#txtremember a,
.gf-extras a {
    color: var(--gf-primary);
    text-decoration: none;
}

/* ============================================================
   Footer
   ============================================================ */
.gf-login-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gf-muted);
}

/* Campo language vacío: ocultar */
.control:empty {
    display: none;
}

/* ============================================================
   Alerta de error Scriptcase
   ============================================================ */
.alert-message {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: calc(100% - 40px);
    background: var(--gf-primary);
    color: #fff;
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--gf-font);
    box-shadow: var(--gf-shadow-pop);
    z-index: 999;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.alert-message.active {
    display: flex;
}
.alert-message.negative {
    background: #c0392b;
}
.alert-message .close {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
    line-height: 1;
    flex-shrink: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 480px) {
    .gf-login-body {
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }
    .gf-login-top {
        height: 220px;
    }
}