/* Estilos para página de login */
@import url("../../base/css/variables.css");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--text-primary));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 10px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background-color: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.logo-section {
  text-align: center;
  margin-bottom: 1.75rem;
  margin-top: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.logo img {
  max-width: 180px;
  height: auto;
}

/* Mobile: logo ajustada */
@media (max-width: 768px) {
  .logo img {
    height: 60px;
    max-width: 150px;
  }

  /* Ajustes consistentes para formulário de login no mobile */
  .auth-container {
    padding: 1.25rem 1.5rem;
    max-height: 100vh;
    overflow-y: auto;
  }

  #loginForm .logo-section {
    margin-bottom: 1rem;
    margin-top: 0.25rem;
  }

  #loginForm .greeting {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    margin-top: 0.75rem;
  }

  #loginForm .form-group {
    margin-bottom: 1rem;
  }

  #loginForm .form-label {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
  }

  #loginForm .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  #loginForm .forgot-password {
    margin-bottom: 1.5rem;
  }

  #loginForm .btn-primary {
    margin-top: 1.5rem;
    padding: 0.5625rem 0.875rem;
    font-size: 13px;
  }

  #loginForm .switch-link {
    margin-top: 1.25rem;
    font-size: 0.8125rem;
  }

  .form-container {
    max-height: 100vh;
  }
}

@media (max-width: 480px) {
  .logo img {
    height: 56px;
    max-width: 140px;
  }

  .auth-container {
    padding: 1rem 1.25rem;
  }

  #loginForm .logo-section {
    margin-bottom: 0.75rem;
    margin-top: 0;
  }

  #loginForm .greeting {
    font-size: 1.125rem;
    margin-bottom: 0.875rem;
    margin-top: 0.5rem;
  }

  #loginForm .form-group {
    margin-bottom: 0.875rem;
  }

  #loginForm .btn-primary {
    margin-top: 1.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 12px;
  }

  #loginForm .switch-link {
    margin-top: 1rem;
  }
}

.greeting {
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
  text-align: center;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: #151515;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  color: hsl(var(--text-primary));
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  background-color: #181818;
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
}


.form-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.form-input:read-only {
  background-color: #0f0f0f;
  border-color: hsl(var(--destructive) / 0.3);
  color: hsl(var(--text-secondary));
  cursor: not-allowed;
  opacity: 0.7;
}


.form-input:read-only:focus {
  border-color: hsl(var(--destructive) / 0.3);
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.1);
  background-color: #0f0f0f;
}

.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 4rem; /* Espaço para toggle + ícone de validação */
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: hsl(var(--text-secondary));
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}


.forgot-password {
  text-align: right;
  margin-bottom: 2rem;
}

/* Spinner de loading centralizado - deve ignorar alinhamento do elemento anterior */
.login-spinner-small {
  display: none;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 1rem auto;
  text-align: center !important;
  clear: both;
}

.login-spinner-small[style*="display: block"],
.login-spinner-small[style*="display: flex"] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
  text-align: center !important;
  clear: both !important;
}

.login-spinner-small .spinner-circle {
  width: 24px;
  height: 24px;
  border: 3px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

.forgot-password a {
  color: hsl(var(--primary));
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

.forgot-password a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: hsl(var(--primary));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



.btn {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: #ffffff !important; /* Forçar cor branca */
  margin-bottom: 0;
  margin-top: 2rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: none;
  border: 1px solid hsl(var(--primary));
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

/* Garantir que texto dentro do botão também seja branco */
.btn-primary strong,
.btn-primary span,
.btn-primary * {
  color: #ffffff !important;
}


.btn-primary:active,
.btn-primary:focus {
  outline: none;
  box-shadow: none;
}

.btn-primary:disabled {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--muted));
  cursor: not-allowed;
  opacity: 0.6;
}


.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}


.separator {
  display: none;
}

.separator-line {
  flex: 1;
  height: 1px;
  background-color: hsl(var(--border));
}

