.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.auth-modal.is-open {
  display: block;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
}

.auth-modal__dialog {
  position: relative;
  width: min(100% - 24px, 460px);
  margin: 6vh auto 0;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #e5eaf3;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.auth-modal__content {
  padding: 30px 28px 28px;
}

.auth-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #f4f7fb;
  color: #344054;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-modal__close:hover {
  background: #e9eef7;
  transform: scale(1.03);
}

.auth-modal__brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding-right: 36px;
}

.auth-modal__badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2d6cff, #1a44b3);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 12px 24px rgba(31, 79, 215, 0.24);
}

.auth-modal__brand h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
  color: #101828;
}

.auth-modal__brand p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 0.94rem;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #344054;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="tel"] {
  width: 100%;
  height: 46px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #ffffff;
  padding: 0 14px;
  font-size: 0.95rem;
  color: #101828;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form input::placeholder {
  color: #98a2b3;
}

.auth-form input:focus {
  border-color: #1f4fd7;
  box-shadow: 0 0 0 4px rgba(31, 79, 215, 0.12);
}

.auth-form input:hover {
  border-color: #98a2b3;
}

.auth-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  color: #667085;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-top: 2px;
}

.auth-check input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #4474A3;
  cursor: pointer;
}

/* Links legais dentro do checkbox — visíveis e clicáveis */
/* !important necessário: base.css define a { color: inherit }     */
/* e .auth-form label tem color: #344054 que herda para o <a>      */
.auth-check a,
.auth-form .auth-check a {
  color: #E8500A !important;
  font-weight: 700;
  text-decoration: underline !important;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 0.16s ease;
}

.auth-check a:hover,
.auth-form .auth-check a:hover {
  color: #C44008 !important;
}

.auth-feedback {
  min-height: 20px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-feedback.is-error {
  padding: 12px 14px;
  background: #fff1f3;
  color: #b42318;
  border: 1px solid #fecdd3;
}

.auth-feedback.is-success {
  padding: 12px 14px;
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid #abefc6;
}

.auth-submit {
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #2d6cff, #1f4fd7);
  color: #fff;
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(31, 79, 215, 0.22);
  transition: transform 0.18s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(31, 79, 215, 0.26);
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.auth-modal__links {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5eaf3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-link-button {
  border: 0;
  background: transparent;
  color: #1f4fd7;
  text-align: left;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease, transform 0.15s ease;
}

.auth-link-button:hover {
  color: #163da8;
  transform: translateX(2px);
}

.auth-link-button:focus {
  outline: none;
  text-decoration: underline;
}

/* Campo de senha com ícone */
.auth-password-field {
  position: relative;
}

.auth-password-field input {
  padding-right: 46px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #98a2b3; /* mais suave no estado normal */
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

/* HOVER */
.auth-password-toggle:hover {
  background: #f2f4f7;
  color: #1f4fd7; /* azul da marca */
}

/* ATIVO (quando senha visível) */
.auth-password-toggle[aria-pressed="true"] {
  color: #1f4fd7;
  background: #eef2ff;
}

/* CLICK */
.auth-password-toggle:active {
  transform: translateY(-50%) scale(0.94);
}

.auth-password-toggle:hover {
  background: #f2f4f7;
  color: #344054;
}

.auth-password-toggle:active {
  transform: translateY(-50%) scale(0.96);
}

.auth-password-toggle:focus {
  outline: none;
  box-shadow: none;
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

@media (max-width: 640px) {
  .auth-modal__dialog {
    width: calc(100% - 16px);
    margin-top: 3vh;
    border-radius: 20px;
  }

  .auth-modal__content {
    padding: 22px 18px 20px;
  }

  .auth-modal__brand {
    gap: 12px;
    margin-bottom: 20px;
  }

  .auth-modal__badge {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .auth-modal__brand h2 {
    font-size: 1.25rem;
  }

  .auth-form input[type="email"],
  .auth-form input[type="password"],
  .auth-form input[type="text"],
  .auth-form input[type="tel"] {
    height: 44px;
  }

  .auth-submit {
    height: 50px;
  }
}