* {
  box-sizing: border-box;
}

:root {
  --login-primary: #7c3aed;
  --login-primary-dark: #6d28d9;
  --login-primary-soft: #f4f0ff;
  --login-border: #ddd6fe;
  --login-text: #111827;
  --login-muted: #6b7280;
  --login-placeholder: #9ca3af;
  --login-danger: #dc2626;
  --login-success: #15803d;
}

/* =========================================================
   LOGIN PAGE
========================================================= */

body.login-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.25), transparent 34%),
    radial-gradient(circle at bottom right, rgba(147, 51, 234, 0.18), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f4f0ff 45%, #ede9fe 100%);
  color: var(--login-text);
  font-family: "Segoe UI", sans-serif;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--login-border);
  border-radius: 28px;
  padding: 34px 30px;
  box-shadow: 0 28px 70px rgba(109, 40, 217, 0.22);
  color: var(--login-text);
  animation: fadeIn 0.35s ease;
}

.login-back {
  position: absolute;
  top: 18px;
  left: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f5f3ff;
  color: var(--login-primary-dark);
  font-size: 28px;
  line-height: 31px;
  text-decoration: none;
  text-align: center;
  font-weight: 700;
  transition: 0.2s ease;
}

.login-back:hover {
  background: #ede9fe;
  color: #4c1d95;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 22px;
  margin-bottom: 14px;
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  color: var(--login-text);
}

.login-brand p {
  margin: 8px 0 0;
  color: var(--login-muted);
  font-size: 14px;
}

/* =========================================================
   CAMPOS
========================================================= */

.login-field,
.auth-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f7ff;
  border: 1.5px solid var(--login-border);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 14px;
  transition: 0.2s ease;
}

.login-field:focus-within,
.auth-field:focus-within {
  background: #ffffff;
  border-color: var(--login-primary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

.login-icon,
.auth-field span {
  font-size: 18px;
  line-height: 1;
}

.login-field > div,
.auth-field > div {
  flex: 1;
}

.login-field label,
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--login-primary);
  margin-bottom: 4px;
}

.login-field input,
.auth-field input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--login-text);
  font-size: 15px;
  padding: 0;
}

.login-field input::placeholder,
.auth-field input::placeholder {
  color: var(--login-placeholder);
}

.btn-toggle-pass {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  opacity: 0.65;
  padding: 0;
  transition: opacity 0.2s ease;
}

.btn-toggle-pass:hover {
  opacity: 1;
}

/* =========================================================
   BOTONES
========================================================= */

.btn-login,
.auth-main-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 14px;
  margin-top: 6px;
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #ffffff;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.32);
  cursor: pointer;
  transition: 0.25s ease;
}

.btn-login:hover,
.auth-main-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  box-shadow: 0 18px 38px rgba(124, 58, 237, 0.38);
}

.btn-login:active,
.auth-main-btn:active {
  transform: translateY(0);
}

.login-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 8px;
  color: var(--login-primary);
  font-size: 18px;
}

.login-register-link,
.auth-bottom-text {
  display: block;
  text-align: center;
  margin-top: 18px;
  color: var(--login-muted);
  font-size: 14px;
}

.login-register-link,
.auth-bottom-text a {
  color: var(--login-primary);
  font-weight: 800;
  text-decoration: none;
}

.login-register-link:hover,
.auth-bottom-text a:hover {
  color: #4c1d95;
  text-decoration: underline;
}

/* =========================================================
   ALERTAS
========================================================= */

.login-error-msg,
.auth-alert {
  padding: 11px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.login-error-msg,
.auth-alert.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: var(--login-danger);
}

.auth-alert.success {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: var(--login-success);
}

/* =========================================================
   MODAL AUTH INDEX
========================================================= */

.auth-dialog {
  max-width: 430px;
}

.auth-modal {
  position: relative;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--login-border);
  border-radius: 28px;
  padding: 30px 26px;
  box-shadow: 0 28px 70px rgba(109, 40, 217, 0.22);
  color: var(--login-text);
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f5f3ff;
  color: var(--login-primary-dark);
  font-size: 24px;
  line-height: 30px;
  cursor: pointer;
  z-index: 5;
  transition: 0.2s ease;
}

.auth-close:hover {
  background: #ede9fe;
  color: #4c1d95;
}

.auth-brand {
  text-align: center;
  margin-bottom: 22px;
  padding-top: 8px;
}

.auth-logo-img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border-radius: 22px;
  margin-bottom: 12px;
}

.auth-brand h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  color: var(--login-text);
}

.auth-brand p {
  margin: 8px 0 0;
  color: var(--login-muted);
  font-size: 14px;
}

.auth-tabs {
  display: flex;
  background: var(--login-primary-soft);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 20px;
  gap: 6px;
}

.auth-tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 10px;
  font-weight: 800;
  color: var(--login-primary);
  background: transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

.auth-tab.active {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.26);
}

.auth-body {
  margin-top: 4px;
}

/* =========================================================
   UTILIDADES
========================================================= */

.d-none {
  display: none !important;
}

/* =========================================================
   ANIMACIONES
========================================================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(6px);
  }
}

.shake {
  animation: shake 0.45s ease;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 480px) {
  .login-shell {
    padding: 16px;
  }

  .login-card,
  .auth-modal {
    padding: 30px 22px;
    border-radius: 24px;
  }

  .login-brand h1,
  .auth-brand h2 {
    font-size: 24px;
  }

  .login-logo-img,
  .auth-logo-img {
    width: 72px;
    height: 72px;
  }
}