/*
 * Login TRUSTCOMEX — preto, ouro e prata (alinhado à marca logo_trustcomex.png)
 * Tipografia: Outfit + Plus Jakarta Sans
 */

html.auth-page,
body.auth-page {
  height: 100%;
  margin: 0;
}

body.auth-page--trustcomex {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: #040404;
  color: #e8e4dc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

body.auth-page main {
  height: 100% !important;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100dvh;
}

/* ——— Fundo atmosférico (dourado âmbar, quente) ——— */
body.auth-page .auth-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse 100% 80% at 50% -20%, rgba(26, 20, 10, 0.9) 0%, #040404 45%);
}

body.auth-page .auth-canvas__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

body.auth-page .auth-canvas__glow--1 {
  width: min(100vw, 480px);
  height: min(100vw, 480px);
  top: -12%;
  left: -5%;
  background: radial-gradient(circle, rgba(201, 162, 55, 0.28) 0%, transparent 68%);
  opacity: 0.85;
}

body.auth-page .auth-canvas__glow--2 {
  width: min(80vw, 400px);
  height: min(80vw, 400px);
  bottom: 5%;
  right: -8%;
  background: radial-gradient(circle, rgba(180, 150, 70, 0.18) 0%, transparent 70%);
  opacity: 0.7;
}

body.auth-page .auth-canvas__glow--3 {
  width: 360px;
  height: 360px;
  top: 45%;
  left: 20%;
  background: radial-gradient(circle, rgba(90, 75, 50, 0.12) 0%, transparent 70%);
  opacity: 0.5;
}

body.auth-page .auth-canvas__grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}

body.auth-page .auth-canvas__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 192, 160, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 192, 160, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 75% at 50% 35%, black 10%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 35%, black 10%, transparent 100%);
}

/* ——— Conteúdo ——— */
body.auth-page .auth-trustcomex {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 1.5rem) max(0.9rem, env(safe-area-inset-left, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px)) max(0.9rem, env(safe-area-inset-right, 0px));
  padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

body.auth-page .auth-trustcomex__inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

/* Seletor de idioma (PT / EN / ES) */
body.auth-page .auth-lang {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0 0 0.9rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 0.2rem; /* evita corte nas bordas com overflow-x no body */
}

body.auth-page .auth-lang__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: #8a7f72;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 184, 140, 0.22);
  border-radius: 10px;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

body.auth-page .auth-lang__link:hover {
  color: #d4c4a8;
  border-color: rgba(212, 175, 80, 0.4);
  background: rgba(20, 18, 12, 0.55);
}

body.auth-page .auth-lang__link.is-active {
  color: #0f0d0a;
  background: linear-gradient(165deg, #e8d5a0 0%, #c9a24a 45%, #9a7820 100%);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
  pointer-events: none;
  cursor: default;
}

body.auth-page .auth-lang__link:focus-visible {
  outline: 2px solid rgba(212, 175, 80, 0.65);
  outline-offset: 2px;
}

body.auth-page .auth-trustcomex__header {
  text-align: center;
  margin-bottom: 1.75rem;
  animation: authFadeUp 0.75s ease backwards;
}

body.auth-page .auth-hero-mark {
  margin: 0 auto 1.25rem;
  max-width: min(20rem, 88vw);
}

body.auth-page .auth-hero-mark__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(7.5rem, 22vh);
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.6));
}

body.auth-page .auth-hero-tagline {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #a8a29a;
  margin: 0;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 0.01em;
  animation: authFadeUp 0.75s ease 0.08s backwards;
}

/* ——— Cartão ——— */
body.auth-page .auth-card--gold {
  position: relative;
  padding: 1.75rem 1.6rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(20, 18, 16, 0.92) 0%, rgba(8, 8, 8, 0.88) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(201, 184, 140, 0.2);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 28px 64px -24px rgba(0, 0, 0, 0.8),
    0 0 80px -40px rgba(201, 162, 55, 0.12);
  animation: authFadeUp 0.8s ease 0.1s backwards;
}

body.auth-page .auth-card__shine {
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(230, 210, 160, 0.45),
    rgba(201, 162, 55, 0.35),
    rgba(230, 210, 160, 0.45),
    transparent
  );
  border-radius: 999px;
  pointer-events: none;
}

body.auth-page .auth-form-head {
  margin-bottom: 1.4rem;
}

body.auth-page .auth-form-kicker {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a7f72;
  margin: 0 0 0.5rem;
}

body.auth-page .auth-form-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f4efe6;
  margin: 0;
  line-height: 1.25;
}

body.auth-page .auth-field-wrap {
  margin-bottom: 1.05rem;
}

body.auth-page .auth-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #a39e94;
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
}

