/* ============================================================
   STANDWAY — Painel admin: briefing
   Layout funcional, denso, focado em produtividade.
   ============================================================ */
:root {
  --bg: #050505;
  --bg-2: #0D0D0F;
  --text: #FFFFFF;
  --text-2: #9A9AA1;
  --text-3: #868690;
  --gold: #C6A86B;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --field-bg: rgba(255, 255, 255, 0.03);
  --field-bg-focus: rgba(198, 168, 107, 0.04);
  --danger: #d97777;
  --success: #6fb47a;
  --font: 'Sora', system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 6rem;
}
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

a { color: var(--gold); text-decoration: none; }
code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: rgba(198, 168, 107, 0.10);
  color: var(--gold);
  padding: 0.1em 0.4em;
  border-radius: 2px;
}

/* ============ Header ============ */
.bf-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bf-wrap {
  max-width: 920px;
  margin-inline: auto;
  padding: 1rem 1.5rem;
}
.bf-header .bf-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.bf-back {
  font-size: 0.85rem;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.bf-back:hover { color: var(--gold); }
.bf-brand {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
}
.bf-spacer { flex: 0 0 80px; }

/* ============ Conteúdo principal ============ */
main.bf-wrap { padding-block: 2.5rem; }
h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 0.5rem;
}
.bf-lead {
  color: var(--text-2);
  font-weight: 300;
  margin-bottom: 2rem;
  max-width: 60ch;
}

/* ============ Toolbar (sticky) ============ */
.bf-toolbar {
  position: sticky;
  top: 58px;
  z-index: 9;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.bf-status {
  font-size: 0.8rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.bf-status.is-saved { color: var(--success); }
.bf-status.is-dirty { color: var(--gold); }
.bf-status.is-error { color: var(--danger); }
.bf-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.bf-btn {
  padding: 0.55rem 1rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.bf-btn:hover { border-color: var(--gold); color: var(--gold); }
.bf-btn--ghost { color: var(--text-3); }
.bf-btn--primary {
  border-color: var(--gold);
  color: var(--gold);
}
.bf-btn--primary:hover { background: var(--gold); color: #000; }
.bf-btn:disabled { opacity: 0.5; cursor: wait; }

/* ============ Seções ============ */
.bf-section {
  border: 1px solid var(--line);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.015);
}
.bf-section legend {
  padding: 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.bf-subsection {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}
.bf-subsection h3 {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}
.bf-field-hint {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 1rem;
  line-height: 1.55;
}

/* ============ Form fields ============ */
.bf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.bf-field {
  display: block;
  margin-bottom: 1rem;
}
.bf-field--full { grid-column: 1 / -1; }
.bf-field > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}
.bf-field > span em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--gold);
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.bf-field input[type="text"],
.bf-field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--field-bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.5;
  border-radius: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
}
.bf-field textarea {
  resize: vertical;
  min-height: 60px;
  font-family: var(--font);
}
.bf-field textarea[data-json] {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}
.bf-field input:focus,
.bf-field textarea:focus {
  border-color: var(--gold);
  background: var(--field-bg-focus);
  outline: none;
}
.bf-field input:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}
.bf-field small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-3);
  line-height: 1.45;
}
.bf-field input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  vertical-align: middle;
  accent-color: var(--gold);
}

/* ============ Toast notifications ============ */
.bf-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: rgba(10, 10, 12, 0.95);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  letter-spacing: 0.02em;
}
.bf-toast.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.bf-toast.is-error { border-color: var(--danger); }
.bf-toast.is-success { border-color: var(--success); }

/* ============ Painel de fechamento (próximos passos) ============ */
.bf-finish {
  margin-top: 2.5rem;
  padding: 2rem;
  border: 1px solid var(--gold);
  background: rgba(198, 168, 107, 0.04);
}
.bf-finish h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.bf-finish__lead {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.bf-finish__lead strong { color: var(--text); }
.bf-steps {
  list-style: none;
  counter-reset: bf-steps;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bf-steps li {
  position: relative;
  padding-left: 2.5rem;
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.55;
  counter-increment: bf-steps;
}
.bf-steps li::before {
  content: counter(bf-steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.bf-steps strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 0.15rem;
}
.bf-steps__note {
  color: var(--text-3);
  font-style: normal;
  font-size: 0.82rem;
  display: inline-block;
  margin-left: 0.4rem;
}
.bf-finish__actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.bf-btn--lg {
  padding: 0.9rem 1.75rem;
  font-size: 0.95rem;
}
@media (max-width: 640px) {
  .bf-finish { padding: 1.25rem; }
  .bf-finish__actions { justify-content: stretch; }
  .bf-finish__actions .bf-btn { flex: 1; }
}

/* ============ Color picker (input combinado) ============
   Layout: amostra clicável (color picker nativo) + texto hex editável.
   Os dois são sincronizados via JS — qualquer alteração reflete no outro. */
.bf-color {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.bf-color__picker {
  /* esconde a UI feia do <input type=color> e usa só o swatch */
  width: 44px;
  height: auto;
  min-height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--field-bg);
  cursor: pointer;
  border-radius: 0;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.bf-color__picker::-webkit-color-swatch-wrapper { padding: 4px; }
.bf-color__picker::-webkit-color-swatch {
  border: none;
  border-radius: 0;
}
.bf-color__picker::-moz-color-swatch {
  border: none;
  border-radius: 0;
}
.bf-color__picker:hover,
.bf-color__picker:focus { border-color: var(--gold); outline: none; }

.bf-color__hex {
  flex: 1;
  text-transform: uppercase;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

/* ============ Responsivo ============ */
@media (max-width: 640px) {
  .bf-grid { grid-template-columns: 1fr; }
  .bf-section { padding: 1rem; }
  .bf-toolbar { padding: 0.75rem; }
  .bf-toolbar { top: 56px; }
  .bf-actions { width: 100%; }
  .bf-btn { flex: 1; min-width: 0; padding: 0.55rem 0.5rem; font-size: 0.75rem; }
}
