/* ==========================================================
   _auth.css — Login, cadastro e autenticação (page-auth)
   ========================================================== */

/* --- Layout page-auth: tela dividida ---------------------- */
body.page-auth {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100dvh;
}

/* --- Painel da marca (esquerdo) --------------------------- */
.brand-panel {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 36px 32px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(ellipse at 20% 85%, rgba(6,182,212,.40) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 10%, rgba(99,102,241,.45) 0%, transparent 50%),
    linear-gradient(155deg, var(--brand-darker) 0%, var(--brand-dark) 45%, var(--brand) 100%);
}

/* Grade de pontos decorativos */
.brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Logo */
.brand-header { 
  position: relative; 
  z-index: 1; 
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.brand-logo:hover { text-decoration: none; }

.brand-logo img {
  width: 64px;
  height: 64px;
}
.brand-logomark {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -.02em;
}

.brand-wordmark {
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.brand-wordmark small {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  opacity: .7;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Corpo: tagline + decoração */
.brand-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.brand-tagline { margin-top: 40px; }

.brand-tagline h2 {
  color: #fff;
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  line-height: 1.25;
  margin-bottom: 14px;
}

.brand-tagline p {
  opacity: .75;
  font-size: .875rem;
  line-height: 1.65;
  max-width: 280px;
}

/* Anéis decorativos */
.brand-deco {
  position: relative;
  margin-top: 44px;
  height: 160px;
  flex-shrink: 0;
}

.brand-deco-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
}
.brand-deco-ring:nth-child(1) {
  width: 68px; height: 68px;
  top: 46px; left: 28px;
  background: rgba(255,255,255,.07);
}
.brand-deco-ring:nth-child(2) {
  width: 120px; height: 120px;
  top: 26px; left: 76px;
}
.brand-deco-ring:nth-child(3) {
  width: 176px; height: 176px;
  top: -4px; left: 48px;
}

/* Rodapé */
.brand-footer {
  position: relative;
  z-index: 1;
  font-size: .75rem;
  display: flex;
  flex-flow: column nowrap;
  gap: 1em;
}
.brand-footer small {
  opacity: .55;
}
.brand-footer a { color: #fff; }

/* Barra de usuário (dentro do aside) */
.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-md);
}
.user-bar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 1.5px solid rgba(255,255,255,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-bar__name {
  font-size: .8125rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-bar__logout {
  font-size: .75rem;
  color: rgba(255,255,255,.6);
  flex-shrink: 0;
}
.user-bar__logout:hover { color: #fff; text-decoration: underline; }

/* --- Painel do formulário (direito) ----------------------- */
.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  overflow-y: auto;
}

/* Card do formulário */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 488px;
}

.form-card__header { margin-bottom: 6px; }

/* Aviso / "fala" da Cicleide */
.cicleide-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 20px 0 28px;
}

.cicleide-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(37,99,235,.2);
  flex-shrink: 0;
  object-fit: cover;
  align-self: flex-start;
}

.cicleide-notice p {
  margin: 0;
  font-size: .825rem;
  line-height: 1.55;
  color: var(--brand-darker);
}

.cicleide-notice strong {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--brand-dark);
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* --- Abas de autenticação -------------------------------- */
.auth-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 4px;
  margin: 20px 0 28px;
}

.auth-tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-md) - 2px);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.auth-tab:hover { color: var(--text); }
.auth-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* Painel de conteúdo de cada aba */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* Divider "ou" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-light);
  font-size: .8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Rodapé de ações secundárias */
.auth-footer-link {
  margin-top: 18px;
  text-align: center;
  font-size: .8125rem;
  color: var(--text-muted);
}
.auth-footer-link a {
  font-weight: 600;
}

/* Link-botão (para "Esqueci minha senha") */
.btn-text {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .8125rem;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-text:hover { text-decoration: underline; }

/* Feedback de magic link enviado */
.magic-sent-card {
  text-align: center;
  padding: 20px 0;
}
.magic-sent-card .magic-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.magic-sent-card h3 { margin-bottom: 8px; }
.magic-sent-card p  { color: var(--text-muted); font-size: .875rem; }

/* Verificação de magic link */
.verify-card {
  text-align: center;
  padding: 24px 0 12px;
}
.verify-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
.verify-card p { color: var(--text-muted); font-size: .875rem; }

/* Botões de login social */
.social-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-social {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border: 1.5px solid var(--line-dark);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.btn-social:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-sm);
}
.btn-social:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.btn-social svg { flex-shrink: 0; }

.btn-social .social-btn-label { flex: 1; text-align: center; }

/* --- Responsivo page-auth ---------------------------------- */
@media (max-width: 1024px) {
  body.page-auth {
    grid-template-columns: 300px 1fr;
  }
  .brand-panel { padding: 28px 24px; }
  .brand-deco  { display: none; }
  .form-card   { padding: 36px 32px; }
}

@media (max-width: 767px) {
  body.page-auth {
    display: flex;
    flex-direction: column;
  }

  .brand-panel {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
  }
  .brand-panel::before,
  .brand-body { display: none; }
  .brand-footer small { display: none; }

  .form-panel {
    flex: 1;
    align-items: flex-start;
    padding: 24px 16px 48px;
  }

  .form-card {
    padding: 24px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
  }

  .org-choices { flex-direction: column; }
  .org-choices li { flex: none; min-width: 0; }
}
