/* ===== MODAL DE LOGIN ===== */

/* Overlay do modal - CORREÇÃO DO PROBLEMA */
.modal-backdrop {
  background: linear-gradient(135deg, var(--cria-blue) 0%, var(--cria-deep) 100%);
}

.modal-backdrop.show {
  opacity: 0.85 !important;
}

/* Garantir que apenas um backdrop esteja visível */
.modal-backdrop~.modal-backdrop {
  display: none;
}

/* Container principal do modal */
.login-modal-content {
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px);
  box-shadow:
    0 25px 50px -12px rgba(3, 30, 66, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 380px;
  margin: 0 auto;
}

/* Header do modal */
.login-modal-header {
  background: linear-gradient(135deg,
      rgba(19, 111, 189, 0.9) 0%,
      rgba(13, 92, 151, 0.85) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  backdrop-filter: blur(10px);
  border: none;
}

.login-logo {
  max-height: 65px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
}

.login-title {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: white;
  margin: 0.5rem 0 0.25rem 0;
}

.login-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0;
}

/* Botão fechar corrigido */
.btn-close-white {
  filter: invert(1) brightness(2);
  opacity: 0.8;
  background: none;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  width: auto;
  height: auto;
  padding: 0.5rem;
}

.btn-close-white:hover {
  opacity: 1;
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

/* Corpo do modal */
.login-modal-body {
  padding: 2rem 1.5rem;
  background: transparent;
}

/* Formulário */
.login-form {
  width: 100%;
}

/* Grupos de input */
.login-input-group {
  position: relative;
}

/* Container do input com ícone */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

/* Inputs */
.login-input {
  border-radius: 0.75rem;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem 1rem 1rem 3rem;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  height: auto;
  min-height: 56px;
  transition: all 0.3s ease;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(13, 92, 151, 0.08);
  color: white;
  backdrop-filter: blur(10px);
  width: 100%;
  flex: 1;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.login-input:focus {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.1),
    0 0 0 3px rgba(255, 255, 255, 0.15),
    0 4px 12px rgba(19, 111, 189, 0.2);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  color: white;
  outline: none;
}

/* Ícones nos inputs */
.input-icon {
  position: absolute;
  left: 1rem;
  z-index: 2;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  pointer-events: none;
}

.login-input:focus+.input-icon,
.input-with-icon:focus-within .input-icon {
  color: white;
}

/* Checkbox personalizado */
.form-check {
  margin-bottom: 0;
}

.login-checkbox {
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.15em;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.35rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.login-checkbox:checked {
  background-color: var(--cria-orange);
  border-color: var(--cria-orange);
  box-shadow: 0 2px 6px rgba(255, 122, 33, 0.4);
}

.login-checkbox:focus {
  border-color: var(--cria-orange);
  box-shadow: 0 0 0 0.2rem rgba(255, 122, 33, 0.15);
}

.login-check-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Link "Esqueci senha" */
.login-forgot-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-forgot-link:hover {
  color: white;
  text-decoration: none;
}

.login-forgot-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: white;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.login-forgot-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Botão de login primário */
.btn-login-primary {
  background: linear-gradient(135deg,
      rgba(255, 122, 33, 0.9) 0%,
      rgba(255, 106, 0, 0.85) 100%);
  border: none;
  border-radius: 0.75rem;
  color: white;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 15px rgba(255, 122, 33, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 0.875rem 1rem;
  min-height: 56px;
  margin-top: 0.5rem;
}

.btn-login-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 25px rgba(255, 122, 33, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: white;
  background: linear-gradient(135deg,
      rgba(255, 122, 33, 0.95) 0%,
      rgba(255, 106, 0, 0.9) 100%);
}

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

/* Efeito de brilho no botão */
.btn-login-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  transition: left 0.6s ease;
}

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

/* Footer do modal */
.login-modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.25rem 1.5rem;
  background: rgba(19, 111, 189, 0.1);
  backdrop-filter: blur(10px);
  border: none;
}

.login-footer-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  text-align: center;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-help-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.login-help-link:hover {
  color: white;
  text-decoration: underline;
}

/* ===== MODAL ESQUECI MINHA SENHA ===== */

/* Link voltar para login */
.back-to-login-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-to-login-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Animações de entrada */
.modal.fade .login-modal-content {
  transform: scale(0.9) translateY(-20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.modal.show .login-modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Responsividade */
@media (max-width: 576px) {
  .login-modal-content {
    margin: 0.5rem;
    border-radius: 1.25rem;
    max-width: calc(100vw - 1rem);
  }

  .login-modal-header,
  .login-modal-body,
  .login-modal-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .login-modal-header {
    padding-top: 1.75rem;
    padding-bottom: 1.25rem;
  }

  .login-title {
    font-size: 1.35rem;
  }

  .login-input {
    padding-left: 2.75rem;
    min-height: 52px;
  }

  .input-icon {
    left: 0.875rem;
    font-size: 1rem;
  }

  .btn-close-white {
    top: 1rem;
    right: 1rem;
  }
}

/* Efeito de foco nos inputs para acessibilidade */
.login-input:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 1px;
}











/* ============================
   LOGIN MODAL — patches finais
   (PF/PJ com pílulas, alinhado à esquerda)
   ============================ */

/* 1) Alinhar ícone à esquerda + afastar texto do input (PF e PJ) */
#loginModal .input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
#loginModal .input-with-icon .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
  font-size: 1.05rem;
  opacity: .9;
}
#loginModal .input-with-icon .login-input {
  padding-left: 3rem; /* espaço para o ícone */
}

/* 2) Grupo de rádios (PF x PJ) — alinhado à esquerda e clicável */
#loginModal #perfil-login-group {
  width: 100%;
  margin-bottom: 1rem;
  text-align: left; /* alinhado à esquerda */
}
#loginModal #perfil-login-group .d-flex {
  justify-content: flex-start !important;   /* esquerda */
  align-items: center;
  gap: .5rem !important;                    /* espaçamento entre as pílulas */
  flex-wrap: wrap;
}

/* 3) “Pílulas” bonitas — sem mudar o seu HTML */
#loginModal #perfil-login-group .form-check {
  position: relative;
  margin: 0;                 /* remove qualquer deslocamento lateral */
}

/* Esconde o radio nativo, mas mantém a área clicável */
#loginModal #perfil-login-group .form-check-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Label vira a pílula */
#loginModal #perfil-login-group .form-check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .52rem 1rem;                     /* tamanho confortável */
  border-radius: .65rem;
  border: 1.5px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease,
              border-color .15s ease, background .15s ease, color .15s ease;
  cursor: pointer; /* cursor de mão */
}

/* Hover / Focus visual */
#loginModal #perfil-login-group .form-check:hover .form-check-label {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.45);
}
#loginModal #perfil-login-group .form-check-input:focus + .form-check-label {
  box-shadow: 0 0 0 .18rem rgba(255,122,33,.18); /* laranja suave */
  border-color: rgba(255,255,255,.55);
}

/* Ativo (checado) — usa o mesmo laranja do seu botão .btn-login-primary */
#loginModal #perfil-login-group .form-check-input:checked + .form-check-label {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #ff7a21 0%, #ff6a00 100%);
  box-shadow: 0 6px 18px rgba(255,122,33,.28), inset 0 1px 0 rgba(255,255,255,.2);
}

/* (Opcional) Ajuste de densidade nas telas muito pequenas */
@media (max-width: 420px) {
  #loginModal #perfil-login-group .form-check-label {
    padding: .46rem .85rem;
    font-size: .96rem;
  }
}
