/* ========================================================= */
/* GENERAL */
/* ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
}

/* ========================================================= */
/* LOGIN */
/* ========================================================= */

.eurosystem-login {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #e5edf2;
  animation: loginPageIn 0.8s ease-out both;
}

/* ========================================================= */
/* FONDO */
/* ========================================================= */

.login-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #e5edf2;
}

/* ========================================================= */
/* IMAGEN */
/* ========================================================= */

.login-background-image {
  position: absolute;
  inset: 0;
  background-image: url('/img/fondo/DJI_0290.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.9;
  filter: grayscale(100%) contrast(80%);
  animation: backgroundIn 1.4s ease-out both;
}

/* ========================================================= */
/* OVERLAY */
/* ========================================================= */

.login-background-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(235, 243, 248, 0.55) 0%,
    rgba(222, 234, 241, 0.42) 50%,
    rgba(208, 224, 234, 0.58) 100%);
  animation: overlayIn 1.1s ease-out both;
}

/* ========================================================= */
/* PATRON */
/* ========================================================= */

.login-background-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: linear-gradient(30deg,
      rgba(20, 90, 141, 0.045) 12%,
      transparent 12.5%,
      transparent 87%,
      rgba(20, 90, 141, 0.045) 87.5%,
      rgba(20, 90, 141, 0.045)),
    linear-gradient(150deg,
      rgba(20, 90, 141, 0.045) 12%,
      transparent 12.5%,
      transparent 87%,
      rgba(20, 90, 141, 0.045) 87.5%,
      rgba(20, 90, 141, 0.045));
  background-size: 100px 173px, 100px 173px;
  background-position: 0 0, 50px 86px;
}

/* ========================================================= */
/* FORMA AZUL */
/* ========================================================= */

.background-blue-shape {
  position: absolute;
  top: -15%;
  right: -12%;
  width: 48%;
  height: 130%;
  background: linear-gradient(135deg, rgba(8, 63, 105, 0.05), rgba(20, 90, 141, 0.13));
  transform: rotate(12deg);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

/* ========================================================= */
/* LINEAS AZULES */
/* ========================================================= */

.background-blue-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(20, 90, 141, 0.20), transparent);
  opacity: 0.7;
}

.blue-line-one {
  width: 650px;
  right: -100px;
  top: 24%;
  transform: rotate(-35deg);
}

.blue-line-two {
  width: 500px;
  left: -120px;
  bottom: 20%;
  transform: rotate(-35deg);
  opacity: 0.35;
}

/* ========================================================= */
/* GRID DE PUNTOS */
/* ========================================================= */

.background-dot-grid {
  position: absolute;
  right: 5%;
  bottom: 10%;
  width: 180px;
  height: 130px;
  opacity: 0.25;
  background-image: radial-gradient(rgba(20, 90, 141, 0.30) 1px, transparent 1px);
  background-size: 14px 14px;
  mask-image: linear-gradient(135deg, transparent, black);
}

/* ========================================================= */
/* CIRCULOS */
/* ========================================================= */

.background-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(20, 90, 141, 0.07);
  background: rgba(20, 90, 141, 0.018);
}

.circle-one {
  width: 900px;
  height: 900px;
  left: -600px;
  top: -550px;
}

.circle-two {
  width: 800px;
  height: 800px;
  right: -520px;
  bottom: -550px;
}

.circle-three {
  width: 400px;
  height: 400px;
  right: 15%;
  top: -250px;
}

/* ========================================================= */
/* LINEAS */
/* ========================================================= */

.background-line {
  position: absolute;
  width: 1200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(20, 90, 141, 0.08), transparent);
}

.line-one {
  left: -300px;
  top: 23%;
  transform: rotate(-23deg);
}

.line-two {
  right: -350px;
  bottom: 25%;
  transform: rotate(-23deg);
}

/* ========================================================= */
/* ONDA AZUL */
/* ========================================================= */

