/* ========== RESET GLOBAL ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #00f7ff;
  --primary-dark: #00c8d0;
  --login-primary: #27cec1;
  --login-primary-dark: #27cec1;
  --login-text-light: #ffffff;
  --login-text-muted: rgba(255, 255, 255, 0.7);
  --login-bg-overlay: rgba(0, 0, 0, 0.5);
  --login-input-bg: rgba(255, 255, 255, 0.15);
  --login-input-border: rgba(255, 255, 255, 0.3);
  --login-card-bg: rgba(0, 0, 0, 0.3);
  --login-success: #2ecc71;
  --login-error: #e74c3c;
  --login-glass-bg: rgba(20, 30, 40, 0.3);
  --login-glass-border: rgba(255, 255, 255, 0.15);
  --login-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
  --login-neon-cyan: #27cec1;
  --login-neon-red: #e74c3c;
  --login-transition-fast: 0.2s ease;
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  overflow-x: hidden;
  min-height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: #06060d;
  color: var(--login-text-light);
  line-height: 1.5;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.blur-bg {
  position: fixed;
  top: -20px;
  left: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  background: url('../images/INICIO.PNG') no-repeat center center fixed;
  background-size: cover;
  filter: blur(15px) brightness(0.8);
  transform: scale(1.02);
  z-index: -2;
}

.page-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(5, 12, 20, 0.4);
  border-bottom: 1px solid rgba(0, 247, 255, 0.25);
  z-index: 1000;
  box-sizing: border-box;
}

.page-header .header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header .brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.page-header .brand h1 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}

.page-header .brand h1 span {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 1px;
}

.page-header .brand h6 {
  color: #fff;
  font-family: 'Poppins', 'Inter', sans-serif;
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.8;
}

.page-header .header-tag {
  background: rgba(0, 247, 255, 0.12);
  backdrop-filter: blur(4px);
  padding: 0.4rem 1.2rem;
  border-radius: 40px;
  border: 1px solid rgba(0, 247, 255, 0.3);
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-header .header-tag i {
  color: var(--primary);
}

#view-auth {
  margin-top: 10px; /* o el valor que quieras */
}

.main-panel {
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  flex: 0 1 auto;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-logo {
  text-align: center;
  margin-bottom: 20px;
}

.logo-image {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: inline-block;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
}

@media (min-width: 769px) {
  .logo-image {
    max-width: 300px;
  }
}

.view-section {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: var(--login-transition-fast);
}
.view-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

#auth-title {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--login-text-muted);
}

/* Inputs */
.input-group {
  position: relative;
  margin-bottom: 25px;
}
.input-group i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--login-text-muted);
  font-size: 1.1rem;
  transition: var(--login-transition-fast);
  z-index: 2;
}
.glass-input {
  width: 100%;
  background: var(--login-input-bg);
  border: 1px solid var(--login-input-border);
  border-radius: 40px;
  padding: 15px 20px 15px 50px;
  color: var(--login-text-light);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: var(--login-transition-fast);
  backdrop-filter: blur(5px);
}
.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}
.glass-input:focus {
  border-color: var(--login-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
  background: rgba(255, 255, 255, 0.2);
}
.glass-input:focus + i {
  color: var(--login-primary);
}

/* Botones */
.glass-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 40px;
  background: var(--login-primary);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--login-transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  margin-top: 10px;
}
.glass-btn:hover {
  background: var(--login-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}
.glass-btn:active {
  transform: scale(0.98);
}

.loader {
  display: none;
  width: 26px;
  height: 26px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.btn-text.loading { display: none; }
.glass-btn.loading .loader { display: block; }

.auth-toggle {
  text-align: center;
  margin-top: 25px;
  font-size: 0.9rem;
  color: var(--login-text-muted);
}
.auth-toggle span {
  color: var(--login-primary);
  cursor: pointer;
  font-weight: 600;
  transition: var(--login-transition-fast);
}
.auth-toggle span:hover {
  text-decoration: underline;
  opacity: 0.9;
}

/* Avatares */
.avatar-section {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0 25px;
  flex-wrap: wrap;
}
.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: var(--login-transition-fast);
}
.avatar-img {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px;
  background-clip: content-box;
  animation: avatarFloat 4s ease-in-out infinite;
}
.avatar-item:nth-child(1) .avatar-img { animation-delay: 0s; }
.avatar-item:nth-child(2) .avatar-img { animation-delay: 0.5s; }
.avatar-item:nth-child(3) .avatar-img { animation-delay: 1s; }
.avatar-item:nth-child(4) .avatar-img { animation-delay: 1.5s; }
@keyframes avatarFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}
.avatar-item:hover .avatar-img {
  transform: scale(1.15) translateY(-5px);
  border-color: var(--login-primary);
  box-shadow: 0 15px 30px var(--login-primary);
  animation-play-state: paused;
}
.avatar-label {
  font-size: 0.7rem;
  color: var(--login-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--login-transition-fast);
  font-weight: 400;
}
.avatar-item:hover .avatar-label {
  color: var(--login-primary);
  font-weight: 600;
}

