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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  height: 100%;
}

body.porks-theme-body {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans, "Inter", system-ui, -apple-system, sans-serif);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  background-color: #0c0a09;
}

/* Fondo fotográfico real del chicharrón con viñeta oscura */
.login-page-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: 
    linear-gradient(135deg, rgba(12, 10, 9, 0.45) 0%, rgba(28, 10, 8, 0.65) 50%, rgba(12, 10, 9, 0.85) 100%),
    radial-gradient(ellipse at 35% 50%, rgba(0, 0, 0, 0.1) 0%, rgba(12, 10, 9, 0.8) 85%),
    url('/design/bg-chicharron-clean.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: contrast(1.08) brightness(0.92);
}

/* Contenedor equilibrado de dos columnas */
.login-layout-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  padding: 2rem 2.5rem;
  gap: 4rem;
}

/* Columna Izquierda: Showcase de la marca del cliente */
.brand-showcase-column {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: 24px;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
}

.client-hero-logo {
  width: 100%;
  max-width: 400px;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.9)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.client-hero-logo:hover {
  transform: scale(1.02);
}

.brand-tagline {
  margin-top: 1.25rem;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8fafc;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  opacity: 0.95;
}

/* Columna Derecha: Tarjeta de Ingreso */
.login-card-column {
  flex: 0.9;
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  background: rgba(18, 16, 15, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(249, 214, 16, 0.22);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 35px rgba(252, 45, 45, 0.15);
}

.login-card-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.card-title {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Formularios */
.form-group {
  margin-bottom: 1.15rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e7e5e4;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
  width: 100%;
}

.campo {
  width: 100%;
  height: 44px;
  padding: 0 0.9rem;
  font: inherit;
  font-size: 0.92rem;
  color: #f8fafc;
  background: rgba(28, 25, 23, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  outline: none;
  transition: all 0.2s ease;
}

.campo::placeholder {
  color: #78716c;
  font-size: 0.86rem;
}

.campo:focus {
  border-color: #fc2d2d;
  box-shadow: 0 0 0 3px rgba(252, 45, 45, 0.25);
  background: rgba(28, 25, 23, 0.95);
}

.campo-password {
  padding-right: 2.85rem !important;
}

/* Botón Ver Contraseña */
.eye-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #a8a29e;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}

.eye-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.eye-btn:focus-visible {
  outline: 2px solid #fc2d2d;
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #78716c;
  line-height: 1.3;
}

/* Aviso de Error */
.aviso {
  margin-top: 0.8rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #fecdd3;
  background: rgba(159, 18, 57, 0.35);
  border: 1px solid rgba(225, 29, 72, 0.5);
  border-radius: 8px;
  text-align: center;
}

/* Botón de Ingreso Principal */
.btn-login-wrap {
  margin-top: 1.4rem;
}

.btn-login {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fc2d2d 0%, #d92727 100%);
  color: #ffffff;
  border: none;
  border-radius: 9px;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(252, 45, 45, 0.4);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn-login:hover {
  box-shadow: 0 6px 20px rgba(252, 45, 45, 0.55);
  transform: translateY(-1px);
  filter: brightness(1.05);
}

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

.btn-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Pie de la tarjeta */
.login-card-footer {
  margin-top: 1.5rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-legal {
  font-size: 0.7rem;
  color: #78716c;
  display: block;
  line-height: 1.3;
}

.footer-cosmos-brand {
  font-size: 0.68rem;
  color: #a8a29e;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.footer-version {
  font-size: 0.65rem;
  color: #78716c;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  opacity: 0.9;
  user-select: all;
}

/* ── OPTIMIZACIÓN RESPONSIVE TOTAL PARA MÓVIL (Sin scroll / One Screen) ── */
@media (max-width: 820px) {
  body.porks-theme-body {
    overflow-y: auto;
    align-items: flex-start;
  }

  .login-layout-container {
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem 1.5rem;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
  }

  .brand-showcase-column {
    flex: none;
    width: 100%;
  }

  .brand-hero-card {
    padding: 0.25rem 0.5rem;
    background: none;
  }

  .client-hero-logo {
    width: 75%;
    max-width: 270px;
    max-height: 200px;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.9));
  }

  .brand-tagline {
    display: none; /* Se oculta en móviles para ganar espacio vertical vital */
  }

  .login-card-column {
    flex: none;
    width: 100%;
    max-width: 380px;
  }

  .login-card {
    padding: 1.25rem 1.15rem;
    border-radius: 14px;
    background: rgba(18, 16, 15, 0.9);
  }

  .login-card-header {
    margin-bottom: 0.85rem;
  }

  .card-title {
    font-size: 1.2rem;
    text-align: center;
  }

  .form-group {
    margin-bottom: 0.75rem;
  }

  .form-group label {
    font-size: 0.76rem;
    margin-bottom: 0.25rem;
  }

  .campo {
    height: 38px;
    font-size: 0.88rem;
    padding: 0 0.8rem;
  }

  .field-hint {
    font-size: 0.68rem;
    margin-top: 0.25rem;
  }

  .btn-login-wrap {
    margin-top: 1rem;
  }

  .btn-login {
    height: 40px;
    font-size: 0.92rem;
  }

  .login-card-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    gap: 0.2rem;
  }

  .footer-legal {
    font-size: 0.65rem;
  }

  .footer-cosmos-brand {
    font-size: 0.62rem;
  }
}

/* Teléfonos muy pequeños en altura (< 680px) */
@media (max-height: 680px) and (max-width: 820px) {
  .login-layout-container {
    padding: 0.4rem 0.75rem;
    gap: 0.4rem;
  }

  .client-hero-logo {
    max-width: 210px;
    max-height: 140px;
  }

  .login-card {
    padding: 1rem 0.95rem;
  }

  .login-card-header {
    margin-bottom: 0.6rem;
  }

  .form-group {
    margin-bottom: 0.55rem;
  }

  .campo {
    height: 36px;
  }

  .login-card-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
  }
}

/* ── Variante de marca COSMOS (Órbita Índigo & Teal) y Steel Navy ── */
html[data-palette="cosmos-brand"] body.porks-theme-body,
html[data-palette="steel-navy"] body.porks-theme-body {
  background-color: #050a14;
}

html[data-palette="cosmos-brand"] .login-page-backdrop,
html[data-palette="steel-navy"] .login-page-backdrop {
  background-image:
    radial-gradient(ellipse at 32% 48%, rgba(15, 118, 110, 0.14) 0%, rgba(5, 10, 20, 0.65) 85%),
    url('/design/bg-cosmos-hero.svg');
  filter: none;
}

html[data-palette="cosmos-brand"] .brand-hero-card,
html[data-palette="steel-navy"] .brand-hero-card {
  background: radial-gradient(circle at center, rgba(11, 22, 40, 0.45) 0%, transparent 72%);
}

html[data-palette="cosmos-brand"] .client-hero-logo,
html[data-palette="steel-navy"] .client-hero-logo {
  filter: drop-shadow(0 14px 32px rgba(2, 132, 199, 0.25)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.75));
}

