/* ========================================
   Auth / Login - Variables y layout
   ======================================== */

:root {
  --auth-primary: #4aa6b7;
  --auth-primary-dark: #2e3f87;
  --auth-primary-blue: #4aa6b7;
  --auth-primary-color: #2f7f9b;
  --auth-primary-index: #2c3f51;
  --auth-shadow: 0 10px 25px rgba(11, 42, 90, 0.18);
  --auth-radius: 12px;
  --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-layout-body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  margin-bottom: 0;
}

.auth-login-container {
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    rgba(46, 63, 135, 0.95) 0%,
    rgba(74, 166, 183, 0.95) 50%,
    rgba(46, 63, 135, 0.95) 100%
  );
  background-size: 200% 200%;
  animation: authGradientShift 15s ease infinite;
}

@keyframes authGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.auth-panel-left {
  background: rgba(46, 63, 135, 0.35);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(11, 42, 90, 0.35);
}

/* Layout como en imagen de referencia: escudo y texto centrados, logo DVA esquina inferior derecha */
.auth-panel-reference {
  position: relative;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-reference-center {
  text-align: center;
  max-width: 420px;
}

.auth-reference-shield {
  max-width: 230px;
  max-height: 230px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-top: 1rem;
  margin-bottom: 0.15rem;
  margin-left: auto;
  margin-right: auto;
  transform: translateX(-132px);
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.3)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.auth-reference-subtitle {
  font-size: 1rem;
  font-weight: 500;
}

.auth-reference-list {
  text-align: left;
  margin-top: 0.75rem;
  margin-bottom: 0;
  padding-left: 1.5rem;
}

.auth-reference-list li {
  margin-bottom: 0.35rem;
}

.auth-dva-title {
  font-size: 7.5rem;
  letter-spacing: 0.05em;
}

.auth-dva-title-mobile {
  font-size: 2.25rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.auth-dva-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  margin-bottom: 0;
}

.auth-dva-subtitle-mobile {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

.auth-reference-dva-logo-wrap {
  margin-top: 0.75rem;
  text-align: right;
}

.auth-reference-dva-logo-wrap .auth-panel-logo-dva-corner {
  display: inline-block;
  transform: translateX(112px);
}

.auth-panel-logo-dva-corner {
  max-width: 230px;
  max-height: 230px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.3)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}


.auth-panel-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 2.6rem;
  box-shadow: var(--auth-shadow);
}

.auth-panel-logo {
  max-width: 420px;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
}

.auth-logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.auth-panel-logo-sm {
  max-width: 120px;
  max-height: 100px;
  height: auto;
  object-fit: contain;
}

.auth-form-logo {
  max-width: 140px;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
}

.auth-logo-dva {
  max-width: 100px;
  max-height: none;
}

.auth-panel-right {
  padding: 2rem;
}

/* Mantener siempre la división: izquierda = imágenes, derecha = acciones */
@media (min-width: 992px) {
  .auth-login-container .row {
    flex-wrap: nowrap;
  }
  .auth-login-container .row > [class*="col-lg-6"] {
    flex: 0 0 50%;
    max-width: 50%;
    min-width: 0;
  }
  .auth-login-container .auth-panel-left {
    display: flex !important;
  }
}

.auth-form-wrapper {
  max-width: 440px;
  margin: 0 auto;
}

/* Panel derecho: tarjeta blanca redondeada (diseño referencia) */
.auth-login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem 2rem 1.25rem;
  margin-bottom: 0;
}

.auth-login-card-header {
  margin-bottom: 1.75rem;
}

.auth-login-card-icon {
  font-size: 2.25rem;
  color: var(--auth-primary) !important;
  display: block;
  margin-bottom: 0.5rem;
}

.auth-login-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.auth-login-card-subtitle {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0;
}

.auth-login-card-label {
  color: #2c3e50;
  font-weight: 500;
}

.auth-login-card-input {
  background: #fff !important;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  color: #212529;
}

.auth-login-card-input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(74, 166, 183, 0.2);
}

.auth-login-card-btn {
  background: var(--auth-primary) !important;
  border-color: var(--auth-primary) !important;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.auth-login-card-btn:hover {
  background: var(--auth-primary-dark) !important;
  border-color: var(--auth-primary-dark) !important;
}

.auth-login-card-link {
  color: #6c757d;
  font-size: 0.9rem;
  text-decoration: none;
}

.auth-login-card-link:hover {
  color: var(--auth-primary);
  text-decoration: underline;
}

.auth-login-card-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eee;
}

.auth-login-card-footer-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.auth-login-card-footer-shield {
  width: 48px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-login-card-footer-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2c3e50;
}

.auth-login-card-footer-subtitle {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.15rem;
}

.auth-login-register {
  font-size: 1.05rem;
  font-weight: 500;
}

.auth-login-register-link {
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid #fff;
  border-radius: 8px;
  transition: background 0.2s, transform 0.2s;
}

.auth-login-register-link:hover {
  background: #fff;
  color: var(--auth-primary) !important;
  transform: translateY(-1px);
}