.login-wave {
  position: absolute;
  z-index: 2;
  right: -8%;
  bottom: -90px;
  width: 115%;
  height: 250px;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(20, 90, 141, 0.00) 0%,
    rgba(20, 90, 141, 0.025) 25%,
    rgba(20, 90, 141, 0.06) 55%,
    rgba(20, 90, 141, 0.11) 78%,
    rgba(20, 90, 141, 0.16) 100%);
  border-radius: 55% 45% 0 0 / 70% 90% 0 0;
  transform: rotate(-4deg);
}

.login-wave::before {
  content: "";
  position: absolute;
  right: -5%;
  top: -45px;
  width: 110%;
  height: 150px;
  border-top: 1px solid rgba(20, 90, 141, 0.10);
  border-radius: 50%;
  transform: rotate(3deg);
}

.login-wave::after {
  content: "";
  position: absolute;
  right: 0;
  top: -20px;
  width: 95%;
  height: 100px;
  border-top: 1px solid rgba(20, 90, 141, 0.055);
  border-radius: 50%;
  transform: rotate(2deg);
}

/* ========================================================= */
/* IDENTIDAD EUROSYSTEM */
/* ========================================================= */

.login-top-brand {
  position: absolute;
  z-index: 10;
  top: 34px;
  left: 45px;
  display: flex;
  align-items: center;
  gap: 18px;
  animation: brandIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.brand-slogan {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.90);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.55px;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(5, 35, 55, 0.55);
}

/* ========================================================= */
/* ESPACIO PARA LOGO */
/* ========================================================= */