.separator-text {
  padding: 0 1rem;
  color: hsl(var(--text-secondary));
  font-size: 0.875rem;
}

.switch-link {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-top: 2rem;
}

.switch-link a {
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  margin-left: 0.25rem;
  position: relative;
}

.switch-link a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: hsl(var(--primary));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid;
}

.alert-danger {
  background-color: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive));
  color: hsl(var(--destructive));
}

.alert-success {
  background-color: #1987541a;
  border-color: #198754;
  color: #198754;
}

.form-text {
  font-size: 0.75rem;
  color: hsl(var(--text-secondary));
  margin-top: 0.5rem;
}

.form-text.error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  margin-top: 0.5rem;
  background-color: hsl(var(--destructive) / 0.1);
  border: 1px solid hsl(var(--destructive) / 0.3);
  border-radius: var(--radius);
  color: hsl(var(--destructive));
  font-size: 0.8125rem;
  line-height: 1.4;
  animation: slideDown 0.2s ease-out;
}

/* Erros de senha com múltiplas linhas */
.password-strength-error {
  display: block !important;
  line-height: 1.6;
  white-space: normal;
}

/* Remove ícone ::before para erros de senha */
.password-strength-error::before {
  content: none;
  display: none;
}

/* Validação de senha - Design elegante e discreto */
.password-match-text {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  min-height: 1.25rem;
  transition: all 0.2s ease;
}

.password-match-text.success {
  display: block;
  color: hsl(var(--primary));
  opacity: 0.85;
  font-weight: 400;
}

.password-match-text.error {
  display: block;
  color: hsl(var(--destructive));
  opacity: 0.9;
  font-weight: 400;
}

/* Remove o ícone ::before duplicado, pois já temos o ícone ao lado do campo */
.password-match-text.error::before {
  content: none;
  display: none;
}

/* Ícone de validação ao lado do campo de senha */
.password-validation-icon {
  position: absolute;
  right: 2.5rem; /* Posicionado entre o input e o botão de toggle */
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: all 0.2s ease;
  opacity: 0;
  z-index: 1;
}

.password-validation-icon.success {
  opacity: 1;
  color: hsl(var(--primary));
}

.password-validation-icon.error {
  opacity: 1;
  color: hsl(var(--destructive));
}

.password-validation-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2.5;
}

.form-text.success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  margin-top: 0.5rem;
  background-color: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.3);
  border-radius: var(--radius);
  color: hsl(var(--primary));
  font-size: 0.8125rem;
  line-height: 1.4;
  animation: slideDown 0.2s ease-out;
}

.form-text.success::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.75rem;
  font-weight: bold;
  flex-shrink: 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-wrapper {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.form-wrapper.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Checkbox de termos de uso - Design moderno e profissional */
.terms-checkbox-group {
  display: block;
  margin-bottom: 1.5rem;
  padding: 1rem 1.125rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.terms-checkbox-group:hover {
  border-color: hsl(var(--border) / 0.8);
  background: hsl(var(--card) / 0.95);
}

.form-wrapper.active .terms-checkbox-group {
  display: block;
  opacity: 1;
}

.terms-checkbox-group .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.6;
  color: hsl(var(--foreground) / 0.9);
  transition: color 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.terms-checkbox-group .checkbox-label:hover {
  color: hsl(var(--foreground));
}


/* Checkbox customizado - Design moderno e profissional */
#accept_terms_register {
  display: block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: hsl(var(--card));
  border: 2px solid hsl(var(--border));
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  margin-top: 0.125rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#accept_terms_register:hover {
  border-color: hsl(var(--primary) / 0.6);
  background-color: hsl(var(--card) / 0.8);
}

#accept_terms_register:checked {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.1);
}

#accept_terms_register:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 4px;
  height: 7px;
  border: solid hsl(var(--primary-foreground));
  border-width: 0 1.5px 1.5px 0;
  animation: checkmark 0.2s ease-out;
}

