@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
}

body {
  font-family: 'Poppins', sans-serif;
  min-height: 100dvh;
  background-color: #f4f6f9;
}

.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
}

.login-container {
  flex: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  padding: clamp(16px, 3vw, 40px);
}

.login-panel {
  width: 100%;
  max-width: 350px;
  text-align: center;
}

.logo img {
  width: 100%;
  height: auto;
  max-width: 260px;
  margin: 0 auto 20px;
  display: block;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.floating-group {
  position: relative;
}

.floating-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease-in-out;
  background: white;
}

.floating-label {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 16px;
  color: #333;
  background: white;
  padding: 0 5px;
  transition: all 0.3s ease;
  pointer-events: none;
}

.floating-input:focus,
.floating-input:not(:placeholder-shown) {
  border-color: #0051ff;
}

.floating-input:focus + .floating-label,
.floating-input:not(:placeholder-shown) + .floating-label {
  transform: translateY(-38px) scale(0.9);
  background: white;
  color: #0051ff;
  padding: 0 5px;
}

.password-control{
  position: relative;
  width: 100%;
}

.floating-group--password .password-control .floating-input{
  padding-right: 48px;
}

.floating-group--password .password-control .floating-label{
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
}

.floating-group--password .password-control .floating-input:focus + .floating-label,
.floating-group--password .password-control .floating-input:not(:placeholder-shown) + .floating-label{
  transform: translateY(-38px) scale(0.9);
  background: white;
  color: #0051ff;
  padding: 0 5px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
  z-index: 30;
}

.password-toggle:focus,
.password-toggle:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.password-toggle i {
  font-size: 20px;
  line-height: 1;
  color: #929292;
}

.password-toggle:hover i {
  color: #686666;
}

.password-toggle:active i {
  transform: scale(0.92);
}

.password-toggle .icon-eye--hide {
  display: none;
}

.password-toggle.is-on .icon-eye--show {
  display: none;
}

.password-toggle.is-on .icon-eye--hide {
  display: inline-block;
}

button.btn.btn-primary {
  width: 100%;
  background: #0066cc;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  padding: 12px;
  transition: background 0.3s;
}

button.btn.btn-primary:disabled {
  background: #d3d3d3;
  cursor: not-allowed;
}

button.btn.btn-primary:hover:not(:disabled) {
  background: #004c99;
}

.forgot-password {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: #0066cc;
  text-decoration: none;
}

.forgot-password:hover {
  text-decoration: underline;
}

.image-container {
  flex: 60%;
  background: url('../img/egr-10.webp') no-repeat center center;
  background-size: cover;
  background-position: center;
  min-height: 100dvh;
}

.swal2-confirm.btn-confirmar {
  background-color: #0066cc !important;
  color: white !important;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  box-shadow: none;
}

.password-popover {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 20;
}

.password-popover ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.password-popover li {
  margin-bottom: 6px;
  color: #888;
  transition: color 0.3s;
}

.password-popover li.valid {
  color: #2e7d32;
  font-weight: bold;
}

.password-popover[hidden] {
  display: none;
}

.no-match-warning {
  font-size: 14px;
  color: #d32f2f;
  margin-top: -8px;
}

.no-match-warning:empty {
  display: none;
}

.no-match-warning:not(:empty) {
  display: block;
}

.floating-group--password {
  position: relative;
}

.password-toggle {
  z-index: 30;
}

.password-popover {
  z-index: 20;
}

.floating-group--password .password-popover {
  pointer-events: auto;
}

@media (max-width: 1024px) {
  .login-wrapper {
    flex-direction: column;
  }

  .image-container {
    display: none;
  }

  .login-container {
    flex: 1 1 auto;
    width: 100%;
    min-height: 100dvh;
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .login-panel {
    max-width: 360px;
  }

  .floating-input {
    font-size: 14px;
    padding: 10px;
  }

  .floating-label {
    font-size: 14px;
  }

  button.btn.btn-primary {
    font-size: 16px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 16px;
  }

  .login-panel {
    max-width: 320px;
  }

  .logo img {
    max-width: 220px;
    margin-bottom: 16px;
  }

  .floating-input {
    padding: 9px;
  }

  .floating-label {
    font-size: 13px;
  }

  button.btn.btn-primary {
    font-size: 14px;
  }
}