/* ==========================================================================
   miAvisa — sistema visual
   Um arquivo só, usado pela landing, pelo login e pelo console.
   Tudo em tokens: trocar a identidade é mexer no :root.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Superfícies, do fundo para a frente */
  --bg:        #0b0d11;
  --surface:   #14171d;
  --surface-2: #1b1f27;
  --border:    #262b35;
  --border-strong: #333a47;

  /* Texto */
  --text:      #e9ecf1;
  --text-dim:  #9aa3b2;
  --text-faint:#6b7382;

  /* Acento: âmbar. Um produto de AVISO pede cor de aviso — e nos separa
     visualmente dos azuis que dominam a categoria. */
  --accent:      #f5a524;
  --accent-hover:#ffb840;
  --accent-ink:  #1a1200;   /* texto sobre o acento */
  --accent-soft: rgba(245, 165, 36, .12);

  /* Estados */
  --ok:   #34d399;  --ok-bg:   rgba(52, 211, 153, .12);
  --warn: #fbbf24;  --warn-bg: rgba(251, 191, 36, .12);
  --err:  #f87171;  --err-bg:  rgba(248, 113, 113, .12);
  --info: #60a5fa;  --info-bg: rgba(96, 165, 250, .12);

  /* Métodos HTTP, usados na referência e no playground */
  --get: #34d399; --post: #60a5fa; --patch: #fbbf24; --delete: #f87171;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 10px 40px rgba(0, 0, 0, .35);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
/* Precisa de !important: regras de layout como display:grid teriam
   especificidade maior que o [hidden] do navegador e a seção não sumiria. */
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.02em; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); }

/* --------------------------------------------------------------- marca --- */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(140deg, var(--accent), #ff7847);
  display: grid; place-items: center;
  color: var(--accent-ink); font-size: 14px; font-weight: 800;
}
.brand-mark.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }

/* ------------------------------------------------------------- botões --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------------------------------------------------------- formulário --- */
label, .label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px;
}
input, select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 84px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- avisos -- */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
  border: 1px solid transparent; margin-top: 12px;
}
.alert-ok   { background: var(--ok-bg);   color: var(--ok);   border-color: rgba(52,211,153,.25); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(251,191,36,.25); }
.alert-err  { background: var(--err-bg);  color: var(--err);  border-color: rgba(248,113,113,.25); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: rgba(96,165,250,.25); }
.alert b { font-weight: 700; }

/* --------------------------------------------------------------- código -- */
pre.code, .code {
  background: #090b0e; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.65; margin: 0; max-width: 100%; color: #cfd6e2;
}
.code .k { color: var(--accent); }      /* método / palavra-chave */
.code .s { color: #86e39c; }            /* string */
.code .c { color: var(--text-faint); }  /* comentário */
.code .p { color: #7fb4ff; }            /* propriedade */

/* -------------------------------------------------------------- badges --- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(245,165,36,.3); }
.method {
  display: inline-block; min-width: 62px; text-align: center; padding: 3px 8px;
  border-radius: 6px; font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .06em;
}
.method.get    { background: rgba(52,211,153,.14);  color: var(--get); }
.method.post   { background: rgba(96,165,250,.14);  color: var(--post); }
.method.patch  { background: rgba(251,191,36,.14);  color: var(--patch); }
.method.delete { background: rgba(248,113,113,.14); color: var(--delete); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.on  { background: var(--ok);   box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.off { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot.bad { background: var(--err);  box-shadow: 0 0 0 3px var(--err-bg); }

/* --------------------------------------------------------------- cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }

.list { display: grid; gap: 9px; min-width: 0; }
.row-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 15px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0;
}
.row-main { min-width: 0; }
.row-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.row-meta { font-size: 12px; color: var(--text-faint); margin-top: 3px; word-break: break-all; }
.row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty { color: var(--text-faint); font-size: 14px; padding: 18px; text-align: center; }

.copy {
  border: 0; background: transparent; color: var(--text-faint); cursor: pointer;
  font-size: 11px; font-family: var(--mono); padding: 0 4px;
}
.copy:hover { color: var(--accent); }

/* ------------------------------------------------------------ utilitários */
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }
.tiny  { font-size: 12px; }
.center { text-align: center; }
.stack { display: grid; gap: 18px; }
.flex { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ==========================================================================
   Landing pública
   ========================================================================== */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: rgba(11, 13, 17, .82);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.site-nav .links { display: flex; gap: 26px; font-size: 14px; color: var(--text-dim); }
.site-nav .links a:hover { color: var(--text); }
@media (max-width: 860px) { .site-nav .links { display: none; } }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 12px; }
.section-head p { color: var(--text-dim); font-size: 16px; }

.hero { padding: 76px 0 56px; text-align: center; }
.hero h1 {
  font-size: clamp(34px, 6vw, 60px); letter-spacing: -.035em; margin: 20px auto 18px;
  max-width: 15ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead {
  color: var(--text-dim); font-size: 17px; max-width: 56ch; margin: 0 auto 30px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 14px; font-size: 12.5px; color: var(--text-faint); }

.snippet {
  max-width: 620px; margin: 46px auto 0; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.snippet-bar {
  display: flex; align-items: center; gap: 8px; padding: 11px 15px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
}
.snippet-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.snippet pre { border: 0; border-radius: 0; background: transparent; }

.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 18px; margin-bottom: 14px;
}
.feature h3 { font-size: 15px; margin-bottom: 7px; }
.feature p { color: var(--text-dim); font-size: 13.5px; }

.step-num {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; flex-shrink: 0;
}

.price-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column;
}
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.price-value { font-size: 38px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 4px; }
.price-value span { font-size: 14px; font-weight: 500; color: var(--text-faint); }
.price-list { list-style: none; padding: 0; margin: 20px 0 26px; display: grid; gap: 10px; }
.price-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-dim); }
.price-list li::before { content: "✓"; color: var(--accent); font-weight: 700; }
.price-card .btn { margin-top: auto; }

