@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #0065b3;
  --primary-light: #3a8dce;
  --primary-dark: #004e8a;
  --accent-color: #a6ce37;
  --accent-light: #c1e065;
  --accent-dark: #8bac2e;
  --text-color: #333;
  --bg-color: #f0f2f5;
  --card-bg: #ffffff;
  --input-bg: #e8f0fe;
  --shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.1);
  --text-secondary: #6c757d;
  --border-color: #dbe1e6;
  --error-color: #dc3545;
  --success-color: #28a745;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.5;
  overflow-x: hidden;
}

.login-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Nuevo fondo con elementos más interesantes */
.background-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  overflow: hidden;
  z-index: -1;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
}

.circle1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  top: -150px;
  left: -100px;
}

.circle2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
  bottom: -150px;
  right: -100px;
}

.circle3 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-color));
  top: 40%;
  left: 60%;
}

.bg-square {
  position: absolute;
  opacity: 0.05;
  transform: rotate(45deg);
}

.square1 {
  width: 200px;
  height: 200px;
  border: 15px solid var(--primary-color);
  top: 20%;
  left: 10%;
}

.square2 {
  width: 150px;
  height: 150px;
  border: 10px solid var(--accent-color);
  bottom: 15%;
  right: 20%;
}

.bg-line {
  position: absolute;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  height: 2px;
  width: 100%;
  opacity: 0.1;
}

.line1 {
  top: 20%;
  transform: rotate(25deg);
}

.line2 {
  top: 50%;
  transform: rotate(-15deg);
}

.line3 {
  bottom: 30%;
  transform: rotate(10deg);
}

.pattern-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      30deg,
      var(--second-color) 12%,
      transparent 12.5%,
      transparent 87%,
      var(--primary-color) 87.5%,
      var(--primary-color)
    ),
    linear-gradient(
      150deg,
      var(--primary-color) 12%,
      transparent 12.5%,
      transparent 87%,
      var(--primary-color) 87.5%,
      var(--primary-color)
    ),
    linear-gradient(
      30deg,
      var(--primary-color) 12%,
      transparent 12.5%,
      transparent 87%,
      var(--primary-color) 87.5%,
      var(--primary-color)
    ),
    linear-gradient(
      150deg,
      var(--primary-color) 12%,
      transparent 12.5%,
      transparent 87%,
      var(--primary-color) 87.5%,
      var(--primary-color)
    ),
    linear-gradient(
      60deg,
      var(--accent-color) 25%,
      transparent 25.5%,
      transparent 75%,
      var(--accent-color) 75%,
      var(--accent-color)
    ),
    linear-gradient(
      60deg,
      var(--accent-color) 25%,
      transparent 25.5%,
      transparent 75%,
      var(--accent-color) 75%,
      var(--accent-color)
    );
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
  opacity: 0.03;
}

.login-container {
  width: 100%;
  max-width: 1000px;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  display: flex;
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: auto;
  position: relative;
}

.login-content {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logo reposicionado arriba del título */
.logo-container {
  width: auto;
  height: 110px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  margin-bottom: 20px;
}

.logo-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.login-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

.login-form-container {
  width: 100%;
  max-width: 350px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

.input-field {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field i {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  font-size: 16px;
  z-index: 1;
}

.input-field .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  background: transparent;
  border: none;
  padding: 0;
  height: 36px;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.input-field .toggle-password:hover {
  color: var(--primary-color);
}

.input-field .toggle-password:focus {
  outline: none;
}

.input-field input {
  width: 100%;
  padding: 14px 45px 14px 45px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--input-bg);
  font-size: 15px;
  color: var(--text-color);
  transition: all 0.3s ease;
  position: relative;
  z-index: 0;
}

.input-field input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 101, 179, 0.1);
}

.input-field input::placeholder {
  color: #a0aec0;
}

.error-message,
.alert-message {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 14px;
}

.error-message {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--error-color);
  border-left: 3px solid var(--error-color);
}

.alert-message.success {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
  border-left: 3px solid var(--success-color);
}

.alert-message.error {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--error-color);
  border-left: 3px solid var(--error-color);
}

.error-message i,
.alert-message i {
  margin-right: 10px;
  font-size: 16px;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.remember-option {
  display: flex;
  align-items: center;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: relative;
  display: inline-block;
  height: 18px;
  width: 18px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-right: 8px;
  transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container span {
  font-size: 14px;
  color: var(--text-secondary);
}

.forgot-password {
  font-size: 14px;
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.forgot-password:hover {
  text-decoration: underline;
}

.login-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-button::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: 0.5s;
}

.login-button:hover::before {
  left: 100%;
}

.login-button i {
  margin-left: 10px;
  transition: transform 0.3s ease;
}

.login-button:hover {
  background-color: #005091;
}

.login-button:hover i {
  transform: translateX(3px);
}

.image-section {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.image-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 101, 179, 0.85), rgba(0, 80, 145, 0.95));
}

.welcome-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  width: 80%;
  z-index: 1;
}

.welcome-message h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}

.welcome-message p {
  font-size: 16px;
  opacity: 0.9;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Transiciones y animaciones */
.alert-message {
  transition: opacity 0.5s ease;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .login-card {
    flex-direction: column-reverse;
    height: auto;
  }

  .image-section {
    height: 200px;
  }

  .login-content {
    padding: 30px 20px;
  }

  .logo-container {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
  }

  .welcome-message h2 {
    font-size: 24px;
  }

  .welcome-message p {
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .login-container {
    padding: 10px;
  }

  .login-header h1 {
    font-size: 24px;
  }

  .login-header p {
    font-size: 14px;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .forgot-password {
    margin-top: 12px;
  }

  .image-section {
    height: 150px;
  }

  .logo-container {
    width: 100px;
    height: 100px;
  }
}
