/* ==========================================================================
   ATLAS BINARY — Login / Cadastro
   Depende de landing-modern.css (tokens, botões, .am-card)
   ========================================================================== */

.am-auth {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Coluna do formulário ---------- */
.am-auth-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 56px) clamp(20px, 4vw, 64px);
}

.am-auth-box {
  width: 100%;
  max-width: 452px;
  margin: 0 auto;
}

.am-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 34px;
  padding: 8px 15px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--t2);
  font-size: 13px;
  font-weight: 500;
  transition: color .25s, border-color .25s, background .25s, gap .3s var(--ease);
}

.am-auth-back svg {
  width: 15px;
  height: 15px;
}

.am-auth-back:hover {
  color: var(--t1);
  border-color: var(--line-gold);
  background: rgba(255, 255, 255, .04);
  gap: 11px;
}

.am-auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.am-auth-logo img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.am-auth-title {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.2vw, 2.15rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
  margin-bottom: 10px;
}

.am-auth-sub {
  color: var(--t2);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 30px;
}

/* ---------- Alertas ---------- */
.am-alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.am-alert svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
}

.am-alert-error {
  border-color: rgba(255, 91, 91, .3);
  background: rgba(255, 91, 91, .09);
  color: #FFB4B4;
}

.am-alert-success {
  border-color: rgba(49, 208, 126, .3);
  background: rgba(49, 208, 126, .09);
  color: #9AEFC4;
}

.am-alert-info {
  border-color: var(--line-gold);
  background: rgba(224, 184, 58, .09);
  color: var(--gold-100);
}

.am-alert strong {
  font-family: var(--mono);
  font-weight: 600;
}

/* ---------- Campos ---------- */
.am-fg {
  margin-bottom: 18px;
}

.am-fg label {
  display: block;
  margin-bottom: 9px;
  color: var(--t2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.am-iw {
  position: relative;
  display: flex;
  align-items: center;
  height: 54px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .32);
  transition: border-color .3s, box-shadow .3s, background .3s;
}

.am-iw:focus-within {
  border-color: var(--gold-400);
  background: rgba(0, 0, 0, .45);
  box-shadow: 0 0 0 4px rgba(224, 184, 58, .1);
}

.am-iw>.am-iw-ico {
  display: grid;
  place-items: center;
  width: 46px;
  flex: none;
  color: var(--t3);
  transition: color .3s;
}

.am-iw:focus-within>.am-iw-ico {
  color: var(--gold-400);
}

.am-iw-ico svg {
  width: 18px;
  height: 18px;
}

.am-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px 0 0;
  border: none;
  outline: none;
  background: none;
  color: var(--t1);
  font-family: var(--body);
  font-size: 16px;
}

.am-input::placeholder {
  color: var(--t3);
}

.am-input:-webkit-autofill,
.am-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #100E0C inset;
  caret-color: #fff;
}

.am-eye {
  display: grid;
  place-items: center;
  width: 46px;
  height: 100%;
  flex: none;
  color: var(--t3);
  transition: color .25s;
}

.am-eye:hover {
  color: var(--t1);
}

.am-eye svg {
  width: 18px;
  height: 18px;
}

/* Telefone: seletor de país + campo */
.am-phone {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
}

.am-select {
  height: 54px;
  padding: 0 34px 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .32) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B675F' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--t1);
  font-family: var(--mono);
  font-size: 13.5px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color .3s;
}

.am-select:focus {
  border-color: var(--gold-400);
}

.am-select option {
  background: #14120F;
  color: #fff;
}

/* Grid de dois campos por linha */
.am-fg-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* ---------- Checkbox ---------- */
.am-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 4px 0 24px;
  cursor: pointer;
  user-select: none;
}

.am-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.am-check-box {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  flex: none;
  margin-top: 1px;
  transition: border-color .25s, background .25s;
}

.am-check-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: no-repeat center/11px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317130A' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  opacity: 0;
  transform: scale(.5);
  transition: opacity .2s, transform .25s var(--ease);
}

.am-check input:checked+.am-check-box {
  background: var(--grad-gold);
  border-color: var(--gold-400);
}

.am-check input:checked+.am-check-box::after {
  opacity: 1;
  transform: scale(1);
}

