/* ============================================================
   Mapa Astral — Tela de Login / Criar conta (Chaos Society)
   Monocromático · preto/branco/cinza · tudo quadrado.
   Overlay #cs-auth (z-index 300, acima do onboarding 200).
   Classes prefixadas com cs-auth- para não colidir.
   ============================================================ */

#cs-auth,
#cs-auth * {
  border-radius: 0 !important;
  box-sizing: border-box;
}

#cs-auth {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, 0.05), transparent 55%),
    #000000;
  color: #ffffff;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding:
    calc(env(safe-area-inset-top, 0px) + 20px)
    calc(env(safe-area-inset-right, 0px) + 18px)
    calc(env(safe-area-inset-bottom, 0px) + 28px)
    calc(env(safe-area-inset-left, 0px) + 18px);
}

#cs-auth.is-open {
  display: block;
}

/* Trava o scroll do corpo quando a tela está aberta */
body.cs-auth-locked {
  overflow: hidden;
}

.cs-auth-shell {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ---------- Cabeçalho / logo ---------- */
.cs-auth-head {
  text-align: center;
  padding: 10px 0 6px;
}

.cs-auth-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  display: block;
  margin: 0 auto 14px;
  filter: grayscale(100%) brightness(1.2);
  background: transparent;
}

.cs-auth-title {
  font-family: 'Cinzel', 'Inter', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
  color: #ffffff;
}

.cs-auth-subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: #9a9a9a;
  margin: 0 auto;
  max-width: 320px;
}

/* ---------- Marca da casa, entre o cabeçalho e as abas ----------
   Esta tarja existia no HTML desde sempre e NUNCA teve regra de estilo:
   por isso ela encostava nas abas ENTRAR / CRIAR CONTA em tela estreita.
   Agora que a conta é obrigatória, esta é a primeira tela de todo app. */
.cs-auth-sigil {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px auto 4px;
  padding: 0 12px;
  opacity: .55;
}
.cs-auth-sigil img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}
.cs-auth-sigil span {
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9a9a9a;
  line-height: 1.3;
}

/* ---------- Abas ---------- */
.cs-auth-tabs {
  display: flex;
  margin: 22px 0 18px;
  border: 1px solid #2a2a2a;
}

.cs-auth-tab {
  flex: 1 1 0;
  min-height: 48px;
  padding: 12px 8px;
  background: #0b0b0b;
  color: #9a9a9a;
  border: 0;
  border-right: 1px solid #2a2a2a;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.cs-auth-tab:last-child {
  border-right: 0;
}

.cs-auth-tab[aria-selected="true"] {
  background: #ffffff;
  color: #000000;
}

.cs-auth-tab:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -4px;
}

/* ---------- Painéis ---------- */
.cs-auth-panel {
  display: none;
  flex: 1 1 auto;
}

.cs-auth-panel.is-active {
  display: block;
}

/* ---------- Formulários / campos ---------- */
.cs-auth-field {
  margin-bottom: 16px;
}

.cs-auth-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #cfcfcf;
  margin-bottom: 7px;
}

.cs-auth-label .cs-auth-opt {
  color: #6f6f6f;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.cs-auth-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: #111111;
  border: 1px solid #2a2a2a;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px; /* evita zoom no iOS */
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
}

.cs-auth-input::placeholder {
  color: #6f6f6f;
}

.cs-auth-input:focus {
  outline: none;
  border-color: #ffffff;
  background: #161616;
}

.cs-auth-input:focus-visible {
  outline: none;
  border-color: #ffffff;
}

.cs-auth-input.cs-auth-invalid {
  border-color: #ffffff;
  box-shadow: inset 0 0 0 1px #ffffff;
}

.cs-auth-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #9a9a9a;
}

/* ---------- Upload de foto ---------- */
.cs-auth-photo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cs-auth-photo-preview {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  background: #111111;
  border: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 10px;
  text-align: center;
  color: #6f6f6f;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cs-auth-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.cs-auth-photo-btn {
  flex: 1 1 auto;
  min-height: 52px;
  padding: 12px 14px;
  background: #111111;
  border: 1px solid #2a2a2a;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: center;
}

.cs-auth-photo-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

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

/* ---------- Checkboxes de aceite ---------- */
.cs-auth-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #0e0e0e;
  border: 1px solid #2a2a2a;
  cursor: pointer;
  min-height: 44px;
}

.cs-auth-check input[type="checkbox"] {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: #ffffff;
  cursor: pointer;
}

.cs-auth-check-text {
  font-size: 13px;
  line-height: 1.45;
  color: #cfcfcf;
}

/* ---------- Botões ---------- */
.cs-auth-btn {
  width: 100%;
  min-height: 54px;
  padding: 15px 18px;
  border: 1px solid #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.cs-auth-btn-primary {
  background: #ffffff;
  color: #000000;
}

.cs-auth-btn-primary:hover {
  background: #e8e8e8;
}

.cs-auth-btn-ghost {
  background: transparent;
  color: #ffffff;
  border-color: #2a2a2a;
}

.cs-auth-btn-ghost:hover {
  border-color: #ffffff;
}

.cs-auth-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.cs-auth-btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

/* ---------- Navegação do wizard ---------- */
.cs-auth-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.cs-auth-step-dot {
  flex: 1 1 0;
  height: 4px;
  background: #2a2a2a;
}

.cs-auth-step-dot.is-done {
  background: #9a9a9a;
}

.cs-auth-step-dot.is-current {
  background: #ffffff;
}

.cs-auth-step-caption {
  font-size: 12px;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.cs-auth-wizard-page {
  display: none;
}

.cs-auth-wizard-page.is-active {
  display: block;
}

.cs-auth-nav {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.cs-auth-nav .cs-auth-btn {
  flex: 1 1 0;
}

/* ---------- Mensagens de feedback ---------- */
.cs-auth-msg {
  display: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid #2a2a2a;
  background: #0e0e0e;
  color: #ffffff;
}

.cs-auth-msg.is-visible {
  display: block;
}

.cs-auth-msg.cs-auth-msg-error {
  border-color: #ffffff;
  background: #161616;
}

.cs-auth-msg.cs-auth-msg-error::before {
  content: "⚠ ";
  font-weight: 800;
}

.cs-auth-msg.cs-auth-msg-ok::before {
  content: "✓ ";
  font-weight: 800;
}

/* ---------- Rodapé / offline ---------- */
.cs-auth-foot {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
}

.cs-auth-offline {
  background: none;
  border: 0;
  color: #9a9a9a;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 10px 14px;
  min-height: 44px;
}

.cs-auth-offline:hover {
  color: #ffffff;
}

.cs-auth-offline:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* ---------- Estado "cadastro indisponível" ---------- */
.cs-auth-notice {
  padding: 18px;
  border: 1px solid #2a2a2a;
  background: #0e0e0e;
  text-align: center;
}

.cs-auth-notice p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #cfcfcf;
}

/* Esconde utilitário */
.cs-auth-hidden {
  display: none !important;
}

/* Spinner / loading inline */
.cs-auth-btn.is-loading {
  position: relative;
  color: inherit;
}

@media (max-width: 380px) {
  .cs-auth-tab {
    font-size: 12px;
    letter-spacing: 0.04em;
  }
}

/* a conta é a mesma do site: dito em voz baixa, mas dito */
.cs-auth-nota { margin: 6px 0 0; font-size: 11px; line-height: 1.4; opacity: .62; text-align: center; }
