/* =========================================================================
   Agente de Projetos Culturais — Folha de estilo
   Identidade visual 11H2: Poppins, hairlines de 1px, accent teal,
   estética executiva de alto contraste. Cantos retos, sem border-radius.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500&display=swap');

/* ---- Tokens (extraídos da landing page 11H2) ---- */
:root {
  --bg:       #ffffff;
  --ink:      #0a0a0a;
  --muted:    #666666;
  --line:     #d9d9d9;
  --dark:     #0a0a0a;
  --dark-2:   #1a1a1a;
  --accent:   #2CA89A;

  --line-dk:  rgba(255, 255, 255, .18);  /* hairline sobre fundo escuro */
  --muted-dk: rgba(255, 255, 255, .60);  /* texto secundário no escuro */

  --danger:   #c0392b;

  --ease:     cubic-bezier(.4, 0, .2, 1);
  --maxw:     440px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  font-size: 16px;
}
::selection { background: var(--accent); color: #fff; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, button, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ---- Primitivas de marca / tipografia ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.eyebrow::before { content: ''; width: 36px; height: 1px; background: var(--accent); }
.dark .eyebrow { color: var(--muted-dk); }

.wf-label {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
}

/* Wordmark textual (igual ao nav da LP) */
.brand-word {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.4;
}
.brand-word span { color: var(--accent); }
.dark .brand-word { color: #fff; }

/* Logotipo (imagem) */
.logo-img { display: block; width: auto; }

/* =========================================================================
   Roteamento de telas
   ========================================================================= */
#app { min-height: 100dvh; }

.screen:not(.is-active) { display: none !important; }
.screen.is-active { display: block; animation: screen-in .5s var(--ease) both; }
.loader-screen.is-active,
.centered.is-active { display: grid; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Botões (sistema da LP, com seta animada)
   ========================================================================= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 30px;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: background .3s var(--ease), color .3s var(--ease), opacity .25s var(--ease);
}
.btn .arrow {
  width: 22px; height: 1px;
  background: currentColor;
  position: relative;
  transition: width .3s var(--ease);
}
.btn .arrow::after {
  content: '';
  position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .arrow { width: 32px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: transparent; color: var(--accent); }

.btn-ghost { color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }

.btn-ghost-dark { color: #fff; border-color: #fff; }
.btn-ghost-dark:hover { background: #fff; color: var(--ink); }

.btn-block { width: 100%; }

/* Estado de carregamento */
.btn .btn-spinner {
  position: absolute;
  width: 16px; height: 16px;
  border: 1.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin .65s linear infinite;
}
.btn.is-loading { opacity: .75; cursor: progress; pointer-events: none; }
.btn.is-loading .label,
.btn.is-loading .arrow { opacity: 0; }
.btn.is-loading .btn-spinner { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Link discreto (uppercase, executivo) */
.link {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  transition: color .2s var(--ease);
}
.link:hover { color: var(--accent); }

/* =========================================================================
   Tela: carregando (gatekeeper)
   ========================================================================= */
.loader-screen {
  min-height: 100dvh;
  place-items: center;
  text-align: center;
  background: var(--bg);
}
.loader-screen .spinner { margin: 0 auto 22px; }
.loader-screen p {
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.spinner {
  width: 30px; height: 30px;
  border: 1.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* =========================================================================
   Telas centralizadas (login / pendente)
   ========================================================================= */
.centered {
  min-height: 100dvh;
  place-items: center;
  padding: 40px 24px;
  background: var(--bg);
}
.card { width: 100%; max-width: var(--maxw); }

/* Marca no topo do card */
.card-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 44px;
}
.card-brand .logo-img { height: 60px; margin-left: -6px; }

/* Cabeçalho */
.head { margin-bottom: 34px; }
.head h1 {
  font-size: clamp(30px, 4.4vw, 40px);
  font-weight: 200;
  letter-spacing: -.02em;
  line-height: 1.12;
  margin-bottom: 14px;
}
.head h1 em { color: var(--accent); font-style: normal; font-weight: 300; }
.head p { color: var(--muted); font-size: 15px; font-weight: 300; max-width: 38ch; }

/* =========================================================================
   Formulário
   ========================================================================= */
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 10px;
}
.field input {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: .01em;
  transition: border-color .25s var(--ease);
}
.field input::placeholder { color: #b0b0b0; font-weight: 300; }
.field input:focus { outline: none; border-bottom-color: var(--accent); }
.field input:disabled { color: var(--muted); cursor: not-allowed; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-actions { margin-top: 36px; }

.microcopy {
  margin-top: 20px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 300;
}

/* =========================================================================
   Alerta / feedback
   ========================================================================= */
.alert {
  display: none;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 26px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--danger);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 300;
}
.alert.is-visible { display: flex; animation: shake .4s var(--ease) both; }
.alert .ic {
  flex: none;
  width: 6px; height: 6px;
  margin-top: 6px;
  background: var(--danger);
  border-radius: 50%;
}
.alert.is-success { border-left-color: var(--accent); }
.alert.is-success .ic { background: var(--accent); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.card-foot {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

/* =========================================================================
   Tela: acesso pendente (fundo escuro, alto contraste)
   ========================================================================= */
.pending {
  background: var(--dark);
  color: #fff;
}
.pending .card { max-width: 540px; }
.pending .card-brand { margin-bottom: 48px; align-items: center; }
.pending .card-brand .logo-img { height: 56px; }
.pending .head { text-align: center; }
.pending h1 {
  font-size: clamp(32px, 4.6vw, 48px);
  font-weight: 200;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 22px;
}
.pending .status-eyebrow {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.pending .status-eyebrow .tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border: 1px solid var(--line-dk);
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--accent);
}
.pending .status-eyebrow .tag .pulse {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(44, 168, 154, .5); }
  50% { opacity: .5; box-shadow: 0 0 0 6px rgba(44, 168, 154, 0); }
}
.pending .message {
  margin: 0 auto 40px;
  max-width: 46ch;
  color: var(--muted-dk);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
  text-align: center;
  text-wrap: pretty;
}
.pending .actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 380px;
  margin: 0 auto;
}
.pending .signed-as {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line-dk);
  text-align: center;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-dk);
  font-weight: 400;
}
.pending .signed-as strong { color: #fff; font-weight: 400; text-transform: none; letter-spacing: .02em; }
.pending .signed-as .link { color: var(--accent); margin-left: 8px; }
.pending .signed-as .link:hover { color: #fff; }

/* =========================================================================
   Tela: Agente Cultural (chat) — sidebar escura + chat claro
   ========================================================================= */
.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

/* ---- Barra lateral (escura) ---- */
.sidebar {
  background: var(--dark);
  color: #fff;
  border-right: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  padding: 30px 26px;
}
.sidebar .side-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}
.sidebar .side-brand .logo-img { height: 30px; }
.sidebar .side-brand .divider { width: 1px; height: 26px; background: var(--line-dk); }
.sidebar .side-brand .label {
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted-dk);
  font-weight: 400;
  line-height: 1.5;
}

.side-section {
  font-size: 9px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .4);
  font-weight: 400;
  margin: 0 0 16px;
}
.side-nav { display: flex; flex-direction: column; }
.side-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 4px;
  border-top: 1px solid var(--line-dk);
  text-align: left;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .02em;
  color: var(--muted-dk);
  transition: color .2s var(--ease), padding-left .25s var(--ease);
}
.side-nav .nav-item:last-child { border-bottom: 1px solid var(--line-dk); }
.side-nav .nav-item svg { width: 16px; height: 16px; flex: none; opacity: .7; }
.side-nav .nav-item:hover { color: #fff; padding-left: 12px; }
.side-nav .nav-item.is-active { color: #fff; }
.side-nav .nav-item.is-active svg { color: var(--accent); opacity: 1; }
.side-nav .nav-item .marker {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--accent);
}

.sidebar .spacer { flex: 1; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line-dk);
  margin-bottom: 18px;
}
.user-chip .avatar {
  width: 38px; height: 38px;
  flex: none;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .06em;
}
.user-chip .who { overflow: hidden; }
.user-chip .who .email {
  font-size: 13px;
  font-weight: 300;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip .who .plan {
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
  margin-top: 3px;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 4px;
  border-top: 1px solid var(--line-dk);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-dk);
  font-weight: 400;
  transition: color .2s var(--ease), padding-left .25s var(--ease);
}
.btn-logout svg { width: 15px; height: 15px; }
.btn-logout:hover { color: var(--accent); padding-left: 12px; }

/* ---- Painel de chat (claro) ---- */
.chat {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
}
.chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 40px;
  border-bottom: 1px solid var(--line);
}
.chat-top .title { display: flex; align-items: center; gap: 16px; }
.chat-top .title .meta { display: flex; flex-direction: column; gap: 3px; }
.chat-top .title .meta .wf-num {
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
}
.chat-top .title h2 {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: .02em;
}
.chat-top .status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.chat-top .status .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
}
.menu-btn {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
}
.menu-btn svg { width: 18px; height: 18px; }

