/* AirData design tokens (ITA palette) + light reset + base layout. */

:root {
  --primary: #003c7d; /* ITA blue */
  --primary-600: #002f63;
  --primary-300: #4d7bb0;
  --on-primary: #ffffff; /* texto sobre --primary; acompanha o tema, senão o contraste cai */
  --accent: #f5a623;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --text: #1c2733;
  --text-muted: #63707f;
  --border: #e4e9f0;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 32, 56, 0.04), 0 6px 18px rgba(16, 32, 56, 0.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --header-h: 56px;

  /* Escala de títulos compartilhada: home, Sobre e estado vazio do chat não devem divergir. */
  --fs-title: clamp(1.2rem, 2.8vw, 1.4rem);
  --fs-section: clamp(1.08rem, 2.2vw, 1.2rem);
}

[data-theme="dark"] {
  --primary: #58a6ff;
  --primary-600: #3b8ae6;
  --primary-300: #2b4d75;
  --on-primary: #0b1620;
  --accent: #f5a623;

  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c232d;
  --text: #e6edf3;
  --text-muted: #9aa7b4;
  --border: #262e38;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

/* Quem pede menos movimento recebe o resultado, não a animação. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Navegação por teclado precisa de um anel visível — o default do browser desaparece
   sobre os tons claros da paleta. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Só para leitor de tela. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html,
body {
  margin: 0;
}

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
}

.app-header {
  height: var(--header-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.app-header__logo {
  height: 34px;
  width: auto;
}

/* No tema escuro a marca é vetor escuro: precisa da plaqueta clara para não desaparecer. */
[data-theme="dark"] .app-header__logo {
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
}

.app-header__subtitle {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.app-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  margin-right: 14px;
}

/* Marca, navegação e tema não cabem lado a lado num celular estreito, e o cabeçalho não
   encolhe: sem isto a página inteira ganha rolagem horizontal. */
@media (max-width: 480px) {
  .app-header__subtitle {
    display: none;
  }
}

.app-nav__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.app-nav__link:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Sublinhado (e não pílula) marca a seção atual: pesa menos no cabeçalho claro. */
.app-nav__link.is-active {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.app-main {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
}

.app-footer {
  flex: 0 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.app-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px clamp(12px, 4vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.app-footer__links a {
  color: var(--primary);
  text-decoration: none;
}

.app-footer__links a:hover {
  text-decoration: underline;
}

.app-footer__copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Content page (e.g. About): flows in the document scroll; footer follows. Mesmo contêiner
   da home, para a margem esquerda não pular ao navegar entre as duas. */
.page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

.page__inner {
  padding: clamp(36px, 7vw, 60px) 0 clamp(40px, 7vw, 64px);
}

/* Rótulo de seção: texto pequeno em caixa alta, sem moldura. */
.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 9px 16px;
  transition:
    background 0.15s ease,
    opacity 0.15s ease,
    transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

/* Link com aparência de botão: sem sublinhado e alinhado como o <button>. */
a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn--primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn--primary:hover {
  background: var(--primary-600);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Enquanto o agente redige, "Enviar" vira "Parar": recua para uma ação secundária. */
.btn--stop,
.btn--stop:hover {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.btn--stop:hover {
  background: var(--surface);
}

.btn--ghost {
  background: none;
  color: var(--text-muted);
  padding: 7px 10px;
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn--outline {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn--outline:hover {
  background: var(--surface-2);
  border-color: var(--primary-300);
}

/* Example question: same component on the home page (a link) and in the chat's empty state
   (a button). Both only hand the text over to the composer. */
.suggestion {
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.suggestion:hover {
  border-color: var(--primary-300);
  color: var(--primary);
}
