/* =========================================================
   NIDDS — Paginas de autenticacao
   Split editorial: lado navy com a marca, lado marfim com o formulario.
   Depende de nidds-ui.css.
   ========================================================= */

body.auth {
  min-height: 100svh;
}

.auth-container {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  min-height: 100svh;
}

/* ---------- lado da marca ---------- */

.brand-section {
  position: relative;
  background: var(--navy);
  color: var(--cream);
  padding: clamp(36px, 4vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.brand-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/odontologia.webp") center / cover no-repeat;
  filter: grayscale(1);
  opacity: 0.28;
}

.brand-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    195deg,
    rgba(10, 31, 61, 0.82),
    rgba(6, 17, 31, 0.96) 62%,
    rgba(201, 162, 75, 0.16)
  );
}

.brand-section > * {
  position: relative;
  z-index: 1;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-top img {
  height: 52px;
  width: auto;
}

.brand-content {
  max-width: 30rem;
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  font-weight: 500;
  line-height: 1.05;
  margin: 22px 0 18px;
}

.brand-title em {
  font-style: italic;
  color: var(--gold);
}

.brand-tagline {
  font-weight: 300;
  color: rgba(242, 237, 224, 0.7);
  max-width: 40ch;
}

.brand-features {
  display: grid;
  gap: 1px;
  margin-top: 40px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid rgba(242, 237, 224, 0.12);
}

.feature-icon {
  color: var(--gold);
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  flex: none;
}

.feature-text {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-foot {
  font-size: 0.72rem;
  font-weight: 300;
  color: rgba(242, 237, 224, 0.7);
}

/* ---------- lado do formulario ---------- */

.auth-section {
  background: var(--ivory);
  padding: clamp(36px, 4vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-inner {
  width: 100%;
  max-width: 27rem;
  margin: 0 auto;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 40px;
  transition: color 0.4s var(--ease);
}

.auth-back:hover {
  color: var(--gold);
}

.auth-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 500;
  line-height: 1.05;
  margin: 18px 0 12px;
}

.auth-title em {
  font-style: italic;
  color: var(--gold);
}

.auth-subtitle {
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: 40px;
}

/* campo com icone e toggle de senha */

.login-form .form-group {
  margin-bottom: 24px;
}

.input-icon {
  position: absolute;
  right: 16px;
  bottom: 17px;
  color: var(--ink-soft);
  opacity: 0.5;
  font-size: 0.9rem;
  pointer-events: none;
}

.form-control {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  border-radius: 2px;
  transition: color 0.3s var(--ease);
}

.password-toggle:hover {
  color: var(--gold);
}

.remember-forgot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-soft);
  cursor: pointer;
}

.forgot-link {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  position: relative;
  padding-bottom: 3px;
}

.forgot-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition:
    width 0.4s var(--ease),
    left 0.4s var(--ease);
}

.forgot-link:hover::after {
  width: 100%;
  left: 0;
}

#login-submit {
  margin-top: 8px;
  padding: 18px 30px;
}

.register-link {
  margin-top: 26px;
  font-size: 0.86rem;
  font-weight: 300;
  color: var(--ink-soft);
  text-align: center;
}

.register-link a {
  font-weight: 600;
  color: var(--navy);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1px;
  transition: color 0.3s var(--ease);
}

.register-link a:hover {
  color: var(--gold);
}

/* login social */

.social-login {
  margin-top: 38px;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.social-buttons {
  display: flex;
  justify-content: center;
}

/* ---------- estados das telas de recuperacao ---------- */

.hidden {
  display: none !important;
}

.form-state.hidden {
  display: none;
}

.success-state {
  display: none;
}

.success-state.visible {
  display: block;
  animation: modalIn 0.5s var(--ease);
}

/* marcador circular usado no topo dos estados */
.reset-icon-wrap,
.success-icon-wrap,
.auth-state-icon {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 28px;
}

.success-icon-wrap {
  border-color: rgba(47, 107, 79, 0.35);
  color: var(--success);
}

.reset-title,
.success-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 500;
  line-height: 1.08;
  margin-bottom: 14px;
}

.reset-subtitle,
.success-text {
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: 30px;
}

.success-email {
  font-weight: 600;
  color: var(--navy);
  border-bottom: 1px solid var(--gold);
  word-break: break-all;
}

/* campo com icone a esquerda (recuperar/redefinir) */
.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  left: 16px;
  right: auto;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}

.input-wrap .form-control {
  padding-left: 44px;
  padding-right: 16px;
}

.btn-reset {
  width: 100%;
  margin-top: 6px;
  padding: 18px 30px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.4s var(--ease);
}

.back-link:hover {
  color: var(--gold);
}

