/* ============================================
   INTRO.CSS - ESTILOS PARA LOGIN Y PÁGINAS DE INTRO
   ============================================ */

/* ============================================
   RESET Y BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Raleway', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f2f5;
  color: #2d3748;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   FONDO CON IMAGEN back2.png
   ============================================ */
body#intro {
  background-image: url('../img/back2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
}

/* Overlay oscuro para mejorar legibilidad */
body#intro::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

/* Asegurar que el contenido esté por encima del overlay */
body#intro > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   LINKS
   ============================================ */
a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  text-decoration: none;
}

/* ============================================
   NAVBAR - CON FONDO TRANSPARENTE/VIDRIO
   ============================================ */
.navbar-custom {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.6rem 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.navbar-custom .navbar-brand {
  padding: 0;
  display: flex;
  align-items: center;
}

.navbar-custom .navbar-brand img {
  max-height: 45px;
  width: auto;
  transition: all 0.3s ease;
}

.navbar-custom .navbar-brand img:hover {
  transform: scale(1.02);
}

.navbar-custom .navbar-nav {
  gap: 2px;
}

.navbar-custom .nav-link {
  color: #2d3748 !important;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem !important;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-custom .nav-link:hover {
  color: #1d1680 !important;
  background: rgba(29, 22, 128, 0.08);
}

.navbar-custom .nav-link.active {
  color: #1d1680 !important;
  font-weight: 700;
  background: rgba(29, 22, 128, 0.12);
}

.navbar-custom .nav-link i {
  font-size: 1.1rem;
}

.navbar-custom .navbar-toggler {
  border: none;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  color: #4a5568;
  background: rgba(255, 255, 255, 0.5);
}

.navbar-custom .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(29, 22, 128, 0.15);
}

.navbar-custom .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(29, 22, 128, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   LOGIN CARD - CON FONDO VIDRIO
   ============================================ */
.login-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  min-height: calc(100vh - 76px - 60px);
}

.login-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 2.2rem 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.login-card:hover {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.20);
  transform: translateY(-4px);
}

/* Logo y título */
.login-logo {
  text-align: center;
  margin-bottom: 1.2rem;
}

.login-logo img {
  max-width: 60%;
  height: auto;
  transition: all 0.3s ease;
}

.login-logo img:hover {
  transform: scale(1.02);
}

.login-title {
  font-weight: 800;
  font-size: 1.3rem;
  color: #1d1680;
  letter-spacing: 2px;
  margin-top: 0.3rem;
  text-transform: uppercase;
  font-family: 'Raleway', sans-serif;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.login-subtitle {
  font-size: 0.8rem;
  color: #718096;
  font-weight: 400;
  margin-top: -0.2rem;
}

/* Divisor */
.login-divider {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(29, 22, 128, 0.2), transparent);
  opacity: 0.4;
  margin: 0.8rem 0;
}

/* Formulario */
.login-card .form-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: #2d3748;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-card .form-label i {
  color: #1d1680;
  font-size: 0.9rem;
}

.login-card .form-control {
  border: 2px solid rgba(226, 232, 240, 0.8);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-family: 'Raleway', sans-serif;
  transition: all 0.3s ease;
  background: rgba(247, 250, 252, 0.8);
  color: #2d3748;
}

.login-card .form-control:focus {
  border-color: #1d1680;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(29, 22, 128, 0.10);
  outline: none;
}

.login-card .form-control::placeholder {
  color: #a0aec0;
  font-size: 0.8rem;
  font-weight: 400;
}

.login-card .form-control.is-invalid {
  border-color: #fc8181;
  box-shadow: 0 0 0 4px rgba(252, 129, 129, 0.15);
}

/* Input grupo RUT */
.input-group-rut {
  display: flex;
  gap: 10px;
}

.input-group-rut .col-rut {
  flex: 3;
}

.input-group-rut .col-dv {
  flex: 1;
}