.am-check input:focus-visible+.am-check-box {
  box-shadow: 0 0 0 4px rgba(224, 184, 58, .18);
}

.am-check-txt {
  color: var(--t2);
  font-size: 13.5px;
  line-height: 1.45;
}

.am-check-txt small {
  display: block;
  color: var(--t3);
  font-size: 12px;
}

/* ---------- Rodapé do formulário ---------- */
.am-auth-switch {
  margin-top: 22px;
  text-align: center;
  color: var(--t2);
  font-size: 14px;
}

.am-auth-switch a {
  color: var(--gold-300);
  font-weight: 600;
}

.am-auth-switch a:hover {
  color: var(--gold-100);
}

.am-auth-terms {
  margin-top: 18px;
  color: var(--t3);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.am-auth-terms a {
  color: var(--t2);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .2);
  text-underline-offset: 2px;
}

.am-auth-terms a:hover {
  color: var(--gold-200);
}

/* ==========================================================================
   COLUNA DA MARCA
   ========================================================================== */

.am-auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  padding: clamp(34px, 4vw, 62px);
  border-left: 1px solid var(--line);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(224, 184, 58, .14), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(0, 0, 0, .34));
  overflow: hidden;
}

.am-auth-aside::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 70% 30%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 30%, #000, transparent 78%);
  pointer-events: none;
}

.am-auth-aside-in {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.am-auth-aside h2 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.035em;
  margin-bottom: 16px;
}

.am-auth-aside p {
  color: var(--t2);
  font-size: 14.5px;
  line-height: 1.66;
}

.am-props {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 32px;
}

.am-prop {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.am-prop-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(224, 184, 58, .1);
  border: 1px solid var(--line-gold);
  color: var(--gold-400);
}

.am-prop-ico svg {
  width: 18px;
  height: 18px;
}

.am-prop b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.015em;
  margin-bottom: 2px;
}

.am-prop span {
  display: block;
  color: var(--t2);
  font-size: 13px;
  line-height: 1.5;
}

/* Mini cartão de rendimento */
.am-auth-mock {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  padding: 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(10, 9, 8, .6);
  backdrop-filter: blur(14px);
  max-width: 460px;
}

.am-auth-mock-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.am-auth-mock-hd b {
  font-size: 13px;
  font-weight: 600;
}

.am-auth-mock-hd span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(49, 208, 126, .11);
  border: 1px solid rgba(49, 208, 126, .22);
  color: var(--up);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.am-auth-mock-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--line);
}

.am-auth-mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, .026);
  font-size: 12.5px;
}

.am-auth-mock-row span {
  color: var(--t2);
}

.am-auth-mock-row strong {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: -.03em;
}

.am-auth-mock-row strong.is-up {
  color: var(--up);
}

.am-auth-risk {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  max-width: 460px;
  color: var(--t3);
  font-size: 11.5px;
  line-height: 1.6;
}

/* Idioma no canto */
.am-auth-lang {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(12, 11, 9, .7);
  backdrop-filter: blur(14px);
}

.am-auth-lang svg {
  width: 18px;
  height: 18px;
  border-radius: 3px;
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */

@media (max-width: 1024px) {
  .am-auth {
    grid-template-columns: 1fr;
  }

  .am-auth-aside {
    display: none;
  }

  .am-auth-col {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

@media (max-width: 560px) {
  .am-auth-col {
    padding: 24px 18px 40px;
    justify-content: flex-start;
  }

  .am-auth-back {
    margin-bottom: 24px;
  }

  .am-auth-logo img {
    height: 40px;
  }

  .am-fg-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .am-phone {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .am-auth-lang {
    top: 14px;
    right: 14px;
  }
}

/* ===== Otimização mobile: sem scroll animado ao focar + sem zoom do iOS ===== */
html {
  scroll-behavior: auto;
}

@media (max-width: 560px) {
  .am-select {
    font-size: 16px;
  }
}

/* ===== Performance mobile: troca backdrop-filter por fundo opaco ===== */
@media (max-width: 900px) {

  .am-auth-mock {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 9, 8, .92);
  }

  .am-auth-lang {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(12, 11, 9, .95);
  }
}
