/* Tema wlg - estilo inspirado en el login de la app interna (fondo de tubos de ensayo,
   panel oscuro + formulario claro), con la marca real de Wiener Lab (no de un producto puntual). */

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body.wl-auth-body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #333333;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
}

.login-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 640px;
}

/* Los hijos de un grid no se achican por debajo de su ancho de contenido
   salvo que se fuerce min-width:0 - sin esto la tarjeta se desborda en mobile. */
.brand-section,
.form-section {
    min-width: 0;
}

/* Panel de marca (izquierda) */
.brand-section {
    position: relative;
    background-color: #ffffff;
    /* Manual de marca: el logo no va sobre fondo oscuro. Arriba (logo) la foto queda casi
       blanca/quemada; hacia abajo se oscurece para el texto claro de bienvenida. */
    background-image:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.6) 18%,
            rgba(255, 255, 255, 0) 38%,
            rgba(0, 21, 41, 0) 50%,
            rgba(0, 21, 41, 0.55) 72%,
            rgba(0, 21, 41, 0.88) 100%),
        url('../img/login-bg-dreamstime.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
}

.brand-content {
    position: relative;
    z-index: 1;
    color: #ffffff;
}

.brand-top {
    position: relative;
    z-index: 1;
}

/* Div vacío heredado del template: fuera del flujo para no romper el space-between. */
.brand-overlay { position: absolute; inset: 0; pointer-events: none; }

.brand-logo img {
    height: 34px;
    width: auto;
}

.brand-tagline {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: rgba(0, 21, 41, 0.7);
    text-transform: uppercase;
}

.brand-welcome {
    font-size: 26px;
    line-height: 1.3;
}

.brand-welcome span { display: block; font-weight: 400; color: rgba(255, 255, 255, 0.85); }
.brand-welcome strong { display: block; font-weight: 700; }

.brand-description {
    margin-top: 12px;
    max-width: 320px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Panel de formulario (derecha) */
.form-section {
    padding: 40px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-box { width: 100%; max-width: 380px; margin: 0 auto; position: relative; }

/* Selector de idioma */
.wl-locale {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
    position: relative;
}

.wl-locale #kc-current-locale-link {
    display: inline-block;
    padding: 8px 32px 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #495057;
    text-decoration: none;
    font-size: 13px;
}

.wl-locale-list {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    min-width: 130px;
    z-index: 10;
}

.wl-locale #kc-locale-dropdown:hover .wl-locale-list,
.wl-locale-list:hover {
    display: block;
}

.wl-locale-list li a {
    display: block;
    padding: 8px 14px;
    color: #333333;
    text-decoration: none;
    font-size: 13px;
}

.wl-locale-list li a:hover { background: #f8f9fa; }

/* Encabezado */
.login-header { text-align: center; margin-bottom: 24px; }

#kc-page-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.subtitle {
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
}

.subtitle .required,
.required { color: #db0032; }

#kc-username {
    margin-top: 8px;
    font-size: 14px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#kc-username a { color: #db0032; }

/* Alertas */
[class^="alert-"] {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-warning { background: #fffbeb; border-color: #fed7aa; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* Formulario */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 15px;
    font-family: inherit;
    color: #333333;
    background-color: #ffffff;
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input#username,
input[name="username"],
input[name="email"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v16H4z' stroke='none'/%3E%3Cpath d='M22 6l-10 7L2 6'/%3E%3Cpath d='M2 6v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2z'/%3E%3C/svg%3E");
}

input[type="password"] {
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #db0032;
    box-shadow: 0 0 0 3px rgba(219, 0, 50, 0.1);
}

input[aria-invalid="true"] { border-color: #dc2626; }

.pf-c-input-group { position: relative; }

.pf-c-input-group input { padding-right: 44px; }

.pf-c-input-group .pf-c-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 6px;
}

.pf-c-form__helper-text,
.kc-feedback-text {
    display: block;
    font-size: 13px;
    color: #dc2626;
    margin-top: 6px;
}

/* checkbox "recordarme" */
.checkbox { font-size: 14px; color: #6c757d; }

.checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
    margin: 0;
}

.checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    accent-color: #db0032;
}

#kc-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

#kc-form-options a,
.login-box a {
    color: #db0032;
    text-decoration: none;
}

#kc-form-options a:hover,
.login-box a:hover { text-decoration: underline; }

/* Botones */
input[type="submit"] {
    width: 100%;
    padding: 16px 44px 16px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    background-color: #db0032;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M13 6l6 6-6 6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 18px;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="submit"]:hover {
    background-color: #b50029;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(219, 0, 50, 0.25);
}

/* Registro / info al pie */
#kc-registration-container,
#kc-info {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #6c757d;
}

.wl-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    font-size: 12px;
    color: #adb5bd;
}

/* Proveedores sociales (no usado hoy por este realm, estilo básico por las dudas) */
#kc-social-providers ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#kc-social-providers a {
    display: block;
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
    color: #333333 !important;
    text-decoration: none !important;
}

#kc-social-providers a:hover { border-color: #db0032; }

/* Responsive */
@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 480px;
    }
    .brand-section { display: none; }
    .form-section { padding: 32px 28px; }
}

@media (max-width: 480px) {
    body.wl-auth-body { padding: 0; }
    .login-container { border-radius: 0; min-height: 100vh; }
}
