/* ═══════════════════════════════════════════════════════════════
   Conexão Cosmópolis — auth.css
   Estilos para as páginas de Login (/entrar/) e Cadastro (/cadastrar/)
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper full-page ─────────────────────────────────────── */
.nos-auth-wrap {
  grid-area: content;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--nos-navbar-h));
  padding: 2rem 1rem;
}

/* ── Card ───────────────────────────────────────────────────── */
.nos-auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--nos-white);
  border: 1.5px solid var(--nos-border);
  border-radius: var(--nos-radius-xl);
  box-shadow: var(--nos-shadow-lg);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Header do card ─────────────────────────────────────────── */
.nos-auth-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-align: center;
}

.nos-auth-card__logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: var(--nos-text);
  text-decoration: none;
  margin-bottom: .25rem;
}

.nos-auth-card__logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, var(--nos-accent), var(--nos-secondary));
  border-radius: var(--nos-radius-sm);
  color: #fff;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .02em;
  flex-shrink: 0;
}

.nos-auth-card__logo-text {
  color: var(--nos-text);
}

.nos-auth-card__title {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--nos-text);
  margin: 0;
}

.nos-auth-card__subtitle {
  font-size: .9rem;
  color: var(--nos-text-muted);
  margin: 0;
}

/* ── Alertas ────────────────────────────────────────────────── */
.nos-auth-alert {
  padding: .75rem 1rem;
  border-radius: var(--nos-radius);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.5;
}

.nos-auth-alert[hidden] { display: none; }

.nos-auth-alert--error {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
}

.nos-auth-alert--success {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
}

/* ── Formulário ─────────────────────────────────────────────── */
.nos-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.nos-form-field {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.nos-form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.nos-form-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--nos-text);
}

.nos-form-hint {
  font-size: .78rem;
  color: var(--nos-text-faint);
  margin-top: .125rem;
}

.nos-form-link {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--nos-accent);
  text-decoration: none;
  transition: color var(--nos-transition);
}

.nos-form-link:hover {
  color: var(--nos-accent-hover);
  text-decoration: underline;
}

/* ── Inputs ─────────────────────────────────────────────────── */
.nos-form-input-wrap {
  position: relative;
}

.nos-form-input {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid var(--nos-border);
  border-radius: var(--nos-radius);
  background: var(--nos-surface-2);
  font-size: .9375rem;
  color: var(--nos-text);
  font-family: inherit;
  transition: border-color var(--nos-transition), box-shadow var(--nos-transition), background var(--nos-transition);
  appearance: none;
  -webkit-appearance: none;
}

.nos-form-input-wrap .nos-form-input {
  padding-right: 2.75rem;
}

.nos-form-input::placeholder {
  color: var(--nos-text-faint);
}

.nos-form-input:focus {
  outline: none;
  border-color: var(--nos-border-focus);
  box-shadow: 0 0 0 3px var(--nos-accent-light);
  background: var(--nos-white);
}

.nos-form-input.is-invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 3px #fee2e2;
}

/* Botão de mostrar/ocultar senha */
.nos-form-eye {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: .25rem;
  cursor: pointer;
  color: var(--nos-text-faint);
  transition: color var(--nos-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nos-radius-sm);
}

.nos-form-eye:hover { color: var(--nos-text-muted); }

/* ── Checkbox ───────────────────────────────────────────────── */
.nos-form-check {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  cursor: pointer;
}

.nos-form-check__input {
  width: 1rem;
  height: 1rem;
  margin-top: .125rem;
  accent-color: var(--nos-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.nos-form-check__label {
  font-size: .875rem;
  color: var(--nos-text-muted);
  line-height: 1.5;
}

/* ── Botão de envio ─────────────────────────────────────────── */
.nos-btn--full {
  width: 100%;
  justify-content: center;
  padding: .75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  gap: .5rem;
}

.nos-btn__spinner {
  display: inline-flex;
  align-items: center;
}

.nos-btn__spinner[hidden] { display: none; }

/* ── Animação de loading ────────────────────────────────────── */
@keyframes nos-spin {
  to { transform: rotate(360deg); }
}

.nos-spin {
  animation: nos-spin .7s linear infinite;
}

/* ── Footer do card ─────────────────────────────────────────── */
.nos-auth-card__footer {
  text-align: center;
  font-size: .875rem;
  color: var(--nos-text-muted);
  margin: 0;
}

/* ── Estado de loading no form ──────────────────────────────── */
.nos-auth-form--loading .nos-form-input,
.nos-auth-form--loading .nos-btn {
  pointer-events: none;
  opacity: .7;
}

/* ── Responsivo: telas pequenas ─────────────────────────────── */
@media (max-width: 480px) {
  .nos-auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--nos-radius-lg);
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .nos-auth-wrap {
    align-items: flex-start;
    padding-top: 1.5rem;
  }
}

/* ── Layout: nas páginas de auth, oculta sidebars ───────────── */
.nos-body--auth .nos-sidebar-left,
.nos-body--auth .nos-sidebar-right,
.nos-body--auth .nos-footer--fallback,
.nos-body--auth .nos-mobile-nav {
  display: none;
}

.nos-body--auth .nos-layout {
  grid-template-columns: 1fr;
  grid-template-areas:
    "navbar"
    "content";
}

.nos-body--auth .nos-content {
  max-width: 100%;
  padding: 0;
}
