/* ======================================================================
   IVR OS — Telas de acesso (Entrar, Ativar convite, Erro ao carregar)
   Layout "branded" em duas colunas: formulário à esquerda, painel da
   marca à direita com a logo sobre a arte de metal. Usa só os tokens do padrão v1.
   ====================================================================== */
body.ivr-sign-body { height: auto; min-height: 100dvh; overflow: auto; background: var(--ivr-surface-page); }

.ivr-sign {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--ivr-surface-page);
  color: var(--ivr-text-primary);
  font-family: var(--ivr-font-sans);
}

/* Coluna do formulário */
.ivr-sign-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-width: 0;
}
.ivr-sign-card {
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px;
  border: 1px solid var(--ivr-border-base);
  border-radius: var(--ivr-radius-card);
  background: var(--ivr-surface-1);
}
.ivr-sign-head { text-align: center; }
.ivr-sign-head h1 {
  margin: 0 0 10px;
  color: var(--ivr-text-primary);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}
.ivr-sign-head p {
  margin: 0;
  color: var(--ivr-text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.ivr-sign-head p strong { color: var(--ivr-text-primary); font-weight: 600; }

.ivr-sign-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ivr-border-base);
  border-radius: var(--ivr-radius-card);
  background: var(--ivr-surface-2);
  color: var(--ivr-text-secondary);
}
.ivr-sign-icon svg { width: 20px; height: 20px; }
.ivr-sign-icon.is-warn { border-color: rgba(247, 188, 52, .28); background: var(--ivr-brand-tint); color: var(--ivr-brand); }

.ivr-sign .ivr-auth-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.ivr-sign .ivr-auth-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ivr-sign .ivr-auth-field > label,
.ivr-sign .ivr-sign-label {
  color: var(--ivr-text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.ivr-sign .ivr-auth-input {
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ivr-border-base);
  border-radius: var(--ivr-radius-control);
  background: var(--ivr-surface-page);
  color: var(--ivr-text-primary);
  font-size: 13px;
}
.ivr-sign .ivr-auth-input::placeholder { color: var(--ivr-text-faint); }
.ivr-sign .ivr-auth-input:hover { border-color: var(--ivr-border-hover); }
.ivr-sign .ivr-auth-input:focus { border-color: var(--ivr-border-strong); box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.ivr-sign .ivr-auth-input.is-static { display: flex; align-items: center; background: var(--ivr-surface-2); color: var(--ivr-text-secondary); overflow-wrap: anywhere; }

/* Campo de senha com botão de mostrar/ocultar */
.ivr-sign-pass { position: relative; }
.ivr-sign-pass .ivr-auth-input { padding-right: 40px; }
.ivr-sign-eye {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--ivr-radius-control);
  background: transparent;
  color: var(--ivr-text-faint);
  cursor: pointer;
}
.ivr-sign-eye:hover { color: var(--ivr-text-primary); background: var(--ivr-surface-3); }
.ivr-sign-eye svg { width: 16px; height: 16px; }
.ivr-sign-eye .is-hide { display: none; }
.ivr-sign-eye[aria-pressed="true"] .is-show { display: none; }
.ivr-sign-eye[aria-pressed="true"] .is-hide { display: block; }

/* Botões */
.ivr-sign-btn {
  width: 100%;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #E4E4E7;
  border-radius: var(--ivr-radius-control);
  background: #E4E4E7;
  color: var(--ivr-surface-page);
  font: 600 13px/1 var(--ivr-font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.ivr-sign-btn em { font-style: normal; }
.ivr-sign-btn:hover:not(:disabled) { border-color: var(--ivr-text-secondary); background: var(--ivr-text-secondary); }
.ivr-sign-btn:disabled { cursor: wait; opacity: .7; }
.ivr-sign-btn.is-secondary { border-color: var(--ivr-border-base); background: var(--ivr-surface-page); color: var(--ivr-text-secondary); }
.ivr-sign-btn.is-secondary:hover { border-color: var(--ivr-border-hover); background: var(--ivr-surface-2); color: var(--ivr-text-primary); }
.ivr-sign-btn:focus-visible, .ivr-sign-eye:focus-visible { outline: 2px solid var(--ivr-border-strong); outline-offset: 2px; }
.ivr-sign-actions { display: flex; flex-direction: column; gap: 10px; }

/* Avisos */
.ivr-sign .ivr-auth-error,
.ivr-sign .ivr-auth-success { margin: 0; border-radius: var(--ivr-radius-control); font-size: 13px; line-height: 1.45; }

/* Foto do convite */
.ivr-sign .ivr-invite-photo { border-radius: var(--ivr-radius-control); background: var(--ivr-surface-page); }

.ivr-sign-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ivr-text-faint);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ivr-sign-foot::before, .ivr-sign-foot::after { content: ""; flex: 1; height: 1px; background: var(--ivr-border-base); }

/* Painel da marca */
.ivr-sign-hero {
  position: relative;
  margin: 20px 20px 20px 0;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--ivr-border-base);
  border-radius: var(--ivr-radius-card);
  background: var(--ivr-surface-page);
}
.ivr-sign-art {
  position: absolute;
  top: -12%;
  left: 0;
  z-index: -1;
  width: 100%;
  max-width: none;
  height: 112%;
  object-fit: cover;
  object-position: center;
  opacity: .2;
  pointer-events: none;
  user-select: none;
}
.ivr-sign-hero-copy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 32px; }
/* halo escuro atrás da logo para ela ler bem sobre a onda */
.ivr-sign-hero-copy::before { content: ""; position: absolute; left: 50%; top: 50%; width: 520px; height: 260px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(9, 9, 11, .7), rgba(9, 9, 11, 0)); pointer-events: none; }
.ivr-sign-hero-copy .ivr-sign-logo { position: relative; }
.ivr-sign-logo { display: block; width: 190px; }
.ivr-sign-hero-copy .ivr-sign-logo { width: 230px; }
.ivr-sign-logo svg { display: block; width: 100%; max-width: none; height: auto; max-height: none; }
.ivr-sign-logo svg path:first-child,
.ivr-sign-logo svg path:nth-child(2) { fill: var(--ivr-text-primary) !important; }

