/* =========================================================
   PORTAL BLINDAJE - LOGIN (tema oscuro, tarjeta centrada)
   ========================================================= */

:root {
    --bg: #050608;
    --card: #14161b;
    --card-border: rgba(255, 255, 255, .07);
    --field: #1c1f26;
    --field-border: #2c313b;
    --field-border-hover: #3d4452;
    --primary: #2f7df6;
    --primary-hover: #4a90ff;
    --text: #f4f6fa;
    --text-secondary: #c3c9d4;
    --text-muted: #7f8898;
    --red: #f87171;
    --font: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body.login-body {
    background:
            radial-gradient(ellipse 60% 45% at 50% 0%, rgba(47, 125, 246, .16), transparent 70%),
            var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body.login-body .ui-widget,
body.login-body .ui-widget input,
body.login-body .ui-widget button {
    font-family: var(--font);
}


/* =========================================================
   PÁGINA Y TARJETA
   ========================================================= */

.login-page {
    min-height: 100vh;
    box-sizing: border-box;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: 40px 36px 28px;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: linear-gradient(180deg, #181b21 0%, var(--card) 100%);
    box-shadow:
            0 1px 0 rgba(255, 255, 255, .04) inset,
            0 30px 80px rgba(0, 0, 0, .6);
}


/* =========================================================
   LOGO Y TÍTULO
   ========================================================= */

.login-header {
    margin-bottom: 30px;
    text-align: center;
}

.login-logo {
    display: block;
    width: auto;
    max-width: 160px;
    max-height: 64px;
    margin: 0 auto 24px;
    object-fit: contain;
}

.login-header h1 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 26px;
    font-weight: 300;
    letter-spacing: -.3px;
}

.login-header h1 strong {
    font-weight: 700;
}

.login-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}


/* =========================================================
   CAMPOS
   ========================================================= */

.field-container {
    margin-bottom: 18px;
}

.field-container label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

/* Ambos campos son obligatorios: el asterisco solo mete ruido */
.field-container .ui-outputlabel-rfi {
    display: none;
}

.input-wrapper {
    position: relative;
    display: block;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: color .15s ease;
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary-hover);
}

.input-wrapper .ui-password {
    display: block;
    width: 100%;
}

body.login-body .input-wrapper input.ui-inputfield {
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    padding: 0 44px;
    border: 1px solid var(--field-border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    caret-color: var(--text);
    font-size: 15px;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

body.login-body .input-wrapper input.ui-inputfield:hover {
    border-color: var(--field-border-hover);
}

body.login-body .input-wrapper input.ui-inputfield:focus {
    border-color: var(--primary);
    background: #1f232b;
    box-shadow: 0 0 0 3px rgba(47, 125, 246, .22);
    outline: 0;
}

body.login-body .input-wrapper input.ui-inputfield.ui-state-error {
    border-color: var(--red);
}

/*
 * Autocompletado del navegador: sin esto pinta el campo de amarillo claro
 * y el texto blanco no se lee. Se fija el color del texto y se tapa el fondo
 * con una sombra interior del color del campo. Va con !important porque el
 * navegador aplica sus propios estilos con prioridad.
 */
body.login-body .input-wrapper input.ui-inputfield:-webkit-autofill,
body.login-body .input-wrapper input.ui-inputfield:-webkit-autofill:hover {
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text);
    box-shadow: 0 0 0 1000px var(--field) inset !important;
}

body.login-body .input-wrapper input.ui-inputfield:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text) !important;
    box-shadow: 0 0 0 1000px var(--field) inset, 0 0 0 3px rgba(47, 125, 246, .22) !important;
}

/* Firefox */
body.login-body .input-wrapper input.ui-inputfield:autofill {
    background: var(--field) !important;
    color: var(--text) !important;
    filter: none;
}

/* Ojo para mostrar / ocultar la contraseña */
body.login-body .input-wrapper .ui-password > i {
    top: 50%;
    right: 15px;
    margin-top: 0;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: color .15s ease;
}

body.login-body .input-wrapper .ui-password > i:hover {
    color: var(--text);
}


/* =========================================================
   BOTÓN
   ========================================================= */

body.login-body .ui-button.login-button {
    width: 100%;
    height: 48px;
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #3d88ff 0%, #2670ea 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(47, 125, 246, .28);
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}

body.login-body .ui-button.login-button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(47, 125, 246, .36);
}

body.login-body .ui-button.login-button:active {
    transform: none;
}

body.login-body .ui-button.login-button.ui-state-focus {
    box-shadow: 0 0 0 3px rgba(47, 125, 246, .4);
}

body.login-body .ui-button.login-button .ui-button-text {
    padding: 0;
}

body.login-body .ui-button.login-button .ui-icon {
    position: static;
    margin: 0;
    font-size: 15px;
}


/* =========================================================
   MENSAJES
   ========================================================= */

body.login-body .ui-messages > div {
    position: relative;
    margin: 0 0 20px;
    padding: 12px 40px 12px 14px;
    border: 1px solid rgba(96, 165, 250, .35);
    border-radius: 12px;
    background: rgba(47, 125, 246, .12);
    color: #bfdbfe;
    font-size: 13.5px;
    font-weight: 500;
}

body.login-body .ui-messages > div.ui-messages-error,
body.login-body .ui-messages > div.ui-messages-fatal {
    border-color: rgba(248, 113, 113, .35);
    background: rgba(220, 38, 38, .14);
    color: #fecaca;
}

body.login-body .ui-messages ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.login-body .ui-messages ul span[class$="-summary"] {
    font-weight: 700;
}

body.login-body .ui-messages [class*="-icon"]:not(.ui-messages-close):not(.ui-icon) {
    display: none;
}

body.login-body .ui-messages .ui-messages-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    line-height: 26px;
    background: transparent;
    color: inherit;
}


/* =========================================================
   PIE
   ========================================================= */

.login-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 480px) {

    .login-page {
        padding: 16px;
    }

    .login-card {
        padding: 32px 22px 22px;
    }

    .login-header h1 {
        font-size: 23px;
    }
}
