/* Central de Demandas Redbeard — estilos do portal (consome tokens.css) */

@font-face {
  font-family: 'Sora';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/sora-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Figtree';
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/figtree.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-500.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
a { color: var(--brand-strong); }
.mono { font-family: var(--font-mono); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---- casca ---- */
.shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shell--wide { max-width: 860px; }

/* assinatura: vinco da barba */
.beard {
  background: linear-gradient(135deg, var(--brand-strong), var(--rb-red-deep));
  color: #fff;
  padding: 20px 20px 30px;
  border-radius: var(--r-card) var(--r-card) 0 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 50% 100%, 0 calc(100% - 14px));
}
.beard .brandline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.beard .brandline img { width: 28px; height: auto; filter: brightness(0) invert(1); }
.beard h1 { color: #fff; font-size: 1.25rem; margin-top: 10px; }
.beard .sub { color: rgba(255, 255, 255, .88); font-size: .875rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.card--flow { border-top-left-radius: 0; border-top-right-radius: 0; border-top: none; margin-top: -14px; padding-top: 14px; }
.card__body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* passos do login */
.steps { display: flex; gap: 6px; }
.steps span { height: 4px; flex: 1; border-radius: var(--r-pill); background: var(--border); }
.steps .on { background: var(--brand); }

/* ---- formulário ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9375rem; }
.field .hint { font-size: .8125rem; color: var(--muted); line-height: 1.5; }
.input, textarea.input, select.input {
  font: 400 1rem/1.5 var(--font-body);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-ctl);
  padding: 12px 14px;
  width: 100%;
}
.input:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.input--code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: .5em;
  text-align: center;
}
.input--sigla { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .3em; }
.field .error { color: var(--brand-strong); font-size: .8125rem; font-weight: 600; }

.btn {
  font: 600 1rem var(--font-body);
  border: none;
  border-radius: var(--r-ctl);
  padding: 13px 20px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.btn--primary { background: var(--brand-strong); color: #fff; }
.btn--primary:hover { background: var(--rb-red-deep); }
.btn--ghost { background: transparent; color: var(--brand-strong); border: 1.5px solid var(--border); }
.btn--block { width: 100%; }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.btn--link { background: none; border: none; color: var(--brand-strong); font-weight: 600; cursor: pointer; padding: 0; font-size: .875rem; }

.linkline { font-size: .875rem; color: var(--muted); text-align: center; }

.flash {
  border-left: 3px solid var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  padding: 10px 14px;
  font-size: .875rem;
  font-weight: 600;
}

/* ---- topo autenticado ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
}
.topbar .who { font-size: .8125rem; color: var(--muted); }
.topbar .who b { color: var(--text); }

/* toggle claro/escuro */
.theme-toggle {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.theme-toggle svg { width: 20px; height: 20px; }
:root:not([data-theme="dark"]) .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .icon-sun { display: inline; }
}

/* ---- badges de status (cor + losango + texto) ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); border-radius: 1.5px; }
.badge--nova { color: var(--info); background: var(--info-bg); }
.badge--em_analise, .badge--aguardando_resposta { color: var(--warn); background: var(--warn-bg); }
.badge--em_andamento { color: var(--prog); background: var(--prog-bg); }
.badge--entregue { color: var(--ok); background: var(--ok-bg); }
.badge--cancelada { color: var(--gray); background: var(--gray-bg); }

.protocolo {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .8125rem;
  color: var(--brand-strong);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.stars { color: var(--brand); letter-spacing: 2px; }

/* ---- lista de demandas ---- */
.dcard {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.dcard:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.dcard .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.dcard .title { font-weight: 600; line-height: 1.35; }
.dcard .meta { display: flex; justify-content: space-between; gap: 8px; font-size: .8125rem; color: var(--muted); flex-wrap: wrap; }
.due-late { color: var(--brand-strong); font-weight: 700; }

.empty {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}
.empty h2 { font-size: 1.05rem; color: var(--text); }

/* ---- linha do tempo ---- */
.tl { display: flex; flex-direction: column; }
.tl .ev { display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.tl .rail { display: flex; flex-direction: column; align-items: center; }
.tl .node { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; background: var(--brand); margin-top: 5px; flex-shrink: 0; }
.tl .node--duvida { background: var(--warn); }
.tl .node--resposta { background: var(--info); }
.tl .node--entrega { background: var(--ok); }
.tl .node--sistema { background: var(--gray); }
.tl .line { width: 2px; flex: 1; background: var(--border); margin: 4px 0 2px; }
.tl .body { padding-bottom: 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl .who { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.tl .msg { font-size: .9rem; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; overflow-wrap: break-word; }

/* seções expansíveis do formulário */
details.expander { border: 1.5px dashed var(--border); border-radius: var(--r-ctl); }
details.expander summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: .9375rem;
  color: var(--muted);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.expander summary::-webkit-details-marker { display: none; }
details.expander summary b { color: var(--text); }
details.expander summary::after { content: "+"; font-size: 1.2rem; }
details.expander[open] summary::after { content: "–"; }
details.expander .inner { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 14px; }

/* avaliação por estrelas */
.rate { display: flex; flex-direction: row-reverse; justify-content: center; gap: 6px; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { font-size: 2rem; color: var(--border); cursor: pointer; line-height: 1; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: var(--brand); }
.rate input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

footer.portal {
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  padding: 16px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (min-width: 720px) {
  .shell { padding-top: 40px; }
  .beard h1 { font-size: 1.5rem; }
}
