@import url('./variables.css');

.login-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  width: 100%;
  max-width: 900px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
  position: relative;
  margin: 2rem auto;
}

.login-left {
  background: linear-gradient(
    135deg,
    var(--dark-green),
    var(--secondary-green)
  );
  color: white;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

.login-left::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M20,20 Q50,10 80,20 Q90,50 80,80 Q50,90 20,80 Q10,50 20,20 Z" fill="none" stroke="%23ffffff" stroke-width="0.5" opacity="0.1"/></svg>')
    repeat;
  pointer-events: none;
}

.logo {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary-green);
}

.welcome-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: bold;
}

.welcome-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.login-right {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-header h2 {
  color: var(--dark-green);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: #666;
  font-size: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  position: relative;
  direction: inherit;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s;
  background: white;
}

.form-group input:focus {
  outline: none;
  border-color: var(--secondary-green);
  box-shadow: 0 0 0 3px rgba(133, 166, 124, 0.1);
}

.form-group .icon {
  position: absolute;
  inset-inline-end: 1rem;
  top: 70%;
  transform: translateY(-50%);
  color: #999;
  font-size: 1.1rem;
  cursor: pointer;
}

.form-group input:focus + .icon {
  color: var(--secondary-green);
}

.forgot-password {
  text-align: left;
  margin-top: -0.5rem;
}

.forgot-password a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.forgot-password a:hover {
  color: #a67c2f;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.remember-me input[type='checkbox'] {
  width: auto;
  margin: 0;
}

.login-button {
  background: linear-gradient(
    135deg,
    var(--secondary-green),
    var(--dark-green)
  );
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  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: left 0.5s;
}

.login-button:hover::before {
  left: 100%;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.login-button:active {
  transform: translateY(0);
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #999;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e1e5e9;
}

.divider span {
  padding: 0 1rem;
  font-size: 0.9rem;
}

.register-link {
  text-align: center;
  color: #666;
}

.register-link a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.register-link a:hover {
  color: #a67c2f;
}

.error-message {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid var(--error-color);
  color: var(--error-color);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: none;
}

.error-message.show {
  display: block;
}

.success-message {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid #2ecc71;
  color: #2ecc71;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: none;
}

.success-message.show {
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-container {
    grid-template-columns: 1fr;
    margin: 1rem;
  }

  .login-left {
    padding: 2rem;
    text-align: center;
  }

  .welcome-title {
    font-size: 1.5rem;
  }

  .login-right {
    padding: 2rem;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-button.loading {
  pointer-events: none;
  opacity: 0.8;
}

/* Role indicator */
.role-indicator {
  background: var(--primary-green);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: none;
  margin-bottom: 1rem;
  text-align: center;
}

.role-indicator.show {
  display: block;
}