@keyframes checkmark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
  }
}

#accept_terms_register:focus {
  outline: none;
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}

.checkbox-text {
  display: inline;
  line-height: 1.6;
  flex: 1;
}

.checkbox-text a {
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  display: inline;
}

.checkbox-text a:hover {
  color: hsl(var(--primary) / 0.9);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}



.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background-color: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  z-index: 1;
}

.modal h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
  color: hsl(var(--text-primary));
}

.modal p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-weight: 400;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: hsl(var(--text-secondary));
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}


.form-feedback {
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  display: none;
  line-height: 1.6;
  animation: slideDown 0.3s ease-out;
  word-wrap: break-word;
}

.form-feedback.error {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-top: 0.75rem;
}

.form-feedback.error::before {
  content: "✕";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.form-feedback.success {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.2);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-top: 0.75rem;
}

.form-feedback.success::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
  margin-top: 1.5rem;
}

.modal-actions .btn {
  width: 100%;
}

.modal-actions .btn-primary {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Ajustes para mobile - Formulário de registro com mesmo tamanho do login */
@media (max-width: 768px) {
  /* Reduzir padding do container no mobile */
  .auth-container {
    padding: 1.25rem 1.5rem;
    max-height: 100vh;
    overflow-y: auto;
  }

  /* Reduzir espaçamentos no formulário de registro */
  #registerForm .logo-section {
    margin-bottom: 1rem;
    margin-top: 0.25rem;
  }

  #registerForm .greeting {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    margin-top: 0.75rem;
  }

  #registerForm .form-group {
    margin-bottom: 1rem;
  }

  #registerForm .form-label {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
  }

  #registerForm .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* Reduzir tamanho do checkbox de termos */
  #registerForm .terms-checkbox-group {
    padding: 0.75rem;
    margin-bottom: 1rem !important;
  }

  #registerForm .terms-checkbox-group .checkbox-label {
    font-size: 0.75rem !important;
    line-height: 1.4 !important;
    gap: 0.625rem !important;
  }

  #registerForm .terms-checkbox-group #accept_terms_register {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    margin-top: 0.125rem !important;
  }

  #registerForm .terms-checkbox-group #accept_terms_register:checked::after {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) rotate(45deg) !important;
    width: 4px !important;
    height: 7px !important;
  }

  /* Reduzir espaçamento do botão */
  #registerForm .btn-primary {
    margin-top: 1.25rem;
    padding: 0.5625rem 0.875rem;
    font-size: 13px;
  }

  /* Reduzir espaçamento do switch link */
  #registerForm .switch-link {
    margin-top: 1.25rem;
    font-size: 0.8125rem;
  }

  /* Reduzir tamanho dos textos de erro/sucesso */
  #registerForm .form-text {
    font-size: 0.6875rem;
    margin-top: 0.375rem;
    padding: 0.5rem 0.75rem;
  }

  #registerForm .form-text.error,
  #registerForm .form-text.success {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }

  /* Garantir que o container não ultrapasse a altura da viewport */
  .form-container {
    max-height: 100vh;
  }

  #registerForm {
    max-height: 100vh;
    overflow-y: auto;
  }
}

/* Ajustes adicionais para telas muito pequenas */
@media (max-width: 480px) {
  .auth-container {
    padding: 1rem 1.25rem;
  }

  #registerForm .logo-section {
    margin-bottom: 0.75rem;
    margin-top: 0;
  }

  #registerForm .greeting {
    font-size: 1.125rem;
    margin-bottom: 0.875rem;
    margin-top: 0.5rem;
  }

  #registerForm .form-group {
    margin-bottom: 0.875rem;
  }

  #registerForm .terms-checkbox-group {
    padding: 0.625rem;
    margin-bottom: 0.875rem !important;
  }

  #registerForm .btn-primary {
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 12px;
  }

  #registerForm .switch-link {
    margin-top: 1rem;
  }
}

