/* frontend/pages/login/login.css */
/* =========================================================
   Rasta Pets – Login
   Diseño Veterinario Minimalista / Soft UI
   ========================================================= */

:root {
  /* Fondos */
  --bg-body: #f6f9fc;
  --bg-card: #ffffff;
  --bg-soft: #f4fcfa;
  --bg-input: #f8fbfd;

  /* Textos */
  --text-main: #102a56;
  --text-secondary: #7b8ba8;
  --text-placeholder: #a6b3c9;

  /* Colores */
  --color-primary: #22c7a9;
  --color-primary-hover: #16a88e;
  --color-primary-soft: #e9fbf7;

  --color-blue: #2563eb;
  --color-blue-soft: #eff6ff;

  --color-green: #22c55e;
  --color-orange: #f59e0b;
  --color-purple: #8b5cf6;
  --color-red: #ef4444;
  --color-red-soft: #fff1f2;

  /* Bordes */
  --border-soft: #e3eaf3;
  --border-light: #eef3f8;

  /* Sombras */
  --shadow-soft: 0 18px 45px rgba(16, 42, 86, 0.08);
  --shadow-hover: 0 24px 60px rgba(16, 42, 86, 0.12);
  --shadow-focus: 0 0 0 4px rgba(34, 199, 169, 0.16);
  --shadow-primary: 0 12px 28px rgba(34, 199, 169, 0.24);

  /* Radius */
  --radius-xl: 30px;
  --radius-l: 22px;
  --radius-m: 16px;
  --radius-s: 12px;
  --radius-round: 999px;

  /* Tipografía */
  --font-family: "Inter", "DM Sans", system-ui, sans-serif;
}

/* ---------- Fondo general ---------- */
body.login-page {
  min-height: 100vh;
  margin: 0;
  padding: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(circle at top left, rgba(34, 199, 169, 0.14), transparent 32%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.10), transparent 30%),
    var(--bg-body);

  color: var(--text-main);
  font-family: var(--font-family);
}

body.login-page #app-root {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
}

/* ---------- Contenedor principal ---------- */
.login-wrap {
  width: min(1050px, 95vw);
  min-height: 620px;

  display: grid;
  grid-template-columns: 1.05fr 0.95fr;

  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-soft);
  overflow: hidden;

  backdrop-filter: blur(14px);
}

/* ---------- Panel visual ---------- */
.login-visual {
  position: relative;

  background:
    url("../../assets/img/perro_gato.png") center 40% / 68% no-repeat,
    linear-gradient(135deg, #e9fbf7 0%, #f3efff 100%);

  overflow: hidden;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 36px;

  border: 1px solid rgba(34, 199, 169, 0.18);
  border-radius: 30px;

  background:
    radial-gradient(circle at top right, rgba(34, 199, 169, 0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.10), transparent 32%);

  pointer-events: none;
}

.login-visual::after {
  content: "Cuidado, baño y control para tus mascotas";
  position: absolute;
  left: 44px;
  right: 44px;
  bottom: 44px;

  padding: 18px 20px;

  background: rgba(255, 255, 255, 0.86);
  color: var(--text-main);

  border: 1px solid rgba(34, 199, 169, 0.18);
  border-radius: var(--radius-l);

  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;

  box-shadow: 0 16px 35px rgba(16, 42, 86, 0.08);
  backdrop-filter: blur(10px);
}

.login-visual .login-veil {
  position: absolute;
  inset: 0;

  background:
    linear-gradient(135deg, rgba(34, 199, 169, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
}

/* ---------- Panel del formulario ---------- */
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;

  gap: 24px;
  padding: 54px 46px;

  background: #ffffff;
}

/* ---------- Marca ---------- */
.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;

  margin-bottom: 10px;
}

.login-brand .logo {
  width: 66px;
  height: 66px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  background:
    linear-gradient(135deg, #e9fbf7 0%, #d9f8f1 100%);

  border: 1px solid rgba(34, 199, 169, 0.22);
  border-radius: 22px;

  box-shadow: 0 14px 30px rgba(34, 199, 169, 0.18);
}

.login-brand .logo img {
  width: 76%;
  height: auto;
  object-fit: contain;

  filter: none;
}

.login-brand .title .app-name {
  margin: 0;

  color: var(--text-main);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.login-brand .title .subtitle {
  margin: 6px 0 0;

  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

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

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

/* ---------- Inputs ---------- */
.input-wrap {
  position: relative;
  display: flex;
}

.input {
  width: 100%;
  min-height: 52px;

  padding: 14px 48px 14px 16px;

  background: var(--bg-input);
  color: var(--text-main);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);

  outline: none;

  font-family: inherit;
  font-size: 14px;
  font-weight: 600;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.input:focus {
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.input::placeholder {
  color: var(--text-placeholder);
  font-weight: 500;
}

/* ---------- Mostrar contraseña ---------- */
.toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;

  padding: 8px;

  background: transparent;
  color: var(--text-secondary);

  border: none;
  border-radius: var(--radius-s);

  font-size: 18px;

  cursor: pointer;
  transform: translateY(-50%);

  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.toggle-pass:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

/* ---------- Mensaje de error ---------- */
.form-error {
  min-height: 20px;
  padding: 0 4px;

  color: var(--color-red);
  font-size: 13px;
  font-weight: 700;

  opacity: 0;
  transition: opacity 0.2s ease;
}

.form-error.visible {
  opacity: 1;
}

/* ---------- Botón principal ---------- */
.btn-primary {
  width: 100%;
  min-height: 52px;

  appearance: none;

  padding: 14px 24px;

  background: var(--color-primary);
  color: #ffffff;

  border: 1px solid var(--color-primary);
  border-radius: var(--radius-m);

  cursor: pointer;

  font-family: inherit;
  font-size: 15px;
  font-weight: 900;

  box-shadow: var(--shadow-primary);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
}

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

.btn-primary[disabled] {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- Loader ---------- */
form[aria-busy="true"] .btn-primary::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 0.65s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ---------- Pie de login ---------- */
.login-foot {
  margin-top: 18px;

  color: var(--text-secondary);
  text-align: center;

  font-size: 12px;
  font-weight: 600;
}

/* ---------- Utilidades ---------- */
.text-muted {
  color: var(--text-secondary);
  font-size: 13px;
}

.center {
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body.login-page {
    padding: 18px;
  }

  .login-wrap {
    grid-template-columns: 1fr;
    width: min(520px, 96vw);
    min-height: auto;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    padding: 42px 30px;
  }
}

@media (max-width: 480px) {
  body.login-page {
    padding: 14px;
  }

  .login-wrap {
    border-radius: 24px;
  }

  .login-panel {
    padding: 34px 22px;
  }

  .login-brand {
    align-items: flex-start;
  }

  .login-brand .logo {
    width: 58px;
    height: 58px;
    border-radius: 19px;
  }

  .login-brand .title .app-name {
    font-size: 26px;
  }
}