/* Auth (login / registo) — tema claro inspirado em plataformas de trading */
:root {
  --at-bg: #ffffff;
  --at-text: #1a1a1a;
  --at-muted: #6b7280;
  --at-border: #e5e7eb;
  --at-input-border: #d1d5db;
  --at-green: #00a63f;
  --at-green-hover: #009038;
  --at-link: #7d67c5;
  --at-error: #dc2626;
  --at-radius: 6px;
  --at-radius-lg: 8px;
}

.auth-trading-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--at-text);
  background: var(--at-bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.auth-topbar {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 8px;
}

.auth-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--at-text);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.auth-logo img {
  display: block;
  height: auto;
  max-height: 40px;
  width: auto;
  max-width: min(220px, 55vw);
  object-fit: contain;
}

/* Login: marca em preto (silhueta) sobre fundo claro */
.auth-logo-img--login-black {
  filter: brightness(0);
}

.auth-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Botão de idioma (estrutura semelhante a lang-menu-button + logo Braszul) */
.auth-lang-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--at-input-border);
  border-radius: var(--at-radius);
  background: #fff;
  font: inherit;
  color: var(--at-text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-lang-menu-button:hover {
  background: #f9fafb;
  border-color: #c4c9d1;
}

.auth-lang-menu-button:focus-visible {
  outline: 2px solid var(--at-green);
  outline-offset: 2px;
}

.auth-lang-menu-button__icon {
  display: flex;
  align-items: center;
  line-height: 0;
}

.auth-lang-menu-button__icon img {
  display: block;
  height: 22px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
}

.auth-lang-menu-button__label {
  font-size: 14px;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--at-text);
  line-height: 1;
}

.auth-btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--at-radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--at-input-border);
  background: #fff;
  color: var(--at-text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-btn-header:hover {
  background: #f9fafb;
  border-color: #c4c9d1;
}

.auth-btn-header--green {
  border: none;
  background: var(--at-green);
  color: #fff;
}

.auth-btn-header--green:hover {
  background: var(--at-green-hover);
  color: #fff;
}

@media (max-width: 520px) {
  .auth-topbar {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .auth-topbar-actions {
    gap: 8px;
  }

  .auth-lang-menu-button {
    padding: 4px 8px 4px 4px;
    gap: 6px;
  }

  .auth-lang-menu-button__icon img {
    height: 18px;
    max-width: 46px;
  }

  .auth-lang-menu-button__label {
    font-size: 13px;
  }

  .auth-topbar-actions .auth-btn-header {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    white-space: nowrap;
  }

  /* Link «Inscrever-se» / «Entrar» no rodapé do cartão */
  .auth-subnav {
    font-size: 13px;
  }

  .auth-subnav a {
    font-size: 13px;
  }
}

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 20px 32px;
  width: 100%;
  box-sizing: border-box;
}

.auth-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 400px;
  padding: 8px 0 0;
}

.auth-card h1 {
  margin: 0 0 24px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  color: #374151;
}

.auth-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--at-radius-lg);
  font-size: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--at-error);
}

.auth-field {
  margin-bottom: 14px;
}

.auth-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 16px mínimo: Safari no iPhone faz zoom automático ao focar se for < 16px */
.auth-field input,
.auth-field select {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--at-radius);
  border: 1px solid var(--at-input-border);
  background: #fff;
  color: var(--at-text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input::placeholder {
  color: #9ca3af;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--at-green);
  box-shadow: 0 0 0 3px rgba(0, 166, 63, 0.15);
}

.auth-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.auth-country-select-wrap {
  position: relative;
  width: 100%;
}

.auth-country-flag {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: 22px;
  width: auto;
  max-width: 44px;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

.auth-country-select-wrap select {
  padding-left: 52px;
}

.auth-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--at-muted);
  line-height: 1.4;
}

.auth-terms {
  margin: 16px 0 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--at-muted);
}

.auth-terms a {
  color: var(--at-link);
  font-weight: 600;
  text-decoration: none;
}

.auth-terms a:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 14px 18px;
  min-height: 48px;
  border: none;
  border-radius: var(--at-radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  color: #fff;
  background: var(--at-green);
  transition: background 0.15s ease, transform 0.1s ease;
}

.auth-submit:hover {
  background: var(--at-green-hover);
}

.auth-submit:active {
  transform: scale(0.995);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--at-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--at-border);
}

a.auth-google {
  text-decoration: none;
  box-sizing: border-box;
}

.auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--at-input-border);
  border-radius: var(--at-radius);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--at-text);
  cursor: pointer;
  opacity: 1;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-google:hover {
  background: #f9fafb;
  border-color: #c4c9d1;
}

.auth-google:focus-visible {
  outline: 2px solid var(--at-green);
  outline-offset: 2px;
}

.auth-google svg {
  flex-shrink: 0;
}

.auth-subnav {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--at-muted);
}

.auth-subnav a {
  color: var(--at-link);
  font-weight: 600;
  text-decoration: none;
}

.auth-subnav a:hover {
  text-decoration: underline;
}

.auth-forgot {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

.auth-forgot a {
  color: var(--at-muted);
  text-decoration: none;
}

.auth-forgot a:hover {
  color: var(--at-text);
  text-decoration: underline;
}

.auth-risk {
  margin-top: 28px;
  padding: 16px 14px 14px;
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius-lg);
  font-size: 12px;
  line-height: 1.5;
  color: var(--at-muted);
  text-align: center;
}

.auth-risk strong {
  display: block;
  margin-bottom: 6px;
  color: var(--at-text);
  font-size: 12px;
}

.auth-page-footer {
  margin-top: auto;
  padding: 20px 16px 24px;
  border-top: 1px solid var(--at-border);
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}

.auth-row2 {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
}

@media (min-width: 480px) {
  .auth-row2 {
    grid-template-columns: 1fr 1fr;
  }
}
