/* Reset y variables */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #00695c;
  --primary-light: #26a69a;
  --primary-dark: #004d40;
  --secondary-color: #607d8b;
  --success-color: #4caf50;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-light: #9e9e9e;
  --background-light: #f5f5f5;
  --white: #ffffff;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #e0f2f1 0%, #e8f5e8 50%, #f1f8e9 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

/* Container principal */
.login-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  position: relative;
}

.login-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  z-index: 2;
}

/* Decoración de fondo con animación */
.background-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(
    45deg,
    rgba(0, 105, 92, 0.08),
    rgba(38, 166, 154, 0.08)
  );
  animation: float 12s ease-in-out infinite;
}

.circle-1 {
  width: 150px;
  height: 150px;
  top: 15%;
  left: 8%;
  animation-delay: 0s;
}

.circle-2 {
  width: 100px;
  height: 100px;
  top: 65%;
  right: 12%;
  animation-delay: 4s;
}

.circle-3 {
  width: 80px;
  height: 80px;
  bottom: 25%;
  left: 70%;
  animation-delay: 8s;
}

.circle-4 {
  width: 60px;
  height: 60px;
  top: 40%;
  right: 25%;
  animation-delay: 6s;
}

@keyframes float {
  0% {
    transform: translateY(0px) translateX(0px) scale(1);
  }
  33% {
    transform: translateY(-15px) translateX(10px) scale(1.02);
  }
  66% {
    transform: translateY(5px) translateX(-5px) scale(0.98);
  }
  100% {
    transform: translateY(0px) translateX(0px) scale(1);
  }
}

/* Card principal */
.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 10px 30px var(--shadow-medium);
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header del login */
.login-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='15' cy='15' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
    repeat;
  opacity: 0.7;
}

.logo-section {
  position: relative;
  z-index: 1;
}

.main-logo {
  width: 160px;
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
  transition: var(--transition);
}

.main-logo:hover {
  transform: scale(1.02);
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.3rem;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-weight: 400;
}

/* Formulario */
.login-form-section {
  padding: 1.3rem;
}

.form-header {
  text-align: center;
  margin-bottom: 1.2rem;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 105, 92, 0.1);
  color: var(--primary-color);
  padding: 0.35rem 0.7rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  letter-spacing: 0.2px;
}

.form-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
}

.modern-form {
  width: 100%;
}

.input-group-modern {
  position: relative;
  margin-bottom: 1rem;
}

.input-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  z-index: 2;
  transition: var(--transition);
  font-size: 0.9rem;
}

.form-input-modern {
  width: 100%;
  padding: 0.7rem 0.8rem 0.7rem 2.4rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--white);
  transition: var(--transition);
  outline: none;
  color: var(--text-primary);
}

.form-input-modern::placeholder {
  color: transparent;
  opacity: 0;
}

.form-input-modern:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 105, 92, 0.1);
}

.form-input-modern:focus ~ .input-icon {
  color: var(--primary-color);
}

/* Labels flotantes */
.input-label {
  position: absolute;
  left: 2.4rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
  transition: var(--transition);
  pointer-events: none;
  background: var(--white);
  padding: 0 0.3rem;
  z-index: 3;
}

.form-input-modern:focus ~ .input-label,
.form-input-modern:not(:placeholder-shown) ~ .input-label {
  top: 0;
  left: 0.8rem;
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 500;
}

.form-input-modern:focus::placeholder,
.form-input-modern:not(:placeholder-shown)::placeholder {
  opacity: 0;
}

.password-toggle {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  padding: 0.3rem;
  border-radius: 50%;
  font-size: 0.9rem;
  z-index: 4;
}

.password-toggle:hover {
  color: var(--primary-color);
  background: rgba(0, 105, 92, 0.1);
}

/* Botón de login */
.btn-login-modern {
  width: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 105, 92, 0.2);
}

.btn-login-modern::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn-login-modern:hover::before {
  left: 100%;
}

.btn-login-modern:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 105, 92, 0.3);
}

.btn-login-modern:active {
  transform: translateY(0);
}

.btn-login-modern:disabled {
  background: linear-gradient(135deg, #90a4ae 0%, #b0bec5 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-icon {
  transition: var(--transition);
  font-size: 0.85rem;
}

.btn-login-modern:hover .btn-icon {
  transform: translateX(2px);
}

/* Alertas */
.alert-modern {
  padding: 0.6rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: none;
  animation: fadeInDown 0.4s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.alert-text {
  font-size: 0.8rem;
  font-weight: 500;
}

.alert-success {
  background: rgba(76, 175, 80, 0.1);
  color: var(--success-color);
  border-left: 3px solid var(--success-color);
}

.alert-danger {
  background: rgba(244, 67, 54, 0.1);
  color: var(--error-color);
  border-left: 3px solid var(--error-color);
}

.alert-warning {
  background: rgba(255, 152, 0, 0.1);
  color: var(--warning-color);
  border-left: 3px solid var(--warning-color);
}

.alert-info {
  background: rgba(0, 105, 92, 0.1);
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
}

/* Footer */
.login-footer {
  text-align: center;
  padding-top: 0.6rem;
  border-top: 1px solid #f0f0f0;
}

.security-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}

.security-info i {
  color: var(--success-color);
  font-size: 0.7rem;
}

.copyright {
  color: var(--text-light);
  font-size: 0.7rem;
}

/* Responsive */
@media (max-width: 768px) {
  .login-container {
    padding: 0.3rem;
  }

  .login-wrapper {
    max-width: 100%;
    width: 100%;
  }

  .login-card {
    border-radius: 12px;
    margin: 0.2rem;
  }

  .login-header {
    padding: 1.5rem 1rem 1.2rem 1rem;
  }

  .main-logo {
    width: 130px;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .brand-subtitle {
    font-size: 0.8rem;
  }

  .login-form-section {
    padding: 1.1rem;
  }

  .form-header h2 {
    font-size: 1.25rem;
  }

  .input-group-modern {
    margin-bottom: 0.9rem;
  }

  .form-input-modern {
    padding: 0.65rem 0.7rem 0.65rem 2.2rem;
    font-size: 0.85rem;
  }

  .input-icon {
    left: 0.7rem;
    font-size: 0.85rem;
  }

  .input-label {
    left: 2.2rem;
    font-size: 0.85rem;
  }

  .form-input-modern:focus ~ .input-label,
  .form-input-modern:not(:placeholder-shown) ~ .input-label {
    font-size: 0.7rem;
  }

  .btn-login-modern {
    padding: 0.7rem 1.1rem;
    font-size: 0.9rem;
  }

  .circle {
    opacity: 0.6;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 0.2rem;
  }

  .login-card {
    border-radius: 10px;
    margin: 0.1rem;
  }

  .login-header {
    padding: 1.2rem 0.9rem 1rem 0.9rem;
  }

  .main-logo {
    width: 110px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-subtitle {
    font-size: 0.75rem;
  }

  .login-form-section {
    padding: 0.9rem;
  }

  .form-header h2 {
    font-size: 1.15rem;
  }

  .access-badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
  }

  .circle {
    display: block;
    opacity: 0.4;
  }

  .circle-1 {
    width: 100px;
    height: 100px;
  }

  .circle-2 {
    width: 70px;
    height: 70px;
  }

  .circle-3 {
    width: 50px;
    height: 50px;
  }

  .circle-4 {
    width: 40px;
    height: 40px;
  }
}

/* Estados de carga */
.loading-state .btn-text {
  opacity: 0;
}

.loading-state .btn-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