body.auth-page .auth-field {
  width: 100%;
  min-height: 50px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  color: #f4efe6;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(192, 180, 150, 0.22);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}

body.auth-page .auth-field::placeholder {
  color: transparent;
}

body.auth-page .auth-field:hover {
  border-color: rgba(201, 162, 55, 0.35);
}

body.auth-page .auth-field:focus {
  outline: none;
  border-color: rgba(212, 175, 80, 0.65);
  background: rgba(0, 0, 0, 0.65);
  box-shadow: 0 0 0 3px rgba(201, 162, 55, 0.12);
}

body.auth-page .auth-btn--gold {
  width: 100%;
  min-height: 52px;
  margin-top: 0.45rem;
  padding: 0 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #12100c;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(
    168deg,
    #f0d78c 0%,
    #d4af37 32%,
    #b8962e 58%,
    #7d6220 100%
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 4px 0 0 rgba(0, 0, 0, 0.25),
    0 12px 36px -6px rgba(201, 162, 55, 0.45);
  transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
}

body.auth-page .auth-btn--gold:hover {
  filter: brightness(1.05);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28) inset,
    0 4px 0 0 rgba(0, 0, 0, 0.2),
    0 16px 44px -4px rgba(201, 162, 55, 0.5);
}

body.auth-page .auth-btn--gold:active {
  transform: translateY(1px) scale(0.995);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 2px 0 0 rgba(0, 0, 0, 0.3),
    0 8px 24px -4px rgba(201, 162, 55, 0.35);
}

body.auth-page .auth-btn__icon {
  font-size: 0.82rem;
  opacity: 0.9;
  transition: transform 0.2s;
  color: #12100c;
}

body.auth-page .auth-btn--gold:hover .auth-btn__icon {
  transform: translateX(3px);
}

body.auth-page .auth-help {
  font-size: 0.76rem;
  color: #6f6a63;
  margin: 1.1rem 0 0;
  line-height: 1.45;
  text-align: center;
}

body.auth-page .auth-back-site {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 1.1rem auto 0;
  width: 100%;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9c958c;
  text-decoration: none;
  transition: color 0.2s;
}

body.auth-page .auth-back-site:hover {
  color: #d4af37;
}

body.auth-page .auth-back-site__arrow {
  transition: transform 0.2s;
}

body.auth-page .auth-back-site:hover .auth-back-site__arrow {
  transform: translateX(-3px);
}

/* Rodapé login */
body.auth-page .auth-trustcomex__foot {
  margin-top: 2rem;
  text-align: center;
  animation: authFadeUp 0.85s ease 0.18s backwards;
}

body.auth-page .auth-by-bk {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #6f6a63;
  text-transform: none;
  margin: 0 0 0.35rem;
}

body.auth-page .auth-legal-mini {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: #4a4744;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* Alertas */
body.auth-page .auth-alert {
  border-radius: 12px;
  font-size: 0.85rem;
  border: 1px solid transparent;
}

body.auth-page .auth-alert.alert-danger {
  background: rgba(80, 20, 20, 0.5);
  border-color: rgba(220, 120, 120, 0.3);
  color: #fecaca;
}

body.auth-page .auth-alert.alert-success {
  background: rgba(20, 60, 40, 0.45);
  border-color: rgba(100, 200, 140, 0.28);
  color: #a7f3d0;
}

body.auth-page .auth-alert.alert-warning {
  background: rgba(80, 50, 10, 0.45);
  border-color: rgba(220, 180, 80, 0.3);
  color: #fde68a;
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 575.98px) {
  body.auth-page .auth-hero-mark__img {
    max-height: 5.75rem;
  }

  body.auth-page .auth-hero-mark {
    max-width: min(18rem, 92vw);
  }

  body.auth-page .auth-hero-tagline {
    font-size: 0.86rem;
    line-height: 1.5;
  }

  body.auth-page .auth-trustcomex__header {
    margin-bottom: 1.15rem;
  }

  body.auth-page .auth-card--gold {
    padding: 1.35rem 1.1rem 1.25rem;
    border-radius: 16px;
  }

  body.auth-page .auth-form-title {
    font-size: 1.12rem;
    letter-spacing: 0.04em;
  }

  body.auth-page .auth-field {
    min-height: 48px;
    font-size: 1rem; /* iOS: evita zoom no focus */
  }

  body.auth-page .auth-btn--gold {
    min-height: 50px;
    font-size: 0.8rem;
  }

  body.auth-page .auth-lang {
    margin-bottom: 0.75rem;
    gap: 0.28rem;
    padding-left: max(0.1rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.1rem, env(safe-area-inset-right, 0px));
  }

  body.auth-page .auth-lang__link {
    min-width: 2.35rem;
    min-height: 2.25rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }

  /* Conteúdo mais alto em PT/ES empurra o bloco para cima com align:center — no mobile
     alinhamos ao topo e damos respiro fixo para o seletor de idioma não colar no edge. */
  body.auth-page .auth-trustcomex {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: max(1.15rem, calc(env(safe-area-inset-top, 0px) + 0.7rem));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
    padding-left: max(1.05rem, calc(env(safe-area-inset-left, 0px) + 0.35rem));
    padding-right: max(1.05rem, calc(env(safe-area-inset-right, 0px) + 0.35rem));
  }
}

@media (max-width: 380px) {
  body.auth-page .auth-lang {
    gap: 0.22rem;
  }

  body.auth-page .auth-lang__link {
    min-width: 2.1rem;
    min-height: 2.1rem;
    padding: 0.26rem 0.38rem;
    font-size: 0.64rem;
    letter-spacing: 0.05em;
  }
}
