/* ═══════════════════════════════════════════════════════════
   auth.css — Páginas de login, cadastro e verificação
═══════════════════════════════════════════════════════════ */

body.tr-auth-page {
  background: var(--tr-light);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.tr-auth {
  width: 100%;
  max-width: 440px;
  margin: auto;
}

.tr-auth--cadastro {
  max-width: 500px;
}

/* ── Card ────────────────────────────────────────────────── */
.tr-auth__card {
  background: var(--tr-white);
  border-radius: var(--tr-radius-lg);
  box-shadow: var(--tr-shadow-lg);
  padding: 2.5rem 2rem;
}

.tr-auth__card--verify {
  text-align: center;
}

/* ── Logo ─────────────────────────────────────────────────── */
.tr-auth__logo {
  display: flex; justify-content: center;
  margin-bottom: 1.75rem;
}
.tr-auth__logo img { max-height: 52px; }
.tr-auth__logo span {
  font-family: var(--tr-font-heading);
  font-size: 1.375rem; font-weight: 700;
  color: var(--tr-blue);
}

/* ── Títulos ──────────────────────────────────────────────── */
.tr-auth__titulo    { font-size: 1.5rem; text-align: center; margin-bottom: .375rem; }
.tr-auth__subtitulo { color: var(--tr-muted); text-align: center; font-size: .9375rem; margin-bottom: 1.5rem; }

/* ── Ícones de estado ─────────────────────────────────────── */
.tr-auth__icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 1rem;
}
.tr-auth__icon--success { background: #d1fae5; color: var(--tr-green); }
.tr-auth__icon--error   { background: #fee2e2; color: var(--tr-red); }
.tr-auth__icon--mail    { background: var(--tr-blue-light); color: var(--tr-blue); }

/* ── Alertas ──────────────────────────────────────────────── */
.tr-auth__alert {
  padding: .75rem 1rem;
  border-radius: var(--tr-radius-md);
  font-size: .9375rem;
  margin-bottom: 1rem;
}
.tr-auth__alert--error   { background: #fee2e2; color: #9b1c1c; border: 1px solid #fca5a5; }
.tr-auth__alert--success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ── Form ─────────────────────────────────────────────────── */
.tr-auth__form { display: flex; flex-direction: column; gap: 1.125rem; }

.tr-auth__field { display: flex; flex-direction: column; gap: .375rem; }
.tr-auth__field label {
  font-size: .875rem; font-weight: 600; color: var(--tr-blue);
  display: flex; align-items: center; justify-content: space-between;
}
.tr-auth__field input[type="text"],
.tr-auth__field input[type="email"],
.tr-auth__field input[type="password"],
.tr-auth__field input[type="tel"],
.tr-auth__field select {
  padding: .6875rem .875rem;
  border: 1.5px solid var(--tr-border);
  border-radius: var(--tr-radius-md);
  font-size: 1rem;
  color: var(--tr-ink);
  background: var(--tr-white);
  transition: border-color var(--tr-transition), box-shadow var(--tr-transition);
}
.tr-auth__field input:focus,
.tr-auth__field select:focus {
  outline: none;
  border-color: var(--tr-blue);
  box-shadow: 0 0 0 3px rgba(30,58,95,.12);
}
.tr-auth__field input:disabled {
  background: var(--tr-light);
  color: var(--tr-muted);
  cursor: not-allowed;
}
.tr-auth__field input.is-error { border-color: var(--tr-red); }
.tr-auth__field-error { font-size: .8125rem; color: var(--tr-red); min-height: 1em; }
.tr-auth__help { font-size: .8125rem; color: var(--tr-muted); }

.tr-auth__input-wrap { position: relative; }
.tr-auth__input-wrap input { width: 100%; padding-right: 2.75rem; }
.tr-auth__toggle-senha {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  font-size: 1.1rem; line-height: 1; color: var(--tr-muted);
}

.tr-auth__field--check { flex-direction: row; align-items: center; gap: .5rem; }
.tr-auth__field--check label { font-size: .9rem; font-weight: 400; color: var(--tr-ink); cursor: pointer; }
.tr-auth__check-label {
  display: flex; align-items: flex-start; gap: .625rem;
  font-size: .9rem; color: var(--tr-ink); cursor: pointer; line-height: 1.5;
}
.tr-auth__check-label input[type="checkbox"] {
  width: 17px; height: 17px; flex-shrink: 0;
  margin-top: .1rem; accent-color: var(--tr-blue);
}

/* ── Força da senha ───────────────────────────────────────── */
.tr-senha-forca {
  display: flex; align-items: center; gap: .75rem; margin-top: .375rem;
}
.tr-senha-forca__bar {
  flex: 1; height: 4px;
  background: var(--tr-border);
  border-radius: 4px;
  position: relative;
}
.tr-senha-forca__bar::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 4px;
  width: 0;
  transition: width .3s, background .3s;
}
.tr-senha-forca[data-forca="fraca"]   .tr-senha-forca__bar::after { width: 33%; background: var(--tr-red); }
.tr-senha-forca[data-forca="media"]   .tr-senha-forca__bar::after { width: 66%; background: var(--tr-orange); }
.tr-senha-forca[data-forca="forte"]   .tr-senha-forca__bar::after { width: 100%; background: var(--tr-green); }
.tr-senha-forca__label { font-size: .8125rem; color: var(--tr-muted); white-space: nowrap; }

/* ── Botão submit ─────────────────────────────────────────── */
.tr-auth__submit { width: 100%; justify-content: center; margin-top: .5rem; }

/* ── Tipo tabs ────────────────────────────────────────────── */
.tr-auth__tipo-tabs {
  display: flex; gap: .5rem;
  background: var(--tr-light);
  padding: .375rem;
  border-radius: var(--tr-radius-lg);
  margin-bottom: 1.5rem;
}
.tr-auth__tipo-tab {
  flex: 1; padding: .625rem;
  border-radius: var(--tr-radius-md);
  font-size: .9375rem; font-weight: 600;
  color: var(--tr-muted);
  transition: background var(--tr-transition), color var(--tr-transition), box-shadow var(--tr-transition);
  text-align: center;
}
.tr-auth__tipo-tab--active {
  background: var(--tr-white);
  color: var(--tr-blue);
  box-shadow: var(--tr-shadow-sm);
}

/* ── Links e rodapé ───────────────────────────────────────── */
.tr-auth__link         { color: var(--tr-gold); font-weight: 600; }
.tr-auth__link:hover   { color: var(--tr-gold-dark); text-decoration: underline; }
.tr-auth__link--right  { font-weight: 500; font-size: .875rem; }
.tr-auth__cadastrar    { text-align: center; font-size: .9375rem; color: var(--tr-muted); margin-top: 1.25rem; }
.tr-auth__reenviar-msg { text-align: center; font-size: .875rem; color: var(--tr-muted); }
.tr-auth__reenviar     { width: 100%; justify-content: center; }

/* ── Modal ────────────────────────────────────────────────── */
.tr-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.tr-modal[hidden] { display: none; }
.tr-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
}
.tr-modal__box {
  position: relative; z-index: 1;
  background: var(--tr-white);
  border-radius: var(--tr-radius-lg);
  box-shadow: var(--tr-shadow-lg);
  width: 100%; max-width: 580px;
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.tr-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--tr-border);
}
.tr-modal__header h2 { font-size: 1.125rem; }
.tr-modal__close { font-size: 1.5rem; color: var(--tr-muted); line-height: 1; }
.tr-modal__close:hover { color: var(--tr-ink); }
.tr-modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  font-size: .9375rem; line-height: 1.7;
}
.tr-modal__body h3 { font-size: 1rem; margin: 1rem 0 .5rem; color: var(--tr-blue); }
.tr-modal__body p  { color: var(--tr-muted); margin-bottom: .75rem; }
.tr-modal__footer {
  padding: 1rem 1.5rem;
  display: flex; gap: .75rem;
  border-top: 1px solid var(--tr-border);
}

/* ── Upload foto do corretor ──────────────────────────────── */
.tr-foto-corretor-upload {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.tr-foto-corretor-upload__preview {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--tr-light);
  border: 2px solid var(--tr-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--tr-muted);
  flex-shrink: 0;
  overflow: hidden;
}
.tr-foto-corretor-upload__info {
  display: flex; flex-direction: column; gap: .5rem;
}
.tr-btn--sm {
  padding: .4rem .875rem;
  font-size: .875rem;
}

@media (max-width: 480px) {
  .tr-auth__card { padding: 2rem 1.25rem; }
  .tr-foto-corretor-upload { flex-direction: column; align-items: flex-start; }
}