/* Celular e telas estreitas: marca em cima, formulário embaixo, sem a prévia */
@media (max-width: 1023px) {
  .ivr-sign { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .ivr-sign-hero { order: 1; margin: 0; border: 0; border-bottom: 1px solid var(--ivr-border-base); border-radius: 0; }
  .ivr-sign-main { order: 2; padding: 32px 16px 40px; align-items: flex-start; }
  .ivr-sign-hero-copy { position: relative; inset: auto; padding: 28px 24px; }
  .ivr-sign-hero-copy::before { display: none; }
  .ivr-sign-logo { width: 150px; }
  .ivr-sign-art { display: none; }
}
@media (max-width: 480px) {
  .ivr-sign-card { padding: 28px 20px; }
}

/* Dentro do app (tela "Não foi possível carregar"): a própria tela rola. */
#appRoot > .ivr-sign { height: 100dvh; overflow: auto; }

/* Entrar com Google */
.ivr-sign-google svg { width: 16px; height: 16px; flex: 0 0 auto; }
.ivr-sign-btn.ivr-sign-google { color: var(--ivr-text-primary); }
.ivr-sign-or { display: flex; align-items: center; gap: 10px; margin: -4px 0; color: var(--ivr-text-faint); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.ivr-sign-or::before, .ivr-sign-or::after { content: ""; flex: 1; height: 1px; background: var(--ivr-border-base); }
/* Conector do Claude: tela "Permitir" (mcp-authorize.php) */
.ivr-allow-who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--ivr-border-base); border-radius: var(--ivr-radius-control); background: var(--ivr-surface-2); }
.ivr-allow-who img { width: 36px; height: 36px; border-radius: 8px; flex: 0 0 auto; }
.ivr-allow-who strong { display: block; font-size: 14px; font-weight: 600; color: var(--ivr-text-primary); }
.ivr-allow-who small { display: block; font-size: 12px; color: var(--ivr-text-muted); overflow-wrap: anywhere; }
.ivr-allow-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--ivr-text-secondary); }
.ivr-allow-list li { display: flex; gap: 10px; align-items: flex-start; }
.ivr-allow-list svg { flex: 0 0 auto; margin-top: 2px; }
.ivr-allow-list .is-ok svg { color: var(--ivr-success, #4ade80); }
.ivr-allow-list .is-no svg { color: var(--ivr-text-muted); }
.ivr-allow-list b { color: var(--ivr-text-primary); font-weight: 600; }
