:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --error-color: #ef4444;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --input-bg: #f8fafc;
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.login-header {
  padding: 32px;
  text-align: center;
  background: var(--input-bg);
  border-bottom: 1px solid var(--border-color);
}

.login-logo {
  width: 80px;
  height: auto;
  margin-bottom: 16px;
}

.login-header h1 {
  color: var(--text-color);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.login-form {
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.input-icon {
  position: relative;
  display: flex;
  align-items: center;
}

/* Apenas o ícone à esquerda (não o ícone dentro do botão toggle) */
.input-icon > .input-icon__left {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.input-icon input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  font-size: 14px;
  color: var(--text-color);
  transition: all 0.2s;
}

.input-icon input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Campo palavra-passe: espaço à direita para o olho ficar dentro do input */
.input-icon--password input {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: var(--text-color);
}

.toggle-password i {
  position: static;
  left: auto;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

.login-button {
  width: 100%;
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.login-button:hover {
  background: var(--primary-hover);
}

.login-button i {
  font-size: 14px;
  transition: transform 0.2s;
}

.login-button:hover i {
  transform: translateX(4px);
}

.login-footer {
  padding: 16px 32px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.login-footer p {
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 480px) {
  .login-container {
      max-width: 100%;
  }

  .login-card {
      border-radius: 12px;
  }

  .login-header {
      padding: 24px;
  }

  .login-form {
      padding: 24px;
  }

  .login-footer {
      padding: 12px 24px;
  }
}

/* Animation for error message */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.error-message {
  animation: shake 0.4s ease-in-out;
}

/* Forgot password link */
.forgot-password-link {
  text-align: center;
  margin-top: 16px;
}

.forgot-password-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.forgot-password-link a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Reset Modal */
.reset-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.reset-modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  max-width: 450px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.reset-modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--input-bg);
}

.reset-modal-header h2 {
  color: var(--text-color);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.reset-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.reset-modal-close:hover {
  background: var(--border-color);
  color: var(--text-color);
}

.reset-modal-body {
  padding: 32px;
}

.reset-modal-body p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.success-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

.success-message i {
  color: #22c55e;
}

.login-button-secondary {
  width: 100%;
  padding: 12px 24px;
  background: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 12px;
}

.login-button-secondary:hover {
  background: var(--input-bg);
  border-color: var(--primary-hover);
  color: var(--primary-hover);
}

@media (max-width: 480px) {
  .reset-modal-content {
    max-width: 100%;
    border-radius: 12px;
  }

  .reset-modal-header {
    padding: 20px 24px;
  }

  .reset-modal-body {
    padding: 24px;
  }
}