.inline-alert {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  margin-bottom: 22px;
  border-left: 2px solid var(--gold);
  background: var(--ivory-2);
  font-size: 0.84rem;
  font-weight: 400;
}

.inline-alert.error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.inline-alert.info {
  border-left-color: var(--navy);
  color: var(--ink);
}

.inline-alert.hidden {
  display: none;
}

.login-link {
  margin-top: 22px;
  font-size: 0.86rem;
  font-weight: 300;
  color: var(--ink-soft);
}

.login-link a {
  font-weight: 600;
  color: var(--navy);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1px;
}

.login-link a:hover {
  color: var(--gold);
}

.divider {
  width: 46px;
  height: 1px;
  background: var(--gold);
  margin: 24px 0;
}

/* estados extras do redefinir-senha */
/* o JS alterna via style.display = "block" */
.token-state {
  display: none;
  font-weight: 300;
  color: var(--ink-soft);
}

.token-state .spin {
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 18px;
}

.expired-state {
  display: none;
}

.expired-state.visible {
  display: block;
  animation: modalIn 0.5s var(--ease);
}

.expired-icon-wrap {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(155, 44, 44, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--danger);
  margin-bottom: 28px;
}

.expired-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 500;
  margin-bottom: 14px;
}

.expired-text {
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: 30px;
}

/* forca da senha (redefinir-senha.js) */
.strength-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 4px;
}

.strength-bar {
  flex: 1;
  height: 2px;
  background: var(--line);
  overflow: hidden;
}

.strength-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  transition:
    width 0.5s var(--ease),
    background-color 0.4s var(--ease);
}

.strength-fill.weak {
  width: 33%;
  background: var(--danger);
}

.strength-fill.medium {
  width: 66%;
  background: var(--gold);
}

.strength-fill.strong {
  width: 100%;
  background: var(--success);
}

.strength-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.strength-label.weak {
  color: var(--danger);
}

.strength-label.medium {
  color: var(--gold);
}

.strength-label.strong {
  color: var(--success);
}

.req-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin-top: 16px;
}

.req-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.76rem;
  font-weight: 300;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease);
}

.req-item i {
  font-size: 0.42rem;
  color: var(--line);
  transition: color 0.3s var(--ease);
}

.req-item.ok {
  color: var(--ink);
}

.req-item.ok i {
  font-size: 0.7rem;
  color: var(--success);
}

.match-hint {
  margin-top: 10px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.match-hint.ok {
  color: var(--success);
}

.match-hint.err {
  color: var(--danger);
}

/* ---------- modal ---------- */

/* modal.js alterna style.display entre "none" e "flex":
   nao usar opacity/visibility aqui, senao ele abre invisivel. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 17, 31, 0.72);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active,
.modal-overlay.show {
  display: flex;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.modal-content {
  animation: modalIn 0.45s var(--ease);
  position: relative;
  width: 100%;
  max-width: 27rem;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: clamp(30px, 4vw, 46px);
  text-align: center;
  box-shadow: 0 40px 80px rgba(6, 17, 31, 0.35);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease);
}

.modal-close:hover {
  color: var(--gold);
}

.modal-icon {
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 18px;
}

.modal-icon.error {
  color: var(--danger);
}

.modal-icon.success {
  color: var(--success);
}

/* estados que o login.js aplica nos campos */
.form-control.error {
  border-color: var(--danger);
  background: rgba(155, 44, 44, 0.04);
}

.form-control.success {
  border-color: var(--success);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.modal-text {
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: 30px;
}

/* ---------- responsivo ---------- */

@media (max-width: 980px) {
  .auth-container {
    grid-template-columns: 1fr;
  }

  .brand-section {
    min-height: 40svh;
    justify-content: flex-end;
    gap: 26px;
  }

  .brand-features {
    display: none;
  }

  .brand-foot {
    display: none;
  }

  .auth-section {
    padding-top: clamp(40px, 8vw, 68px);
  }
}

@media (max-width: 600px) {
  .brand-section {
    min-height: 32svh;
    padding: 26px 24px 30px;
  }

  .auth-section {
    padding: 34px 24px 48px;
  }

  .auth-back {
    margin-bottom: 26px;
  }
}

/* ---------- dourado em texto no lado claro ----------
   O lado do formulário é marfim. Sobretítulo, link e itálico do título
   usam o dourado de texto; o itálico é título grande (pede 3:1) e fica
   um tom acima para não pesar. */
.auth-section .eyebrow,
.auth-section .forgot-link,
.auth-section .auth-back:hover {
  color: var(--gold-text);
}

.auth-section .auth-title em {
  color: #8f6f26;
}