.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item h3 { font-size: 15px; margin-bottom: 8px; }
.faq-item p { color: var(--text-dim); font-size: 14px; }

.site-footer {
  border-top: 1px solid var(--border); padding: 34px 0; margin-top: 40px;
  color: var(--text-faint); font-size: 13px;
}

/* ==========================================================================
   Login / cadastro
   ========================================================================== */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(400px, 100%); }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-size: 23px; margin: 16px 0 6px; }
.auth-head p { color: var(--text-dim); font-size: 14px; }
.tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tabs button {
  flex: 1; padding: 9px; border: 0; background: transparent; color: var(--text-dim);
  border-radius: 7px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.tabs button.active { background: var(--accent); color: var(--accent-ink); }

/* ==========================================================================
   Console
   ========================================================================== */
.console { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 6px 10px 20px; font-size: 17px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text-dim); font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-link .ico { width: 17px; text-align: center; flex-shrink: 0; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.sidebar-user { font-size: 12.5px; color: var(--text-faint); padding: 0 12px 10px; word-break: break-all; }

.console-main { min-width: 0; padding: 30px 34px 70px; }
.page-head { margin-bottom: 26px; }
/* Páginas de leitura (tutorial, planos, configurações) usam coluna estreita.
   O margin-inline: auto é o que centraliza — sem ele a coluna encosta na
   esquerda enquanto o título ocupa a largura toda, e a página fica torta. */
.narrow { max-width: 780px; margin-inline: auto; }
.page-head .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.page-head h1 { font-size: 27px; margin-bottom: 8px; }
.page-head p { color: var(--text-dim); max-width: 66ch; }

.mobile-bar { display: none; }
@media (max-width: 900px) {
  .console { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40;
    transform: translateX(-100%); transition: transform .2s;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .console-main { padding: 16px 18px 60px; }
  .mobile-bar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--border); background: var(--surface);
    position: sticky; top: 0; z-index: 30;
  }
  .mobile-bar button {
    background: transparent; border: 1px solid var(--border-strong); color: var(--text);
    border-radius: 8px; padding: 6px 11px; cursor: pointer; font-size: 16px; line-height: 1;
  }
}

/* Endpoints: referência da API e playground compartilham este bloco */
.endpoint { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.endpoint + .endpoint { margin-top: 10px; }
.endpoint-head {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: transparent; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.endpoint-head:hover { background: var(--surface-2); }
.endpoint-path { font-family: var(--mono); font-size: 13.5px; font-weight: 600; }
.endpoint-desc { color: var(--text-dim); font-size: 13px; margin-left: auto; text-align: right; }
@media (max-width: 720px) { .endpoint-desc { display: none; } }
.endpoint-body { padding: 0 16px 16px; border-top: 1px solid var(--border); padding-top: 14px; }

.group-title {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint); margin: 30px 0 12px;
}
.group-title:first-child { margin-top: 0; }

.param-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.param-table th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--border);
}
.param-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.param-table td:first-child { font-family: var(--mono); color: var(--accent); white-space: nowrap; }
.param-table .req { color: var(--err); font-size: 11px; }

.out {
  background: #090b0e; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto;
  color: var(--text-dim); margin-top: 10px;
}
.out.ok  { border-color: rgba(52,211,153,.3); }
.out.err { border-color: rgba(248,113,113,.3); }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.stat .sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.key-box {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px;
  font-family: var(--mono); font-size: 13px; min-width: 0;
}
.key-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.danger-zone { border-color: rgba(248,113,113,.35); }