/* Histórico */
.chat-log { flex: 1; overflow-y: auto; padding: 40px; }
.chat-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Estado vazio */
.chat-empty { margin: auto 0; padding: 20px 0; max-width: 760px; }
.chat-empty .eyebrow { margin-bottom: 28px; }
.chat-empty h3 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 200;
  letter-spacing: -.02em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.chat-empty h3 em { color: var(--accent); font-style: normal; font-weight: 300; }
.chat-empty p {
  max-width: 52ch;
  color: var(--muted);
  font-weight: 300;
  font-size: 15px;
  margin-bottom: 40px;
  text-wrap: pretty;
}
.suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.suggestion {
  background: #fff;
  text-align: left;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background .25s var(--ease);
}
.suggestion .s-num {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--accent);
  font-weight: 400;
}
.suggestion strong { font-size: 15px; font-weight: 400; color: var(--ink); }
.suggestion span { font-size: 13px; color: var(--muted); font-weight: 300; line-height: 1.5; }
.suggestion:hover { background: #fafafa; }

/* Bolhas */
.msg { display: flex; gap: 16px; animation: msg-in .35s var(--ease) both; }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg .av {
  width: 34px; height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .04em;
}
.msg.assistant .av { background: var(--dark); color: #fff; }
.msg.assistant .av svg { width: 17px; height: 17px; color: var(--accent); }
.msg.user .av { border: 1px solid var(--line); color: var(--muted); }
.msg .bubble {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  max-width: 100%;
  text-wrap: pretty;
}
.msg.assistant .bubble { background: #fafafa; border: 1px solid var(--line); }
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: var(--dark); color: #fff; }

/* Indicador digitando */
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 2px 0; }
.typing span {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 1.3s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Composer */
.composer { border-top: 1px solid var(--line); padding: 24px 40px 30px; }
.composer-inner { max-width: 760px; margin: 0 auto; }
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  border: 1px solid var(--line);
  padding: 12px 12px 12px 18px;
  background: #fff;
  transition: border-color .25s var(--ease);
}
.composer-box:focus-within { border-color: var(--ink); }
.composer textarea {
  flex: 1;
  border: none;
  resize: none;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.55;
  max-height: 160px;
  padding: 8px 0;
}
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: #b0b0b0; }
.send-btn {
  width: 44px; height: 44px;
  flex: none;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background .25s var(--ease), opacity .2s var(--ease);
}
.send-btn svg { width: 18px; height: 18px; }
.send-btn:hover { background: var(--ink); }
.send-btn:disabled { background: var(--line); color: #fff; cursor: not-allowed; }
.composer .hint {
  text-align: center;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
}

/* Backdrop mobile */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, .5);
  z-index: 40;
}

/* =========================================================================
   Responsivo
   ========================================================================= */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 300px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .35s var(--ease);
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open .backdrop { display: block; }
  .chat-top, .chat-log, .composer { padding-left: 22px; padding-right: 22px; }
  .suggestions { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .centered { padding: 28px 20px; }
  .card-brand .logo-img { height: 52px; }
}