.auth-form-wrapper .form-control,
.auth-form-wrapper .form-control:focus {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--auth-radius);
}

.auth-security-note {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-security-note .text-muted {
  color: rgba(255, 255, 255, 0.92) !important;
}

.auth-form-wrapper .btn-app-primary,
.auth-form-wrapper .btn-primary {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
  border-radius: var(--auth-radius);
  color: #fff;
  font-weight: 600;
}

.auth-form-wrapper .btn-app-primary:hover,
.auth-form-wrapper .btn-app-primary:focus,
.auth-form-wrapper .btn-primary:hover,
.auth-form-wrapper .btn-primary:focus {
  background: var(--auth-primary-dark);
  border-color: var(--auth-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--auth-shadow);
}

.auth-panel-left ul li {
  margin-bottom: 0.4rem;
}

/* Vista móvil del login: logos y layout */
.auth-mobile-header {
  flex-shrink: 0;
}

/* Móvil: mismo criterio que referencia (centrado + logo DVA abajo-derecha) */
.auth-mobile-reference {
  position: relative;
  min-height: auto;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.auth-mobile-reference-center {
  text-align: center;
  max-width: 85%;
  margin-left: auto;
  margin-right: auto;
}

.auth-mobile-logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  flex-wrap: nowrap;
}

.auth-mobile-logo-inline {
  max-width: 72px;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-mobile-logos-row .auth-mobile-logo-main,
.auth-mobile-logos-row .auth-mobile-logo-dva-corner {
  transform: none;
}

.auth-mobile-reference-list {
  text-align: left;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.auth-mobile-dva-logo-wrap {
  margin-top: 0.5rem;
  text-align: right;
}

.auth-mobile-dva-logo-wrap .auth-mobile-logo-dva-corner {
  display: inline-block;
  transform: translateX(28px);
}

.auth-mobile-logo-dva-corner {
  max-width: 110px;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.auth-mobile-logo-main {
  max-width: 110px;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: translateX(-28px);
}

.auth-mobile-logo-sm {
  max-width: 80px;
  max-height: 70px;
  height: auto;
  object-fit: contain;
}

.auth-mobile-logo-dva {
  max-width: 130px;
}

@media (max-width: 991.98px) {
  .auth-login-container {
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .auth-login-container .row {
    min-height: auto;
  }

  .auth-panel-right {
    padding: 1rem 1.5rem 2rem;
    justify-content: flex-start;
    min-height: auto;
  }

  .auth-form-wrapper {
    flex-shrink: 0;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 100%;
  }

  .auth-form-wrapper .form-select,
  .auth-form-wrapper .form-control {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 2.75rem;
    font-size: 1rem;
  }

  .auth-register-modal .form-select,
  .auth-register-modal .form-control {
    width: 100% !important;
    min-height: 2.75rem;
    font-size: 1rem;
  }
}

/* ========================================
   Auth / Register - Modal centrado
   ======================================== */

.auth-register-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    rgba(46, 63, 135, 0.95) 0%,
    rgba(74, 166, 183, 0.95) 50%,
    rgba(46, 63, 135, 0.95) 100%
  );
  background-size: 200% 200%;
  animation: authGradientShift 15s ease infinite;
}

.auth-register-modal {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  box-shadow:
    0 25px 50px rgba(11, 42, 90, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  padding: 2.5rem;
  transition: var(--auth-transition);
}

.auth-register-wrapper {
  max-width: 580px;
}

.auth-register-wrapper .auth-register-modal {
  max-width: 100%;
}

.auth-register-modal:hover {
  box-shadow:
    0 30px 60px rgba(11, 42, 90, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.auth-register-modal .form-control,
.auth-register-modal .form-control:focus {
  background: #fff;
  border-radius: var(--auth-radius);
  border: 1px solid rgba(46, 63, 135, 0.2);
}

.auth-register-modal .form-label {
  color: var(--auth-primary-index);
  font-weight: 500;
}

.auth-register-modal .btn-app-primary,
.auth-register-modal .btn-primary {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
  border-radius: var(--auth-radius);
  color: #fff;
  font-weight: 600;
}

.auth-register-modal .btn-app-primary:hover,
.auth-register-modal .btn-app-primary:focus,
.auth-register-modal .btn-primary:hover,
.auth-register-modal .btn-primary:focus {
  background: var(--auth-primary-dark);
  border-color: var(--auth-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--auth-shadow);
}

.auth-register-modal .auth-register-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    var(--auth-primary) 0%,
    var(--auth-primary-dark) 100%
  );
  color: #fff;
  font-size: 2rem;
  box-shadow: var(--auth-shadow);
}

/* Toast / banner para mensajes de alerta (rojo claro, borde rojo) */
.app-alert-toast {
  background-color: #fef2f2;
  border: 2px solid #ef4444;
  border-radius: var(--auth-radius, 12px);
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.app-alert-toast .btn-close {
  filter: none;
  opacity: 0.7;
}

.app-alert-toast a {
  color: #b91c1c;
  font-weight: 600;
  text-decoration: underline;
}

.app-alert-toast a:hover {
  color: #991b1b;
}