.brand-logo-space {
  width: 115px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-space img {
  width: 100%;
  max-width: 115px;
  max-height: 58px;
  height: auto;
  object-fit: contain;
}

/* ========================================================= */
/* NOMBRE DEL SISTEMA */
/* ========================================================= */

.brand-name {
  position: relative;
  padding-bottom: 7px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(5, 35, 55, 0.35);
}

.brand-euro,
.brand-system {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 2.2px;
}

.brand-euro {
  color: #ffffff;
  text-shadow: -1px -1px 0 #123b55, 1px -1px 0 #123b55, -1px 1px 0 #123b55, 1px 1px 0 #123b55, 0 3px 8px rgba(0, 0, 0, 0.40);
}

.brand-system {
  color: #2b83b8;
  text-shadow: -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff, 1px 1px 0 #ffffff, 0 2px 7px rgba(0, 0, 0, 0.35);
}

.brand-slogan {
  margin-top: 12px;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.55px;
  white-space: nowrap;
  text-shadow: -1px -1px 0 #123b55, 1px -1px 0 #123b55, -1px 1px 0 #123b55, 1px 1px 0 #123b55, 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* ========================================================= */
/* LINEA AZUL */
/* ========================================================= */

.brand-name-line {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42px;
  height: 2px;
  border-radius: 4px;
  background: #2b83b8;
  opacity: 0.85;
}

/* ========================================================= */
/* AREA CENTRAL */
/* ========================================================= */

.login-main {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 30px 80px;
}

/* ========================================================= */
/* TARJETA */
/* ========================================================= */

.login-card {
  width: 470px;
  max-width: 100%;
  padding: 46px 48px 36px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(28, 63, 83, 0.17), 0 5px 18px rgba(28, 63, 83, 0.07);
  backdrop-filter: blur(10px);
  animation: cardIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

/* ========================================================= */
/* CABECERA */
/* ========================================================= */

.form-header {
  margin-bottom: 34px;
}

/* ========================================================= */
/* INDICADOR */
/* ========================================================= */

.access-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  width: 100%;
}

.access-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #d5e5ee;
  border-radius: 7px;
  background: #eef6fa;
  color: #145a8d;
  font-size: 0.82rem;
}

.access-label {
  color: #5f7c90;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 1.15px;
  white-space: nowrap;
}

/* ========================================================= */
/* LINEA DE IDENTIDAD */
/* ========================================================= */

.access-line {
  width: 55px;
  height: 2px;
  margin-left: 4px;
  border-radius: 10px;
  background: linear-gradient(90deg, #2b83b8, rgba(43, 131, 184, 0));
  opacity: 0.7;
}

/* ========================================================= */
/* TITULO */
/* ========================================================= */

.form-header h1 {
  margin: 0 0 8px;
  color: #263746;
  font-size: 1.65rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* ========================================================= */
/* DESCRIPCION */
/* ========================================================= */

.form-header p {
  margin: 0;
  color: #8996a0;
  font-size: 0.81rem;
  line-height: 1.5;
}

/* ========================================================= */
/* CAMPOS */
/* ========================================================= */

.form-field {
  margin-bottom: 21px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  color: #344454;
  font-size: 0.78rem;
  font-weight: 600;
}

.modern-input {
  height: 50px;
  display: flex;
  align-items: center;
  border: 1px solid #d9e2e7;
  border-radius: 9px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modern-input i {
  width: 48px;
  flex-shrink: 0;
  text-align: center;
  color: #8493a0;
  font-size: 0.98rem;
}

.modern-input input {
  width: 100%;
  height: 100%;
  padding: 0 13px 0 0;
  border: none;
  outline: none;
  background: transparent;
  color: #263746;
  font-size: 0.83rem;
}

.modern-input input::placeholder {
  color: #a8b1b9;
}

.modern-input:focus-within {
  border-color: #2878ad;
  box-shadow: 0 0 0 3px rgba(40, 120, 173, 0.08);
}

.modern-input:focus-within > i:first-child {
  color: #145a8d;
}

/* ========================================================= */
/* PASSWORD TOGGLE */
/* ========================================================= */

.password-input {
  padding-right: 4px;
}

.password-toggle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #8a98a3;
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.password-toggle:hover {
  color: #145a8d;
  background: #eef5f9;
}

.password-toggle:focus {
  outline: none;
  color: #145a8d;
}

/* ========================================================= */
/* CAPTCHA */
/* ========================================================= */

.captcha-field {
  margin-bottom: 21px;
}

.captcha-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  padding: 10px;
  margin-bottom: 9px;
  border: 1px solid #e0e6ea;
  border-radius: 9px;
  background: #f7fafc;
}

/* ========================================================= */
/* IMAGEN CAPTCHA */
/* ========================================================= */

.captcha-image-container {
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 1px solid #dce3e8;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.captcha {
  display: block;
  width: 100%;
  height: 60px;
  object-fit: fill;
}

/* ========================================================= */
/* LEYENDA CAPTCHA */
/* ========================================================= */

.captcha-description {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 3px 1px;
  color: #145a8d;
  font-size: 0.70rem;
  line-height: 1.4;
  font-weight: 500;
}

.captcha-description i {
  flex-shrink: 0;
  color: #2b83b8;
  font-size: 0.82rem;
}

/* ========================================================= */
/* INPUT CAPTCHA */
/* ========================================================= */

.captcha-input {
  width: 100%;
}

/* ========================================================= */
/* SMALL */
/* ========================================================= */

.form-field small {
  display: block;
  margin-top: 5px;
  color: #929da6;
  font-size: 0.7rem;
}

/* ========================================================= */
/* ERROR */
/* ========================================================= */

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 18px;
  border: 1px solid #f1d1d1;
  border-radius: 8px;
  background: #fff5f5;
  color: #a52a2a;
}

.error-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
}

.login-error strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.75rem;
}

.login-error span {
  display: block;
  color: #a34a4a;
  font-size: 0.69rem;
  line-height: 1.4;
}

/* ========================================================= */
/* BOTON */
/* ========================================================= */

