/* Tela de acesso (login, cadastro, convite, senha, confirmação). Tokens em app.css. */
.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--page);
}

/* --- Vitrine (desktop) --------------------------------------------------------------------- */
.auth-showcase {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 44px clamp(32px, 5vw, 72px);
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--ink);
  color: #f6f4ef;
  overflow: hidden;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.auth-brand-light {
  color: #fff;
}
.auth-pitch {
  margin-top: auto;
  max-width: 460px;
}
.auth-pitch h2 {
  margin: 0;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.auth-pitch p {
  margin: 14px 0 0;
  color: #c9cbd1;
  font-size: 14px;
  line-height: 1.55;
}
.auth-chat {
  display: grid;
  gap: 8px;
  max-width: 400px;
  padding: 16px;
  border: 1px solid #ffffff1f;
  border-radius: 12px;
  background: #ffffff0d;
}
.auth-chat-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid #ffffff14;
}
.auth-chat-head strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.auth-chat-head small {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #b9bbc1;
  font-size: 11px;
}
.auth-chat-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
}
.auth-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8dddbf;
  animation: auth-pulse 2s ease-in-out infinite;
}
@keyframes auth-pulse {
  50% {
    opacity: 0.35;
  }
}
.auth-msg {
  max-width: 82%;
  margin: 0;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  opacity: 0;
  animation: auth-msg 0.4s ease-out forwards;
}
.auth-msg:nth-of-type(2) {
  animation-delay: 0.5s;
}
.auth-msg:nth-of-type(3) {
  animation-delay: 1s;
}
.auth-msg:nth-of-type(4) {
  animation-delay: 1.5s;
}
@keyframes auth-msg {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.auth-msg-in {
  justify-self: start;
  background: #ffffff1a;
  border-bottom-left-radius: 4px;
}
.auth-msg-out {
  justify-self: end;
  background: #fff;
  color: var(--ink);
  border-bottom-right-radius: 4px;
}
.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #c9cbd1;
  font-size: 12px;
}
.auth-points li::before {
  content: "✓";
  margin-right: 7px;
  color: #fff;
}

/* --- Formulário ---------------------------------------------------------------------------- */
.auth-main {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.auth-panel {
  width: min(380px, 100%);
}
.auth-panel > .auth-brand {
  display: none;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  margin-bottom: 28px;
  border-radius: 12px;
  background: var(--track);
}
.auth-tabs a {
  padding: 9px 0;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 400;
  text-align: center;
  text-decoration: none;
}
.auth-tabs a:hover {
  color: var(--ink);
}
.auth-tabs a[aria-current="page"] {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 2px #2820121f;
}
.auth-panel h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.auth-lead {
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 13px;
}
.auth-google {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px #00000008;
  transition: background 0.15s, border-color 0.15s;
}
.auth-google:hover {
  background: var(--sidebar);
  border-color: var(--dim);
}
.auth-google svg {
  width: 18px;
  height: 18px;
}
.auth-google[hidden],
.auth-divider[hidden] {
  display: none;
}
.auth-fine {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}
.auth-fine a,
.auth-check a,
.auth-foot a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--dim);
  text-underline-offset: 2px;
}
.auth-divider {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 22px 0 6px;
  color: var(--faint);
  font-size: 11px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
#login-form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
#login-form[hidden],
.auth-field[hidden],
.auth-check[hidden] {
  display: none;
}
.auth-field {
  display: grid;
  gap: 6px;
}
.auth-field label {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.auth-field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.auth-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #17181b1f;
  border-radius: 10px;
  background: var(--bg);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input::placeholder {
  color: var(--dim);
}
.auth-field input:hover {
  border-color: var(--dim);
}
.auth-field input:focus-visible {
  outline: none;
  border-color: #0b7a5b80;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.auth-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-link[hidden] {
  display: none;
}
.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
#org-address {
  display: block;
  margin-top: 3px;
}
#org-address[hidden] {
  display: none;
}
#org-address strong {
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}
.auth-password {
  position: relative;
}
.auth-password input {
  padding-right: 44px;
}
.auth-reveal {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.auth-reveal:hover {
  background: var(--soft);
  color: var(--ink);
}
.auth-reveal svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-reveal[aria-pressed="true"] svg {
  opacity: 0.55;
}
.auth-meter {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11.5px;
}
.auth-meter[hidden] {
  display: none;
}
.auth-meter-bar {
  flex: 0 0 72px;
  height: 4px;
  border-radius: 4px;
  background: var(--active);
  overflow: hidden;
}
.auth-meter-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 0.2s;
}
.auth-meter.ok {
  color: var(--ink);
}
.auth-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sidebar);
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}
.auth-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.auth-check:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.auth-check.invalid {
  border-color: #b42318;
  background: #fef3f2;
}
.auth-turnstile[hidden] {
  display: none;
}
.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3f2;
  color: #912018;
  font-size: 12.5px;
  line-height: 1.45;
}
.auth-error[hidden] {
  display: none;
}
.auth-submit {
  height: 44px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}
.auth-submit:hover {
  filter: brightness(1.08);
}
.auth-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}
.auth-secondary {
  width: 100%;
  height: 40px;
  margin-top: 12px;
  border: 1px solid var(--control-border);
  border-radius: 11px;
  background: var(--bg);
  font-size: 13px;
  cursor: pointer;
}
.auth-secondary:hover {
  background: var(--soft);
}
.auth-secondary[hidden],
.auth-foot[hidden] {
  display: none;
}
.auth-foot {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.auth-panel :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.auth-panel .auth-field input:focus-visible {
  outline: none;
}

/* Estado de resultado (e-mail enviado, confirmado): ícone acima do título. */
.auth-panel[data-state] h1::before {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 20px;
}
.auth-panel[data-state="mail"] h1::before {
  content: "✉";
}
.auth-panel[data-state="ok"] h1::before {
  content: "✓";
}
.auth-panel[data-state="wait"] h1::before {
  content: "…";
}
.auth-panel[data-state="error"] h1::before {
  content: "!";
}

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-showcase {
    display: none;
  }
  .auth-main {
    place-items: start center;
    padding: 28px 20px 40px;
  }
  .auth-panel > .auth-brand {
    display: block;
    margin-bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-msg {
    opacity: 1;
    animation: none;
  }
  .auth-pulse {
    animation: none;
  }
}
