/* ==========================================================================
   Bioimágenes Centro de Diagnóstico — Keycloak Login Theme
   Paleta y layout extraídos del mockup de referencia
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
  --bio-blue: #0971ce;
  --bio-blue-dark: #1F5493;
  --bio-teal: #6FA19E;
  --bio-text: #333333;
  --bio-text-muted: #6b6b6b;
  --bio-border: #d4d7dc;
  --bio-bg: #ffffff;
  --bio-footer-text: #9a9a9a;
  --bio-error: #c0392b;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--bio-text);
  background: var(--bio-bg);
}

/* ---------- Layout split-screen ---------- */

.login-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.login-split-image {
  flex: 0 0 62.5%;
  background-image: url('../img/lobby.jpeg');
  background-size: cover;
  background-position: center;
}

.login-split-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 64px 32px 64px;
  background: var(--bio-bg);
}

.login-panel-inner {
  width: 100%;
  max-width: 460px;
}

/* ---------- Logo ---------- */

.login-logo {
  margin-bottom: 40px;
}

.login-logo img {
  max-width: 320px;
  height: auto;
}

/* ---------- Título ---------- */

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--bio-blue);
  margin: 0 0 28px 0;
  font-family: "Poppins", "Segoe UI", Roboto, Helvetica, Arial, sans-serif
}

.login-subtext {
  font-size: 13px;
  line-height: 1.5;
  color: var(--bio-text-muted);
  margin: -12px 0 24px 0;
}

/* ---------- Mensajes / alertas ---------- */

.login-alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
}

.login-alert-error {
  background: #fdecea;
  color: var(--bio-error);
  border: 1px solid #f5c6cb;
}

.login-alert-success {
  background: #eaf6ec;
  color: #2e7d32;
  border: 1px solid #c3e6cb;
}

.login-alert-warning {
  background: #fff8e6;
  color: #8a6d3b;
  border: 1px solid #f0e0b0;
}

/* ---------- Formulario ---------- */

.form-group {
  margin-bottom: 22px;
}

.login-label {
  display: block;
  font-size: 14px;
  color: var(--bio-text-muted);
  margin-bottom: 8px;
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--bio-text);
  border: 1px solid var(--bio-border);
  border-radius: 6px;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease;
}

.login-input::placeholder {
  color: #b0b3b8;
}

.login-input:focus {
  border-color: var(--bio-blue);
  box-shadow: 0 0 0 3px rgba(43, 108, 184, 0.12);
}

.login-input[aria-invalid="true"] {
  border-color: var(--bio-error);
}

.login-input-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--bio-error);
}

.form-options {
  margin: -8px 0 22px 0;
}

.login-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--bio-text-muted);
}

/* ---------- Botón ---------- */

.login-button {
  width: 100%;
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bio-text);
  background: #f5f7fa;
  border: 1px solid var(--bio-blue);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.login-button:hover {
  background: var(--bio-blue);
  color: #ffffff;
}

.login-button + .login-button {
  margin-top: 10px;
}

.login-button-secondary {
  background: #ffffff;
  border-color: var(--bio-border);
  color: var(--bio-text-muted);
}

.login-button-secondary:hover {
  background: #f0f1f3;
  color: var(--bio-text);
}

/* ---------- Links ---------- */

.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 13px;
}

.login-links a {
  color: var(--bio-blue);
  text-decoration: none;
}

.login-links a:hover {
  text-decoration: underline;
}

#kc-registration {
  margin-top: 20px;
  font-size: 13px;
  color: var(--bio-text-muted);
}

#kc-registration a {
  color: var(--bio-blue);
  text-decoration: none;
}

/* ---------- Footer ---------- */

.login-footer {
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--bio-footer-text);
  margin-top: 40px;
}

.login-footer p {
  margin: 2px 0;
}

.pf-c-input-group {
  display: flex;
}

.pf-c-button {
  background: none;
  border: none;
  outline: none;
}

/* ---------- Fallback para pantallas sin .ftl a medida ----------
   (registro, otras required actions, etc.) que Keycloak puede
   renderizar con las clases default de PatternFly/Bootstrap.
   Mantiene la misma identidad visual sin necesidad de sobreescribir
   cada plantilla del theme base. */

.login-split-panel .form-control,
.login-split-panel input[type="text"],
.login-split-panel input[type="password"],
.login-split-panel input[type="email"],
.login-split-panel input[type="tel"],
.login-split-panel input[type="number"],
.login-split-panel select,
.login-split-panel textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--bio-text);
  border: 1px solid var(--bio-border);
  border-radius: 6px;
  background: #ffffff;
  outline: none;
  font-family: inherit;
}

.login-split-panel .form-control:focus,
.login-split-panel input:focus,
.login-split-panel select:focus,
.login-split-panel textarea:focus {
  border-color: var(--bio-blue);
  box-shadow: 0 0 0 3px rgba(43, 108, 184, 0.12);
}

.login-split-panel .control-label,
.login-split-panel label {
  display: block;
  font-size: 14px;
  color: var(--bio-text-muted);
  margin-bottom: 8px;
}

.login-split-panel .btn,
.login-split-panel input[type="submit"],
.login-split-panel button[type="submit"] {
  width: 100%;
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bio-text);
  background: #f5f7fa;
  border: 1px solid var(--bio-blue);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.login-split-panel .btn:hover,
.login-split-panel input[type="submit"]:hover,
.login-split-panel button[type="submit"]:hover {
  background: var(--bio-blue);
  color: #ffffff;
}

.login-split-panel .required::after {
  content: " *";
  color: var(--bio-error);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .login-split-image {
    display: none;
  }

  .login-split-panel {
    flex: 1 1 100%;
    padding: 40px 24px;
    align-items: center;
  }

  .login-panel-inner {
    max-width: 420px;
  }
}