.system-menu {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-around;
  gap: 10px;
}
.sys-link {
  color: var(--login-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--login-transition-fast);
  text-decoration: none;
  font-weight: 400;
}
.sys-link:hover {
  color: var(--login-primary);
  text-decoration: underline;
  text-underline-offset: 5px;
}

#toast-container {
  position: fixed;
  top: 85px;
  right: 25px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  background: rgba(20, 20, 30, 0.9);
  backdrop-filter: blur(10px);
  border-left: 5px solid var(--login-primary);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 320px;
  word-wrap: break-word;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast.success { border-left-color: var(--login-success); }
.toast.error { border-left-color: var(--login-error); }
.toast.info { border-left-color: var(--login-primary); }

/* ========== FOOTER ========== */
.global-footer {
  position: relative;
  text-align: center;
  width: 100%;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  z-index: 10;
  letter-spacing: 1px;
  margin-top: 2rem;
  padding: 1rem 0;
}
.global-footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.3s;
}
.global-footer a:hover {
  color: var(--login-primary);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #001219;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: #00f7ff;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00c4cc;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #00f7ff #001219;
}

@media (max-width: 768px) {
  .page-header {
    position: fixed !important;
    top: 0;
    width: 100%;
    z-index: 1000 !important;
    padding: max(1rem, env(safe-area-inset-top)) 1.5rem 1rem !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(5, 12, 20, 0.7) !important;
  }
  .page-header .header-inner {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .page-header .brand h1 {
    font-size: 1.1rem !important;
  }
  .page-header .header-tag {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .main-panel {
    max-width: 100%;
    padding: 1.5rem 1.25rem 1.5rem;
    margin: 0 auto;
    margin-top: 18dvh;
    flex: 0 1 auto;
    justify-content: center;
    max-height: 80dvh;
    overflow-y: auto;
  }

  .logo-image {
    max-width: 200px !important;
  }

  .glass-input {
    font-size: 16px;
  }
  .input-group i {
    font-size: 1.2rem;
  }

  .avatar-img {
    width: 65px !important;
    height: 65px !important;
  }
  .avatar-section {
    gap: 15px;
  }

  .glass-btn {
    height: 55px;
    border-radius: 14px;
    font-size: 16px;
  }

  .system-menu {
    flex-direction: column;
    gap: 12px !important;
    margin-top: 30px !important;
  }
  .sys-link {
    font-size: 0.8rem;
    padding: 8px;
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  #toast-container {
    z-index: 1100 !important;
    top: calc(75px + env(safe-area-inset-top)) !important;
    right: 50% !important;
    transform: translateX(50%) !important;
    left: auto !important;
    width: 90%;
    max-width: 350px;
    align-items: center;
  }
  .toast {
    width: 100%;
    font-size: 14px;
    padding: 12px 16px;
    text-align: center;
    transform: translateY(-20px) !important;
  }
  .toast.show {
    transform: translateY(0) !important;
  }

  .global-footer {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom)) !important;
    font-size: 0.7rem;
    margin-top: auto;
  }
}

@media (max-width: 360px) {
  .avatar-img {
    width: 55px !important;
    height: 55px !important;
  }
  .page-header .brand h1 {
    font-size: 1rem !important;
  }
}