/**
 * SumiSync Hub - Pantalla de Inicio de Sesión Corporativa
 * Diseño CleanShot X Split-Screen • Sumivitales S.A.S. Sabaneta
 */

:root {
  --color-paper: #ffffff;
  --color-slate-soft: #f8fafc;
  --color-studio-black: #0f0f12;
  --color-soft-charcoal: #5c5f66;
  --color-electric-blue: #0d44e8;
  --color-electric-blue-hover: #0933b3;
  --color-border-subtle: rgba(22, 22, 24, 0.08);
  --radius-panel: 24px;
  --radius-card: 16px;
  --radius-button: 14px;
  --radius-input: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: 'Google Sans Flex', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-studio-black);
  background-color: #0b0f19;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LAYOUT SPLIT-SCREEN
   ========================================================================== */
.login-split-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* --------------------------------------------------------------------------
   COLUMNA IZQUIERDA: HERO VISUAL & SUMIVITALES S.A.S.
   -------------------------------------------------------------------------- */
.login-hero-panel {
  flex: 1.15;
  position: relative;
  background-image: url('/common/sumivitales_hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: #ffffff;
  overflow: hidden;
}

.hero-overlay-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(8, 14, 28, 0.92) 0%, rgba(13, 27, 54, 0.84) 45%, rgba(15, 23, 42, 0.94) 100%);
  backdrop-filter: blur(2px);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 36px;
}

/* Header del Hero */
.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon-hero {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d44e8 0%, #0284c7 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 8px 18px rgba(13, 68, 232, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.hero-brand-sub {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.hero-chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
}

/* Cuerpo del Hero */
.hero-body {
  max-width: 620px;
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(13, 68, 232, 0.25);
  border: 1px solid rgba(13, 68, 232, 0.5);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.hero-title {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 18px;
}

.hero-description {
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 32px;
}

/* Feature Cards Flotantes */
.hero-feature-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.hero-feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.hero-feature-card:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.1);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.feature-icon.blue { background: rgba(13, 68, 232, 0.3); color: #60a5fa; }
.feature-icon.emerald { background: rgba(16, 185, 129, 0.3); color: #34d399; }
.feature-icon.purple { background: rgba(168, 85, 247, 0.3); color: #c084fc; }

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-text strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.feature-text span {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Footer del Hero */
.hero-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.65);
}

.hero-hq-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.hero-contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.hero-contact-row a {
  color: #60a5fa;
  text-decoration: none;
}
.hero-contact-row a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   COLUMNA DERECHA: FORMULARIO CLEANSHOT X & RBAC
   -------------------------------------------------------------------------- */
.login-form-panel {
  flex: 0.95;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  min-height: 100vh;
  overflow-y: auto;
}

.login-form-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Logo Mobile */
.login-brand-mobile {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.form-header-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-headline {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f0f12;
}

.login-subheadline {
  font-size: 0.86rem;
  color: #5c5f66;
  line-height: 1.5;
}

/* Alerta de Error */
.login-error-alert {
  padding: 12px 16px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Formulario */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #161618;
}

.input-icon-container {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 16px;
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.15s ease;
}

.form-control-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 46px;
  background-color: #f8fafc;
  border: 1.5px solid rgba(22, 22, 24, 0.12);
  border-radius: 12px;
  font-size: 0.92rem;
  font-family: inherit;
  color: #0f0f12;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-control-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #0d44e8;
  box-shadow: 0 0 0 4px rgba(13, 68, 232, 0.12);
}

.form-control-input:focus + .field-icon,
.input-icon-container:focus-within .field-icon {
  color: #0d44e8;
}

/* Botón de Submit */
.btn-login-submit {
  width: 100%;
  height: 48px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  box-shadow: 0 2px 4px rgba(13, 68, 232, 0.18), 0 8px 18px rgba(13, 68, 232, 0.26);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-login-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 68, 232, 0.22), 0 12px 24px rgba(13, 68, 232, 0.32);
}

.btn-login-submit:active:not(:disabled) {
  transform: translateY(0);
}

/* Selector RBAC Rápido */
.quick-rbac-card {
  background: #f8fafc;
  border: 1px solid rgba(22, 22, 24, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-rbac-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c5f66;
}

.rbac-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-rbac-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid rgba(22, 22, 24, 0.08);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-rbac-option:hover {
  border-color: #0d44e8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.rbac-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.rbac-icon-badge.purple { background: #faf5ff; color: #7e22ce; border: 1px solid #f3e8ff; }
.rbac-icon-badge.blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.rbac-icon-badge.emerald { background: #ecfdf5; color: #047857; border: 1px solid #d1fae5; }

.rbac-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.rbac-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rbac-name-row strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f0f12;
}

.rbac-info small {
  font-size: 0.72rem;
  color: #6a6a6b;
}

/* Pie del Panel de Login */
.login-panel-footer {
  border-top: 1px solid rgba(22, 22, 24, 0.08);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.footer-meta-line {
  font-size: 0.74rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
}

.login-developer-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #5c5f66;
}

.login-developer-credit .link-developer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #059669;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.login-developer-credit .link-developer:hover {
  color: #047857;
  text-decoration: underline;
  transform: translateY(-1px);
}

/* ==========================================================================
   RESPONSIVIDAD (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 992px) {
  .login-split-container {
    flex-direction: column;
  }

  .login-hero-panel {
    display: none;
  }

  .login-brand-mobile {
    display: flex;
  }

  .login-form-panel {
    flex: 1;
    min-height: 100vh;
    padding: 36px 20px;
  }
}
