/* ==========================================================================
   net.css — Camada online: login, tela de erro, status de conexão, logout.
   Usa os tokens de css/styles.css (tema claro/escuro).
   ========================================================================== */

/* Tela cheia (login e erro fatal) */
.net-fatal {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 1.25rem;
  background: var(--bg, #171a2b); color: var(--text, #eceaf4);
  overflow-y: auto;
}
.net-card {
  width: min(400px, 100%);
  display: flex; flex-direction: column; gap: .9rem;
  padding: 1.75rem 1.5rem;
  background: var(--surface, #212539);
  border: 1px solid var(--line, #363b5c);
  border-radius: var(--r-lg, 16px);
  box-shadow: var(--shadow, none);
  text-align: left;
}
.net-card h1 { font-size: var(--fs-xl, 1.6rem); text-align: center; color: var(--text); }
.net-logo { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.net-logo .logo-icon { width: 88px; height: 88px; }
.net-card > p, .net-sub { color: var(--muted, #9c9ebb); text-align: center; font-size: var(--fs-sm, .95rem); }

.net-field { display: flex; flex-direction: column; gap: .3rem; font-size: var(--fs-sm, .95rem); font-weight: 700; }
.net-field input {
  font: inherit; font-weight: 400;
  padding: .65rem .75rem;
  color: var(--text, #eceaf4);
  background: var(--surface-2, #2a2f47);
  border: 1px solid var(--line, #363b5c);
  border-radius: var(--r-md, 10px);
}
.net-field input:focus-visible { outline: 2px solid var(--accent, #8b9bff); outline-offset: 1px; }

.net-error {
  padding: .55rem .7rem; border-radius: var(--r-sm, 6px);
  font-size: var(--fs-sm, .95rem);
  color: var(--hard, #e0566b);
  background: color-mix(in srgb, var(--hard, #e0566b) 12%, transparent);
}
.net-submit { width: 100%; justify-content: center; }
.net-submit:disabled { opacity: .7; cursor: progress; }
.net-link {
  align-self: center; background: none; border: 0; padding: .25rem;
  color: var(--accent, #8b9bff); font: inherit; font-size: var(--fs-sm, .95rem);
  cursor: pointer; text-decoration: underline;
}
/* Idioma antes do login (docs/archive/I18N-SPEC.md 1.4): os três nomes lado a lado, o atual sem sublinhado. */
.net-langs { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem .75rem; margin-top: .25rem; }
.net-langs .net-link { font-size: var(--fs-xs, .8rem); color: var(--muted, #9c9ebb); }
.net-langs .net-link.is-current { color: var(--text, #eceaf4); text-decoration: none; font-weight: 600; cursor: default; }

/* Confirmação por e-mail, recuperação de senha e Turnstile (docs/AUTH-EMAIL-SPEC.md 5.3) */
.net-field input[readonly] { opacity: .75; cursor: default; }
.net-card > .net-text { color: var(--text, #eceaf4); }
.net-card > .net-text b { overflow-wrap: anywhere; }
.net-card > .net-note { font-size: var(--fs-xs, .8rem); }
.net-card > .net-info {
  padding: .55rem .7rem; border-radius: var(--r-sm, 6px);
  font-size: var(--fs-sm, .95rem); text-align: center;
  color: var(--text, #eceaf4);
  background: color-mix(in srgb, var(--brand, #3b95cc) 14%, transparent);
}
/* Reserva a altura do widget (65 px) para o cartão não pular quando ele aparece. */
.net-turnstile { display: flex; justify-content: center; min-height: 65px; }

/* Selo de status (offline / sincronizando) */
.net-badge {
  position: fixed; left: 50%; bottom: 1rem; z-index: 900;
  transform: translateX(-50%);
  padding: .4rem .85rem; border-radius: 999px;
  font-size: var(--fs-xs, .8rem); font-weight: 700;
  background: var(--surface-2, #2a2f47); color: var(--text, #eceaf4);
  border: 1px solid var(--line, #363b5c);
  box-shadow: var(--shadow, none);
  pointer-events: none;
}
.net-badge[hidden] { display: none; }
.net-badge[data-state="offline"] { border-color: var(--hard, #e0566b); }
.net-badge[data-state="offline"]::before { content: '● '; color: var(--hard, #e0566b); }
.net-badge[data-state="syncing"]::before { content: '● '; color: var(--medium, #e9a23b); animation: net-pulse 1s ease-in-out infinite; }

@keyframes net-pulse { 50% { opacity: .3; } }

/* Botão de sair no rodapé da barra lateral */
.net-logout { font-size: 1.1rem; line-height: 1; }

/* Luta aguardando o servidor */
.net-waiting { opacity: .7; cursor: progress; }

@media (max-width: 720px) {
  .net-badge { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .net-badge[data-state="syncing"]::before { animation: none; }
}

/* Site e app em app.xpnotes.com (docs/SITE-SPEC.md 4.3 e 8.1) */
.net-check {
  display: flex; align-items: flex-start; gap: .55rem;
  font-size: var(--fs-sm, .95rem); color: var(--text, #eceaf4); cursor: pointer;
}
.net-check input { width: 1.1rem; height: 1.1rem; margin: .1rem 0 0; flex: none; accent-color: var(--accent, #8b9bff); }
.net-check input:focus-visible { outline: 2px solid var(--accent, #8b9bff); outline-offset: 2px; }
.net-move {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
  padding: .6rem 1rem; text-align: center;
  font-size: var(--fs-sm, .95rem); font-weight: 600;
  color: var(--on-brand, #fff); background: var(--brand-fill, #2677ad);
}
