/* frontend/pages/login/login.css */
/* =========================================================
   Rasta Pets – Login
   Diseño Minimalista, Limpio y Profesional
   Paleta: Menta / Teal Profesional + Azul Marino Suave
   ========================================================= */

:root {
  /* Fondos */
  --login-bg-body: #f1f5f9;
  --login-card-bg: #ffffff;
  --login-panel-bg: #ffffff;
  --login-input-bg: #ffffff;
  --login-input-focus-bg: #ffffff;

  /* Textos y Jerarquía */
  --login-text-title: #0f172a;
  --login-text-body: #334155;
  --login-text-muted: #64748b;
  --login-text-placeholder: #94a3b8;

  /* Paleta de Marca */
  --login-teal-50: #ecfdf5;
  --login-teal-100: #d1fae5;
  --login-teal-500: #10b981;
  --login-teal-600: #059669;
  --login-teal-700: #047857;

  --login-primary: #10b981;
  --login-primary-hover: #059669;
  --login-primary-active: #047857;
  --login-primary-light: #ecfdf5;
  --login-primary-ring: rgba(16, 185, 129, 0.18);

  /* Bordes */
  --login-border: #e2e8f0;
  --login-border-focus: #10b981;
  --login-border-hover: #cbd5e1;

  /* Estados */
  --login-error-bg: #fef2f2;
  --login-error-border: #fecaca;
  --login-error-text: #b91c1c;

  /* Sombras */
  --login-shadow-card: 0 12px 32px rgba(15, 23, 42, 0.08);
  --login-shadow-btn: none;
  --login-shadow-btn-hover: none;
  --login-shadow-input: none;

  /* Radios */
  --login-radius-card: 8px;
  --login-radius-inner: 18px;
  --login-radius-input: 6px;
  --login-radius-btn: 6px;

  /* Tipografías */
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =========================================================
   Modo Oscuro (data-theme="dark")
   ========================================================= */
:root[data-theme="dark"] {
  --login-bg-body: #090d16;
  --login-card-bg: #111827;
  --login-panel-bg: #111827;
  --login-input-bg: #1f2937;
  --login-input-focus-bg: #111827;

  --login-text-title: #f8fafc;
  --login-text-body: #cbd5e1;
  --login-text-muted: #94a3b8;
  --login-text-placeholder: #64748b;

  --login-border: #243042;
  --login-border-focus: #10b981;
  --login-border-hover: #374151;

  --login-error-bg: rgba(239, 68, 68, 0.12);
  --login-error-border: rgba(239, 68, 68, 0.25);
  --login-error-text: #fca5a5;

  --login-shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* =========================================================
   Fondo General de la Página
   ========================================================= */
body.login-page {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--login-bg-body);
  background-image: none;
  color: var(--login-text-body);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

body.login-page #app-root {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
}

/* =========================================================
   Contenedor Principal (Tarjeta de Login)
   ========================================================= */
@layer pages {
.login-wrap {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: 54% 46%;
  background: var(--login-card-bg);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  animation: none;
}
}

@keyframes loginCardEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   Panel Visual (Lateral Derecho)
   ========================================================= */
@layer pages {
.login-visual {
  position: relative;
  order: 2;
  background: var(--login-panel-bg);
  overflow: hidden;
  user-select: none;
}



:root[data-theme="dark"] .login-visual {
  background-color: var(--login-panel-bg);
}



.login-visual::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 82%;
  background: var(--login-primary);
  clip-path: polygon(0 0, 0.5% 16%, 2.5% 34%, 6% 54%, 4% 72%, 0 100%, 99% 100%, 97% 72%, 96% 50%, 98% 25%, 99% 0);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 0 C0 19 6 38 6 54 C6 74 0 92 0 100 L99 100 C97 82 95 64 96 50 C97 30 99 14 99 0 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 0 C0 19 6 38 6 54 C6 74 0 92 0 100 L99 100 C97 82 95 64 96 50 C97 30 99 14 99 0 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}



.login-visual::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 82%;
  background: url("../../assets/img/login-bano-mascotas.png") 48% center / cover no-repeat;
  clip-path: polygon(1.1% 0, 1.6% 16%, 3.6% 34%, 7.1% 54%, 5.1% 72%, 1.1% 100%, 97.9% 100%, 95.9% 72%, 94.9% 50%, 96.9% 25%, 97.9% 0);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M1.1 0 C1.1 19 7.1 38 7.1 54 C7.1 74 1.1 92 1.1 100 L97.9 100 C95.9 82 93.9 64 94.9 50 C95.9 30 97.9 14 97.9 0 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M1.1 0 C1.1 19 7.1 38 7.1 54 C7.1 74 1.1 92 1.1 100 L97.9 100 C95.9 82 93.9 64 94.9 50 C95.9 30 97.9 14 97.9 0 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}