.login-submit {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  background: linear-gradient(135deg, #104f7e 0%, #176c9f 100%);
  color: #ffffff;
  font-size: 0.83rem;
  font-weight: 600;
  box-shadow: 0 7px 18px rgba(16, 79, 126, 0.20);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.login-submit:hover {
  color: #ffffff;
  transform: translateY(-1px);
  filter: brightness(0.97);
  box-shadow: 0 10px 23px rgba(16, 79, 126, 0.25);
}

.login-submit:active {
  transform: translateY(0);
}

.login-submit i {
  transition: transform 0.15s ease;
}

.login-submit:hover i {
  transform: translateX(3px);
}

/* ========================================================= */
/* SEGURIDAD */
/* ========================================================= */

.login-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  color: #9ba5ad;
  font-size: 0.65rem;
}

.login-security i {
  color: #6c8da4;
}

/* ========================================================= */
/* ESLOGAN */
/* ========================================================= */

.login-slogan {
  position: absolute;
  z-index: 4;
  left: 8%;
  bottom: 65px;
  color: rgba(20, 90, 141, 0.48);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.login-slogan::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  margin-right: 9px;
  vertical-align: middle;
  background: rgba(20, 90, 141, 0.35);
}

/* ========================================================= */
/* FOOTER */
/* ========================================================= */

.login-company {
  position: absolute;
  z-index: 10;
  right: 42px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.88;
}

.company-logo {
  width: 115px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-logo img {
  max-width: 115px;
  max-height: 42px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.company-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 12px;
  border-left: 1px solid rgba(20, 90, 141, 0.18);
}

.company-info strong {
  color: rgba(255, 255, 255, 0.90);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 8px rgba(20, 90, 141, 0.25);
}

.company-info span {
  color: rgba(255, 255, 255, 0.60);
  font-size: 0.55rem;
  letter-spacing: 0.35px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ========================================================= */
/* PASSWORD MODAL */
/* ========================================================= */

.password-modal {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.20);
}

.password-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 24px 28px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b3d65, #145a8d);
}

.password-header-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.15rem;
}

.password-header h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}

.password-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.70);
  font-size: 0.72rem;
}

.password-body {
  padding: 28px;
}

.password-footer {
  padding: 18px 28px 22px;
  border-top: 1px solid #edf0f2;
  background: #fafbfc;
}

/* ========================================================= */
/* NAVBAR */
/* ========================================================= */

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
}

.user-menu > i:first-child {
  font-size: 1.1rem;
}

.user-arrow {
  margin-left: 3px;
  font-size: 0.65rem;
  opacity: 0.65;
}

/* ========================================================= */
/* RESPONSIVE */
/* ========================================================= */

@media (max-width: 700px) {
  .login-top-brand {
    top: 20px;
    left: 24px;
  }

  .login-top-brand img {
    width: 135px;
  }

  .login-main {
    padding: 75px 20px 65px;
  }

  .login-card {
    width: 100%;
    max-width: 430px;
    padding: 35px 28px 28px;
    border-radius: 15px;
  }

  .form-header {
    margin-bottom: 28px;
  }

  .login-slogan {
    display: none;
  }

  .login-footer {
    display: none;
  }

  .background-blue-shape {
    width: 75%;
    right: -35%;
  }
}

@media (max-width: 450px) {
  .login-top-brand {
    left: 20px;
  }

  .login-top-brand img {
    width: 120px;
  }

  .login-main {
    padding: 65px 14px 55px;
  }

  .login-card {
    padding: 30px 21px 25px;
  }

  .access-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 17px;
  }

  .access-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #eef6fa;
    border: 1px solid #d9e7ef;
    color: #145a8d;
    font-size: 0.82rem;
  }

  .access-label {
    color: #5f7c90;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.2px;
  }

  .form-header h1 {
    font-size: 1.4rem;
  }

  .form-header p {
    font-size: 0.75rem;
  }

  .captcha-box {
    width: 100%;
    padding: 9px;
    gap: 8px;
  }

  .captcha-image-container {
    width: 100%;
    height: 68px;
  }

  .captcha {
    width: 100%;
    height: 58px;
    object-fit: fill;
  }

  .captcha-description {
    width: 100%;
    padding: 2px 3px;
    font-size: 0.68rem;
  }

  .login-footer {
    display: none;
  }
}

/* ========================================================= */
/* ANIMACION DE INICIO */
/* ========================================================= */

@keyframes loginPageIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes backgroundIn {
  from {
    opacity: 0;
    transform: scale(1.04);
  }

  to {
    opacity: 0.8;
    transform: scale(1);
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes brandIn {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(25px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sloganIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes footerIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================= */
/* ACCESIBILIDAD */
/* ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .eurosystem-login,
  .login-background-image,
  .login-background-overlay,
  .login-top-brand,
  .login-card,
  .login-slogan,
  .login-footer {
    animation: none;
  }
}