html[data-palette="cosmos-brand"] .brand-tagline,
html[data-palette="steel-navy"] .brand-tagline {
  color: #cbd5e1;
  letter-spacing: 0.14em;
}

html[data-palette="cosmos-brand"] .login-card,
html[data-palette="steel-navy"] .login-card {
  background: rgba(11, 22, 40, 0.84);
  border: 1px solid rgba(45, 212, 191, 0.28);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(148, 163, 184, 0.08),
    0 0 36px rgba(20, 184, 166, 0.16);
}

html[data-palette="cosmos-brand"] .campo,
html[data-palette="steel-navy"] .campo {
  background: rgba(15, 27, 45, 0.82);
  border-color: rgba(148, 163, 184, 0.2);
}

html[data-palette="cosmos-brand"] .campo:focus,
html[data-palette="steel-navy"] .campo:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.28);
  background: rgba(15, 27, 45, 0.96);
}

html[data-palette="cosmos-brand"] .eye-btn:focus-visible,
html[data-palette="steel-navy"] .eye-btn:focus-visible {
  outline: 2px solid #14b8a6;
}

html[data-palette="cosmos-brand"] .field-hint,
html[data-palette="steel-navy"] .field-hint,
html[data-palette="cosmos-brand"] .footer-legal,
html[data-palette="steel-navy"] .footer-legal {
  color: #94a3b8;
}

html[data-palette="cosmos-brand"] .btn-login,
html[data-palette="steel-navy"] .btn-login {
  background: linear-gradient(135deg, #0f766e 0%, #0284c7 100%);
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.35);
}

html[data-palette="cosmos-brand"] .btn-login:hover,
html[data-palette="steel-navy"] .btn-login:hover {
  background: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%);
  box-shadow: 0 6px 22px rgba(20, 184, 166, 0.48);
}