.input-group-rut .col-dv input {
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Botón Login */
.btn-login {
  background: linear-gradient(135deg, #1d1680 0%, #2a1f9e 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  letter-spacing: 1.5px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transition: left 0.5s ease;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(29, 22, 128, 0.40);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(29, 22, 128, 0.25);
}

.btn-login i {
  font-size: 1.2rem;
}

/* Ayuda */
.login-help {
  text-align: center;
  font-size: 0.7rem;
  color: #718096;
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.login-help i {
  color: #1d1680;
  font-size: 0.8rem;
}

.login-help a {
  color: #1d1680;
  font-weight: 600;
  transition: all 0.3s ease;
}

.login-help a:hover {
  text-decoration: underline;
  color: #2a1f9e;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert-custom {
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-error {
  background: rgba(255, 245, 245, 0.95);
  color: #c53030;
  border: 1px solid #feb2b2;
}

.alert-error i {
  color: #fc8181;
  font-size: 1.1rem;
}

.alert-success {
  background: rgba(240, 255, 244, 0.95);
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.alert-success i {
  color: #48bb78;
  font-size: 1.1rem;
}

/* ============================================
   FOOTER - CON FONDO SEMITRANSPARENTE
   ============================================ */
.footer-custom {
  background: rgba(3, 44, 92, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.6rem 0;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 0 20px;
}

.footer-text {
  font-size: 0.8rem;
  line-height: 1.3;
  margin: 0;
  text-align: center;
  flex: 1;
  font-weight: 300;
  opacity: 0.95;
}

.footer-text i {
  color: #f6c23e;
}

.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 0.7rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-whatsapp:hover {
  background: #1da851;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp i {
  font-size: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
  .navbar-custom .navbar-brand img {
    max-height: 40px;
  }
  
  .navbar-custom .nav-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem !important;
  }
  
  .login-card {
    padding: 1.8rem 1.5rem;
    max-width: 380px;
  }
  
  .login-title {
    font-size: 1.1rem;
  }
}

/* Móvil */
@media (max-width: 576px) {
  .navbar-custom {
    padding: 0.4rem 0;
  }
  
  .navbar-custom .navbar-brand img {
    max-height: 35px;
  }
  
  .navbar-custom .nav-link {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem !important;
  }
  
  .login-wrapper {
    padding: 10px;
    min-height: calc(100vh - 60px - 50px);
  }
  
  .login-card {
    padding: 1.2rem 1rem;
    border-radius: 16px;
    max-width: 100%;
  }
  
  .login-logo img {
    max-width: 50%;
  }
  
  .login-title {
    font-size: 1rem;
    letter-spacing: 1px;
  }
  
  .login-subtitle {
    font-size: 0.7rem;
  }
  
  .login-card .form-label {
    font-size: 0.7rem;
  }
  
  .login-card .form-control {
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 8px;
  }
  
  .btn-login {
    padding: 0.5rem;
    font-size: 0.85rem;
    border-radius: 8px;
    letter-spacing: 1px;
  }
  
  .btn-login i {
    font-size: 1rem;
  }
  
  .input-group-rut {
    gap: 6px;
  }
  
  .login-help {
    font-size: 0.6rem;
    margin-top: 0.6rem;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 5px;
    padding: 0 10px;
  }
  
  .footer-text {
    font-size: 0.6rem;
  }
  
  .btn-whatsapp {
    padding: 3px 10px;
    font-size: 0.6rem;
  }
  
  .btn-whatsapp i {
    font-size: 0.8rem;
  }
}

/* Móvil muy pequeño */
@media (max-width: 400px) {
  .login-card {
    padding: 0.8rem 0.7rem;
    border-radius: 12px;
  }
  
  .input-group-rut {
    flex-direction: row;
  }
  
  .input-group-rut .col-dv {
    flex: 1.2;
  }
  
  .login-logo img {
    max-width: 45%;
  }
  
  .login-title {
    font-size: 0.9rem;
  }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-gradient {
  background: linear-gradient(135deg, #1d1680, #4c51bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-hover {
  transition: all 0.3s ease;
}

.shadow-hover:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card {
  animation: fadeIn 0.6s ease;
}