/**
 * Vortex Login — UI rediseño
 * Depende de vortex-design.css. Paleta y componentes del Design System.
 */

/* -------------------------------------------------------------------------
   Layout principal: split screen
   ------------------------------------------------------------------------- */
.vortex-login {
  --vortex-login-panel-width: 42%;
  --vortex-login-card-max: 28rem;
  --vortex-login-brand-padding: 3rem;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
}

.vortex-login__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--vortex-bg-primary);
}

/* Fondo: gradiente base + radial verde tipo vortex (luces de escenario) */
.vortex-login__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 120% 80% at 20% 50%,
      rgba(0, 191, 99, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 80% 120% at 80% 20%,
      rgba(0, 191, 99, 0.04) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle 60% at 50% 100%,
      rgba(0, 191, 99, 0.03) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* Movimiento sutil: onda/vortex muy suave */
.vortex-login__bg::after {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  left: -50%;
  top: -50%;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 30%,
    rgba(0, 191, 99, 0.02) 40%,
    transparent 50%
  );
  animation: vortex-login-glow 18s ease-in-out infinite;
  pointer-events: none;
}

@keyframes vortex-login-glow {
  0%, 100% { opacity: 0.6; transform: scale(1) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.05) rotate(3deg); }
}

/* -------------------------------------------------------------------------
   Paneles
   ------------------------------------------------------------------------- */
.vortex-login__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--vortex-login-brand-padding);
}

.vortex-login__panel--brand {
  width: var(--vortex-login-panel-width);
  min-width: 280px;
  color: var(--vortex-text);
}

.vortex-login__panel--form {
  flex: 1;
  align-items: center;
  justify-content: center;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* -------------------------------------------------------------------------
   Branding (izquierda)
   ------------------------------------------------------------------------- */
.vortex-login__logo-wrap {
  margin-bottom: 2rem;
}

.vortex-login__logo {
  height: 2.5rem;
  width: auto;
  object-fit: contain;
  display: block;
}

.vortex-login__tagline {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--vortex-text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.vortex-login__message {
  font-size: 0.9375rem;
  color: var(--vortex-text-secondary);
  line-height: 1.55;
  max-width: 22rem;
}

/* -------------------------------------------------------------------------
   Card de login (derecha)
   ------------------------------------------------------------------------- */
.vortex-login__card {
  width: 100%;
  max-width: var(--vortex-login-card-max);
  background: var(--vortex-bg-card);
  border: 1px solid var(--vortex-border);
  border-radius: var(--vortex-radius-lg);
  box-shadow: var(--vortex-shadow);
  padding: 2rem 2rem 2.25rem;
  transition: box-shadow var(--vortex-transition), border-color var(--vortex-transition);
}

.vortex-login__card:focus-within {
  box-shadow: 0 0 0 1px rgba(0, 191, 99, 0.2), var(--vortex-shadow);
  border-color: var(--vortex-border-light);
}

.vortex-login__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--vortex-text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.vortex-login__subtitle {
  font-size: 0.875rem;
  color: var(--vortex-text-muted);
  margin-bottom: 1.75rem;
}

/* -------------------------------------------------------------------------
   Formulario: campos y agrupación
   ------------------------------------------------------------------------- */
.vortex-login__field {
  margin-bottom: 1.25rem;
}

.vortex-login__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--vortex-text-secondary);
  margin-bottom: 0.375rem;
}

/* Input: extiende vortex-input-dark con hover sutil */
.vortex-login__input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 14px;
  background-color: var(--vortex-bg-elevated);
  border: 1px solid var(--vortex-border);
  border-radius: 8px;
  color: var(--vortex-text);
  font-size: 0.9375rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.vortex-login__input::placeholder {
  color: var(--vortex-text-muted);
}

.vortex-login__input:hover {
  border-color: var(--vortex-border-light);
}

.vortex-login__input:focus {
  outline: none;
  border-color: var(--vortex-primary);
  box-shadow: 0 0 0 2px var(--vortex-primary-muted);
}

.vortex-login__input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error: coherente con vortex-input-error */
.vortex-login__input.vortex-input-error {
  border-color: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.15);
}

.vortex-login__input.vortex-input-error:focus {
  border-color: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.15);
}

/* Botón principal */
.vortex-login__submit {
  width: 100%;
  margin-top: 0.25rem;
  margin-bottom: 0;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--vortex-radius);
  transition: background-color var(--vortex-transition), transform var(--vortex-transition), box-shadow var(--vortex-transition);
}

.vortex-login__submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--vortex-primary-muted);
}

/* Recordarme + enlaces */
.vortex-login__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.vortex-login__remember-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vortex-login__remember {
  width: 1rem;
  height: 1rem;
  accent-color: var(--vortex-primary);
  cursor: pointer;
}

.vortex-login__remember-label {
  font-size: 0.875rem;
  color: var(--vortex-text-secondary);
  cursor: pointer;
}

.vortex-login__options a {
  color: var(--vortex-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.vortex-login__options a:hover {
  color: var(--vortex-primary-hover);
  text-decoration: underline;
}

.vortex-login__options a:focus-visible {
  outline: none;
  text-decoration: underline;
}

.vortex-login__links {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--vortex-text-muted);
}

.vortex-login__links a {
  color: var(--vortex-primary);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.vortex-login__links a:hover {
  color: var(--vortex-primary-hover);
  text-decoration: underline;
}

.vortex-login__links a:focus-visible {
  outline: none;
  text-decoration: underline;
}

.vortex-login__register {
  margin-top: 0.75rem;
}

/* Bloque de error (vortex-alert) */
.vortex-login__error-block {
  margin-top: 1rem;
}

.vortex-login__error-block.hidden {
  display: none !important;
}

/* Notificación genérica (éxito/info) */
.vortex-login__notification {
  margin-top: 1rem;
}

.vortex-login__notification.hidden {
  display: none !important;
}

/* -------------------------------------------------------------------------
   Responsive: una columna en móvil
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .vortex-login {
    flex-direction: column;
    justify-content: flex-start;
  }

  .vortex-login__panel--brand {
    width: 100%;
    min-width: 0;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
  }

  .vortex-login__logo-wrap {
    margin-bottom: 1rem;
  }

  .vortex-login__logo {
    margin-left: auto;
    margin-right: auto;
  }

  .vortex-login__message {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .vortex-login__panel--form {
    padding: 1.5rem 1rem 2rem;
    align-items: stretch;
  }

  .vortex-login__card {
    padding: 1.5rem 1.25rem 1.75rem;
  }
}

@media (max-width: 380px) {
  .vortex-login__options {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* -------------------------------------------------------------------------
   Variante minimal: solo card centrada
   ------------------------------------------------------------------------- */
.vortex-login--minimal .vortex-login__panel--brand {
  display: none;
}

.vortex-login--minimal .vortex-login__panel--form {
  flex: 1;
  width: 100%;
  max-width: 100%;
}

.vortex-login--minimal .vortex-login__card {
  max-width: var(--vortex-login-card-max);
}