.login-visual .login-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cpattern id='dots' width='14' height='14' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='3' cy='3' r='2.2' fill='%230f172a'/%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M910 300h32m-16-16v32' stroke='%2310b981' stroke-width='8'/%3E%3Cpath d='M790 185l9 19 19 9-19 9-9 19-9-19-19-9 19-9z' fill='%2310b981'/%3E%3Cpath d='M790 790l104-36 32 84-112-9z' fill='%230f172a' stroke='%2310b981' stroke-width='7'/%3E%3Cpath d='M807 793l94-30' stroke='%2310b981' stroke-width='4' stroke-dasharray='2 9'/%3E%3Cpath d='M0 460h145v150H0z' fill='url(%23dots)'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}



.login-veil::before {
  content: "";
  position: absolute;
  top: 28px;
  right: 8%;
  width: 38px;
  height: 38px;
  border: 7px solid var(--login-primary);
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(-16deg);
}



.login-veil::after {
  content: "";
  position: absolute;
  top: 49%;
  right: 8%;
  width: 22px;
  height: 22px;
  border: 4px solid var(--login-teal-700);
  border-radius: 50%;
}


/* =========================================================
   Panel del Formulario (Lateral Izquierdo)
   ========================================================= */

.login-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  order: 1;
  min-height: 100vh;
  padding: 40px clamp(32px, 6vw, 96px) 56px;
  background: var(--login-panel-bg);
  box-sizing: border-box;
}



.login-panel::before {
  content: "";
  position: absolute;
  bottom: 18px;
  left: 8px;
  width: 150px;
  height: 54px;
  background: radial-gradient(circle, var(--login-text-title) 1.8px, transparent 2.1px) 0 0 / 13px 13px;
  opacity: 0.9;
  pointer-events: none;
}



.login-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='none'%3E%3Cpath d='M844 345l11-19h22l11 19-11 19h-22z' fill='%2310b981'/%3E%3Cpath d='M780 500h7m13 0h7m13 0h7' stroke='%2310b981' stroke-width='7' stroke-linecap='round'/%3E%3Ccircle cx='820' cy='610' r='18' fill='none' stroke='%230f172a' stroke-width='5'/%3E%3Cpath d='M900 704h34m-17-17v34' stroke='%2310b981' stroke-width='8'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}


/* =========================================================
   Cabecera y Marca (Logo + Nombre)
   ========================================================= */

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
}



.login-brand::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -10px;
  width: 42px;
  height: 42px;
  transform: rotate(45deg);
  background: radial-gradient(circle, var(--login-primary) 1.3px, transparent 1.8px) 0 0 / 6px 6px, #0f172a;
  box-shadow: 6px 6px 0 rgba(16, 185, 129, 0.2);
}



.login-brand .logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}



.login-brand .logo:hover {
  transform: none;
  box-shadow: none;
}



:root[data-theme="dark"] .login-brand .logo {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}



.login-brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}



.login-brand .title {
  display: flex;
  flex-direction: column;
}
}

.login-brand .title .app-name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--login-text-title);
  line-height: 1.15;
}

.login-brand .title .subtitle {
  display: none;
}

/* =========================================================
   Formulario de Acceso
   ========================================================= */
@layer pages {
.login-content {
  align-self: center;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}
}

.login-heading {
  margin: 0 0 28px;
  color: var(--login-primary);
  font-family: var(--font-heading);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

@layer pages {
.login-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: none;
  margin: 0;
}



:where(.login-wrap) .form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
}

:where(.login-wrap) .form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--login-text-body);
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

:where(.login-wrap) .form-row:focus-within label {
  color: var(--login-primary);
}

/* =========================================================
   Campos de Entrada (Inputs)
   ========================================================= */
@layer pages {
:where(.login-wrap) .input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
}

:where(.login-wrap) .input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  background: var(--login-input-bg);
  color: var(--login-text-title);
  border: 1.5px solid var(--login-primary);
  border-radius: var(--login-radius-input);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--login-shadow-input);
  outline: none;
  box-sizing: border-box;
  transition: 
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

:where(.login-wrap) #password.input {
  padding-right: 48px;
}

:where(.login-wrap) .input::placeholder {
  color: var(--login-text-placeholder);
  font-weight: 400;
}

:where(.login-wrap) .input:hover:not(:focus) {
  border-color: var(--login-border-hover);
}

:where(.login-wrap) .input:focus {
  background: var(--login-input-focus-bg);
  border-color: var(--login-border-focus);
  box-shadow: 0 0 0 3.5px var(--login-primary-ring);
}

/* =========================================================
   Botón Mostrar / Ocultar Contraseña (Ojo / Ojo Tapado)
   ========================================================= */
@layer pages {
:where(.login-wrap) .toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
   /* Oculta emoji plano base */
  color: transparent;
  transition: 
    background-color 0.15s ease,
    transform 0.1s ease;
}
}
/* Compatibilidad con el tamaño de controles de compact.css. */
:where(.login-wrap) .toggle-pass {
  font-size: 0;
}

