/* =============================================================
   RETECH LOGIN THEME - custom.css
   Identidad visual coherente con retech-frontend
   Paleta: primary-btn #456277, brand #032639, secondary #30C704, neutral #f9f9f9
   Fuente: Liberation Sans
   ============================================================= */

/* =====================
   VARIABLES DE DISEÑO
   ===================== */
:root {
  --retech-primary:           #456277;
  --retech-primary-light:     #2d4a5e;
  --retech-primary-container: #c9e6ff;
  --retech-on-primary:        #ffffff;
  --retech-primary-brand:     #032639;
  --retech-secondary:         #30C704;
  --retech-secondary-dark:    #1d8a00;
  --retech-on-secondary:      #ffffff;
  --retech-surface:           #f9f9f9;
  --retech-surface-low:       #f1f1f1;
  --retech-outline:           #b0bdc6;
  --retech-outline-variant:   #d7e4ee;
  --retech-on-surface:        #1a1c1c;
  --retech-on-surface-var:    #546068;
  --retech-error:             #ba1a1a;
  --retech-error-container:   #ffdad6;
  --retech-shadow:            rgba(3, 38, 57, 0.12);
  --retech-radius-sm:         8px;
  --retech-radius-md:         12px;
  --retech-radius-lg:         16px;
  --retech-radius-pill:       100px;
}

/* =====================
   LOGO RETECH
   ===================== */
.retech-logo {
  background-image: url("../img/retech-logo.svg");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 64px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .retech-logo {
    margin-bottom: 4px;
  }
}

/* =====================
   SEPARADORES
   ===================== */
hr {
  border-top: 1px solid var(--retech-outline-variant);
}

/* =====================
   LAYOUT DE PÁGINA
   ===================== */
.login-pf-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  padding-bottom: 0;
}

.login-pf-page .login-pf-page-header {
  display: none;
  margin: 0;
}

@media (min-width: 768px) {
  .login-pf-page .login-pf-page-header {
    display: initial;
    margin-bottom: 12px;
  }
}

/* =====================
   CARD / CONTENEDOR
   ===================== */
.login-pf-page .card-pf {
  padding: 6px 20px 16px;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .login-pf-page .card-pf {
    padding: 12px 32px 20px;
  }
}

/* =====================
   CABECERA DEL FORMULARIO
   ===================== */
header.login-pf-header {
  padding-top: 8px;
}

/* =====================
   INPUTS / CONTROLES
   ===================== */
.pf-c-form-control {
  background-color: #ffffff;
  border-radius: var(--retech-radius-sm);
  border: 1px solid var(--retech-outline);
  color: var(--retech-on-surface);
  font-family: 'Liberation Sans', Helvetica, Arial, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pf-c-form-control:focus {
  border-color: var(--retech-primary);
  box-shadow: 0 0 0 2px rgba(3, 38, 57, 0.15);
  outline: none;
}

.pf-c-form__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--retech-primary);
  font-family: 'Liberation Sans', Helvetica, Arial, sans-serif;
}

/* Reducir espacio entre campos del formulario */
.pf-c-form__group {
  margin-bottom: 12px !important;
}

.pf-c-form__group:last-child {
  margin-bottom: 0 !important;
}

/* Reducir altura de inputs para compactar */
.pf-c-form-control {
  height: 38px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* =====================
   OPCIONES DEL FORMULARIO (remember me / forgot password)
   ===================== */
.form-group.login-pf-settings {
  margin-bottom: 0;
}

.form-group.login-pf-settings a {
  font-size: 14px;
  color: var(--retech-primary);
  font-weight: 500;
}

.form-group.login-pf-settings a:hover {
  color: var(--retech-secondary-dark);
  text-decoration: underline;
}

/* =====================
   BOTÓN PRIMARIO (Iniciar sesión / Registrarse)
   ===================== */
.pf-c-button.pf-m-primary {
  background-color: var(--retech-primary);
  color: var(--retech-on-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Liberation Sans', Helvetica, Arial, sans-serif;
  border-radius: var(--retech-radius-pill);
  width: 100%;
  height: 44px;
  border: none;
  letter-spacing: 0.3px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.pf-c-button.pf-m-primary:hover {
  background-color: var(--retech-primary-light);
  box-shadow: 0 4px 12px rgba(69, 98, 119, 0.25);
}

.pf-c-button.pf-m-primary:active {
  background-color: #39566a;
}

.pf-c-button.pf-m-primary:focus {
  outline: 2px solid var(--retech-secondary);
  outline-offset: 2px;
}

/* =====================
   BOTÓN SECUNDARIO / CONTROL
   ===================== */
.pf-c-button.pf-m-control {
  --pf-c-button--BorderRadius: unset;
  --pf-c-button--disabled--BackgroundColor: unset;
  --pf-c-button--after--BorderWidth: unset;
  --pf-c-button--after--BorderColor: unset;

  font-weight: 600;
  font-family: 'Liberation Sans', Helvetica, Arial, sans-serif;
  color: var(--retech-primary);
  background-color: transparent;
  border-radius: var(--retech-radius-pill);
  padding: 8px 16px;
  border: 1px solid var(--retech-primary);
  transition: background-color 0.2s ease;
}

.pf-c-button.pf-m-control:hover {
  background-color: rgba(3, 38, 57, 0.06);
}

/* =====================
   ALERTAS / MENSAJES — ESTILO WORLD-CLASS PREMIUM
   ===================== */

/* Animaciones */
@keyframes retech-alert-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes retech-alert-shimmer {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(300%)  skewX(-15deg); }
}
@keyframes retech-alert-pulse-ring {
  0%   { transform: scale(1);    opacity: 0.6; }
  100% { transform: scale(1.55); opacity: 0;   }
}

/* ── BASE COMPARTIDA ── */
.pf-c-alert,
.alert-error,
.alert-warning,
.alert-success,
.alert-info {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  padding: 13px 16px 13px 20px;
  margin-bottom: 12px;
  font-size: 13px;
  font-family: 'Liberation Sans', Helvetica, Arial, sans-serif;
  line-height: 1.5;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  animation: retech-alert-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Franja de acento izquierda con gradiente */
.pf-c-alert::before,
.alert-error::before,
.alert-warning::before,
.alert-success::before,
.alert-info::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 14px 0 0 14px;
}

/* Shimmer de brillo al aparecer */
.pf-c-alert::after,
.alert-error::after,
.alert-warning::after,
.alert-success::after,
.alert-info::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 60%
  );
  animation: retech-alert-shimmer 0.7s 0.1s ease both;
  pointer-events: none;
}

