:root {
  --red-bg-start: #7e2626;
  --red-bg-end: #763737;
  --red-primary: #7e2626;
  --red-wave-mid: #874242;
  --red-wave-light: #863c3c;
  --input-border: rgba(255, 255, 255, 0.85);
  --input-bg: transparent;
  --text-white: #ffffff;
  --font-main: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body, #root {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--red-bg-start);
  overflow-x: hidden;
}

/* Contenedor Principal con Fondo de Ondas Fluidas */
.login-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7e2626 0%, #763737 45%, #6a2020 100%);
  overflow: hidden;
}

/* Capas SVG Decorativas en el Fondo */
.bg-waves {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.wave-path-1 {
  fill: rgba(255, 255, 255, 0.05);
}

.wave-path-2 {
  fill: rgba(135, 66, 66, 0.45); /* #874242 */
}

.wave-path-3 {
  fill: rgba(134, 60, 60, 0.5);  /* #863c3c */
}

.wave-path-4 {
  fill: rgba(255, 255, 255, 0.03);
}

/* Caja Formulario Centrada */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 360px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

.login-logo:hover {
  transform: translateY(-3px);
}

.site-logo-img {
  width: 140px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Formulario */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Wrapper del Campo (Input + Mensaje de Error en línea) */
.field-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Grupos de Entradas */
.input-group {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.95;
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 48px;
  background-color: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 1px;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.login-input:focus {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Estado de Error en Input */
.login-input.has-error {
  border-color: #fca5a5;
  background-color: rgba(239, 68, 68, 0.18);
  box-shadow: 0 0 0 2.5px rgba(248, 113, 113, 0.4);
}

/* Mensaje de Error Elegante debajo del Input */
.field-error-msg {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fecaca;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 5px;
  margin-left: 2px;
  line-height: 1.3;
  animation: fadeInError 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.field-error-msg svg {
  flex-shrink: 0;
  color: #fca5a5;
}

@keyframes fadeInError {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toggle contraseña */
.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: #ffffff;
}

/* Botón Login */
.login-button {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  background-color: #ffffff;
  color: #7e2626;
  border: none;
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-button:hover {
  background-color: #fff5f5;
  color: #6a2020;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

/* Enlace Olvidó Contraseña */
.forgot-password-wrapper {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.forgot-password-link {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.forgot-password-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Spinner de Carga */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(126, 38, 38, 0.25);
  border-top-color: #7e2626;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Alerta de Error General */
.error-alert {
  width: 100%;
  padding: 10px 14px;
  background-color: rgba(220, 38, 38, 0.92);
  border-left: 4px solid #991b1b;
  border-radius: 4px;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