/* Icono vector: Ojo abierto (por defecto) */
@layer pages {
:where(.login-wrap) .toggle-pass::before {
  content: "";
  width: 20px;
  height: 20px;
  background-color: var(--login-text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: background-color 0.15s ease;
}


/* Icono vector: Ojo tapado / tachado (cuando la contraseña está visible) */

:where(.login-wrap) .toggle-pass[aria-pressed="true"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.88 9.88a3 3 0 1 0 4.24 4.24'/%3E%3Cpath d='M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68'/%3E%3Cpath d='M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61'/%3E%3Cline x1='2' x2='22' y1='2' y2='22'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.88 9.88a3 3 0 1 0 4.24 4.24'/%3E%3Cpath d='M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68'/%3E%3Cpath d='M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61'/%3E%3Cline x1='2' x2='22' y1='2' y2='22'/%3E%3C/svg%3E");
}



:where(.login-wrap) .toggle-pass:hover {
  background: rgba(16, 185, 129, 0.08);
}



:where(.login-wrap) .toggle-pass:hover::before {
  background-color: var(--login-primary);
}



:where(.login-wrap) .toggle-pass:active {
  transform: translateY(-50%) scale(0.92);
}


/* =========================================================
   Mensaje de Error
   ========================================================= */

:where(.login-wrap) .form-error {
  min-height: 0;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--login-error-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: 
    opacity 0.2s ease,
    max-height 0.25s ease,
    padding 0.2s ease,
    margin 0.2s ease;
}



:where(.login-wrap) .form-error.visible {
  opacity: 1;
  max-height: 60px;
  padding: 10px 14px;
  margin-top: 2px;
  background: var(--login-error-bg);
  border-color: var(--login-error-border);
}
}

/* =========================================================
   Botón de Envío Principal
   ========================================================= */
:where(.login-wrap) .btn-primary {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  padding: 0 24px;
  background: var(--login-primary);
  color: #063b30;
  border: none;
  border-radius: var(--login-radius-btn);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--login-shadow-btn);
  transition: 
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

:where(.login-wrap) .btn-primary:hover {
  background: var(--login-primary-hover);
  box-shadow: var(--login-shadow-btn-hover);
  transform: translateY(-1.5px);
}

:where(.login-wrap) .btn-primary:active {
  background: var(--login-primary-active);
  transform: translateY(0);
  box-shadow: var(--login-shadow-btn);
}

:where(.login-wrap) .btn-primary[disabled] {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

body.login-page .login-form .input {
  background: var(--login-input-bg);
  border-color: var(--login-primary);
  border-radius: 6px;
  box-shadow: none;
}

body.login-page .login-form .btn-primary {
  background: var(--login-primary);
  color: #063b30;
  border-radius: 6px;
  box-shadow: none;
}

body.login-page #loginForm #btnLogin {
  background: #10b981 !important;
  color: #063b30 !important;
  border: 0 !important;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.18) !important;
}

body.login-page .login-form .btn-primary:hover {
  background: var(--login-primary-hover);
  color: #ffffff;
}

/* Spinner animado cuando el formulario está procesando */
@layer pages {
:where(.login-wrap) form[aria-busy="true"] .btn-primary::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: loginSpinner 0.6s linear infinite;
}
}

@keyframes loginSpinner {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =========================================================
   Pie de Página (Copyright / Legal)
   ========================================================= */
@layer pages {
.login-foot {
  position: relative;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--login-text-muted);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
}



.login-foot small {
  display: block;
  opacity: 0.85;
}
}

:where(.login-wrap) .text-muted {
  color: var(--login-text-muted);
}

@layer pages {
:where(.login-wrap) .center {
  text-align: center;
}
}

/* =========================================================
   Diseño Responsivo
   ========================================================= */
@media (max-width: 860px) {
  body.login-page {
    padding: 0;
  }

  @layer pages {
.login-wrap {
    grid-template-columns: 1fr;
    max-width: none;
    min-height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
  }


  
.login-visual {
    display: none;
  }


  
.login-panel {
    padding: 32px 28px 24px;
  }


  
.login-panel::before,
  .login-panel::after,
  .login-brand::after {
    display: none;
  }


  
.login-brand {
    margin-bottom: 0;
  }


  
.login-form {
    max-width: none;
    margin: 0;
  }
}

  :where(.login-wrap) .btn-primary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body.login-page {
    padding: 0;
  }

  @layer pages {
.login-wrap {
    border-radius: 0;
    box-shadow: none;
  }


  
.login-panel {
    padding: 28px 20px 20px;
  }


  
.login-brand .logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }


  
.login-brand .logo img {
    width: 100%;
    height: 100%;
  }
}

  .login-brand .title .app-name {
    font-size: 21px;
  }

  :where(.login-wrap) .input {
    height: 46px;
    font-size: 13.5px;
  }

  :where(.login-wrap) .btn-primary {
    height: 46px;
    font-size: 14.5px;
  }
}