/* ── CONTENEDOR DEL ICONO ── */
.pf-c-alert__icon {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  z-index: 1;
}

/* Anillo de pulso detrás del icono */
.pf-c-alert__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: retech-alert-pulse-ring 0.6s 0.15s ease-out both;
  z-index: -1;
}

/* ── TEXTO ── */
.pf-c-alert__title,
.pf-c-alert span[class*="kcAlertTitle"] {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* ── ERROR / DANGER ── */
.pf-c-alert.pf-m-danger,
.alert-error {
  background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
  border-color: rgba(186, 26, 26, 0.20);
  color: #5c0000;
  box-shadow:
    0 4px 16px rgba(186, 26, 26, 0.10),
    0 1px 4px  rgba(186, 26, 26, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.70);
}
.pf-c-alert.pf-m-danger::before,
.alert-error::before {
  background: linear-gradient(180deg, #ff5449 0%, #ba1a1a 100%);
}
.pf-c-alert.pf-m-danger .pf-c-alert__icon,
.alert-error .pf-c-alert__icon {
  background: radial-gradient(circle at 35% 35%, rgba(255, 84, 73, 0.22), rgba(186, 26, 26, 0.14));
  color: #ba1a1a;
  box-shadow: 0 0 0 1px rgba(186, 26, 26, 0.15);
}
.pf-c-alert.pf-m-danger .pf-c-alert__icon::before,
.alert-error .pf-c-alert__icon::before {
  background: rgba(186, 26, 26, 0.18);
}

/* ── WARNING ── */
.pf-c-alert.pf-m-warning,
.alert-warning {
  background: linear-gradient(135deg, #fffcf0 0%, #fff8e6 100%);
  border-color: rgba(245, 158, 11, 0.24);
  color: #4a2c00;
  box-shadow:
    0 4px 16px rgba(245, 158, 11, 0.10),
    0 1px 4px  rgba(245, 158, 11, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.70);
}
.pf-c-alert.pf-m-warning::before,
.alert-warning::before {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
}
.pf-c-alert.pf-m-warning .pf-c-alert__icon,
.alert-warning .pf-c-alert__icon {
  background: radial-gradient(circle at 35% 35%, rgba(251, 191, 36, 0.28), rgba(245, 158, 11, 0.16));
  color: #b45309;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18);
}
.pf-c-alert.pf-m-warning .pf-c-alert__icon::before,
.alert-warning .pf-c-alert__icon::before {
  background: rgba(245, 158, 11, 0.20);
}

/* ── SUCCESS ── */
.pf-c-alert.pf-m-success,
.alert-success {
  background: linear-gradient(135deg, #f4fef0 0%, #edfde6 100%);
  border-color: rgba(48, 199, 4, 0.24);
  color: #062200;
  box-shadow:
    0 4px 16px rgba(48, 199, 4, 0.10),
    0 1px 4px  rgba(48, 199, 4, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.70);
}
.pf-c-alert.pf-m-success::before,
.alert-success::before {
  background: linear-gradient(180deg, #51e32e 0%, #166e00 100%);
}
.pf-c-alert.pf-m-success .pf-c-alert__icon,
.alert-success .pf-c-alert__icon {
  background: radial-gradient(circle at 35% 35%, rgba(81, 227, 46, 0.28), rgba(48, 199, 4, 0.16));
  color: #1d8a00;
  box-shadow: 0 0 0 1px rgba(48, 199, 4, 0.18);
}
.pf-c-alert.pf-m-success .pf-c-alert__icon::before,
.alert-success .pf-c-alert__icon::before {
  background: rgba(48, 199, 4, 0.20);
}

/* ── INFO ── */
.pf-c-alert.pf-m-info,
.alert-info {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f2ff 100%);
  border-color: rgba(69, 98, 119, 0.20);
  color: #001e2f;
  box-shadow:
    0 4px 16px rgba(3, 38, 57, 0.10),
    0 1px 4px  rgba(3, 38, 57, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.70);
}
.pf-c-alert.pf-m-info::before,
.alert-info::before {
  background: linear-gradient(180deg, #7794ab 0%, #032639 100%);
}
.pf-c-alert.pf-m-info .pf-c-alert__icon,
.alert-info .pf-c-alert__icon {
  background: radial-gradient(circle at 35% 35%, rgba(119, 148, 171, 0.28), rgba(69, 98, 119, 0.16));
  color: #456277;
  box-shadow: 0 0 0 1px rgba(69, 98, 119, 0.18);
}
.pf-c-alert.pf-m-info .pf-c-alert__icon::before,
.alert-info .pf-c-alert__icon::before {
  background: rgba(69, 98, 119, 0.18);
}

/* =====================
   PROVEEDORES SOCIALES (Apple, etc.)
   ===================== */
.kc-social-item a,
.pf-c-button.kc-social-item {
  border: 1px solid var(--retech-outline);
  border-radius: var(--retech-radius-pill);
  background-color: #ffffff;
  color: var(--retech-primary);
  font-weight: 600;
  font-family: 'Liberation Sans', Helvetica, Arial, sans-serif;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  padding: 8px 16px;
}

.kc-social-item a:hover,
.pf-c-button.kc-social-item:hover {
  background-color: var(--retech-surface-low);
  border-color: var(--retech-primary);
  color: var(--retech-primary);
  text-decoration: none;
}

/* =====================
   CERTIFICADO DIGITAL
   ===================== */
.kc-certificate-digital-button .certificate-icon {
  font-size: 23px;
  width: 30px;
  height: 25px;
  float: left;
  color: var(--retech-primary);
  fill: currentColor;
}

/* =====================
   AYUDA MFA / TOTP (configuración OTP)
   Reutiliza el mismo componente de alerta (pf-c-alert) que la
   advertencia superior, en variante "info" (azul) para que se lea
   como ayuda opcional, no como un requisito — misma familia visual,
   distinta urgencia.
   ===================== */
#kc-totp-mfa-help {
  margin-top: 10px;
  margin-bottom: 0;
}

.kc-alert-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
}

.kc-alert-link:hover,
.kc-alert-link:focus {
  text-decoration: none;
}

.kc-alert-link .fa-external-link {
  font-size: 10px;
}

/* Oculto visualmente pero accesible para lectores de pantalla */
.kc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =====================
   INFO / REGISTRO
   ===================== */
#kc-info.login-pf-signup {
  padding-bottom: 12px;
}

#kc-registration-container {
  text-align: center;
  margin-top: 8px;
}

#kc-registration a {
  color: var(--retech-primary);
  font-weight: 600;
}

#kc-registration a:hover {
  color: var(--retech-secondary-dark);
  text-decoration: underline;
}

/* =====================
   FOOTER INSTITUCIONAL
   ===================== */
.datagia-footer {
  background-color: var(--retech-surface-low);
  border-top: 1px solid var(--retech-outline-variant);
  padding: 0.5rem 1.5rem;
  font-family: 'Liberation Sans', Helvetica, Arial, sans-serif;
  color: var(--retech-on-surface-var);
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
}

.datagia-footer .footer-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  gap: 0.5rem;
}

.datagia-footer .footer-text {
  font-size: 0.75rem;
  color: var(--retech-on-surface-var);
  margin: 0;
  text-align: center;
  width: 100%;
}

.datagia-footer .footer-logos {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .datagia-footer .footer-logos {
    gap: 0.75rem;
  }
}

.datagia-footer .logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  max-width: 200px;
}

.datagia-footer .logo-container-prtr {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  max-width: 200px;
}

.datagia-footer .logo-container-jcyl {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  max-width: 200px;
}

.datagia-footer .logo-container-mterd {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  max-width: 200px;
}

.datagia-footer .logo-container-fueng {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  max-width: 200px;
}

.datagia-footer .footer-logo {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.datagia-footer .footer-logo:hover {
  opacity: 1;
}

.datagia-footer .footer-bottom {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--retech-outline-variant);
  width: 100%;
}

.datagia-footer .footer-links {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .datagia-footer .footer-links {
    gap: 0.5rem;
  }
}

.datagia-footer .footer-link {
  color: var(--retech-on-surface-var);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.datagia-footer .footer-link:hover {
  color: var(--retech-primary);
  text-decoration: underline;
}
