/* SGIN Barber — sistema visual
   Vernáculo: poste de barbeiro, letreiro esmaltado, latão.
   Cada barbearia sobrescreve --brand / --bg / --ink / --accent pelo servidor. */
:root {
  --bg: #0F1B2D;          /* azul esmalte */
  --ink: #F2F4F1;         /* porcelana */
  --brand: #C9A227;       /* latão */
  --accent: #D62828;      /* vermelho do poste */
  --pole-blue: #2F55D4;   /* azul do poste */
  --ok: #2FBF71;
  --warn: #F2A93B;
  --danger: #E5484D;

  --surface: color-mix(in srgb, var(--ink) 6%, var(--bg));
  --surface-2: color-mix(in srgb, var(--ink) 11%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 15%, transparent);
  --muted: color-mix(in srgb, var(--ink) 64%, var(--bg));
  --on-brand: #12110D;

  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --text: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-s: 6px;
  --r-m: 14px;
  --r-l: 22px;
  --wrap: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }

h1, h2, h3, .display { font-family: var(--display); font-weight: 800; line-height: .95; letter-spacing: -.005em; margin: 0; }
h1 { font-size: clamp(52px, 9vw, 112px); }
h2 { font-size: clamp(34px, 5vw, 56px); }
h3 { font-size: 26px; line-height: 1.05; }
p { margin: 0 0 1em; max-width: 68ch; }

/* ---------- Marca: poste de barbeiro ---------- */
.pole {
  --stripe: 26px;
  position: relative;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgb(0 0 0 / .45), rgb(255 255 255 / .18) 30%, rgb(255 255 255 / 0) 55%, rgb(0 0 0 / .5)),
    repeating-linear-gradient(-55deg,
      var(--accent) 0 var(--stripe),
      var(--ink) var(--stripe) calc(var(--stripe) * 2),
      var(--pole-blue) calc(var(--stripe) * 2) calc(var(--stripe) * 3),
      var(--ink) calc(var(--stripe) * 3) calc(var(--stripe) * 4));
  background-size: 100% 100%, calc(var(--stripe) * 4 / .8192) calc(var(--stripe) * 4 / .5736);
  animation: pole-spin 2.6s linear infinite;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .25);
}
.pole::before, .pole::after {
  content: ''; position: absolute; left: -10%; right: -10%; height: 22px;
  background: linear-gradient(90deg, #6d5713, var(--brand) 40%, #f3dc8b 55%, #8a6d16);
  border-radius: 10px;
}
.pole::before { top: -14px; }
.pole::after { bottom: -14px; }
@keyframes pole-spin { to { background-position: 0 0, 0 calc(var(--stripe) * 4 / .5736); } }
@media (prefers-reduced-motion: reduce) { .pole { animation: none; } }

.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .01em; }
.mark .pole { width: 12px; height: 30px; --stripe: 5px; animation-duration: 4s; }
.mark .pole::before, .mark .pole::after { height: 5px; left: -25%; right: -25%; border-radius: 3px; }
.mark .pole::before { top: -4px; } .mark .pole::after { bottom: -4px; }
.mark img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-brand { background: var(--brand); color: var(--on-brand); }
.btn-brand:hover { background: color-mix(in srgb, var(--brand) 86%, white); }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 14px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- Topo ---------- */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 12px; }
.topbar nav { display: flex; gap: 8px; align-items: center; }
@media (max-width: 560px) { .topbar .hide-sm { display: none; } }

/* ---------- Avisos ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600;
  z-index: 100; transition: .2s ease; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--danger); color: white; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); }
.badge.ok { background: color-mix(in srgb, var(--ok) 20%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--ink)); }
.badge.warn { background: color-mix(in srgb, var(--warn) 22%, transparent); color: color-mix(in srgb, var(--warn) 70%, var(--ink)); }
.badge.bad { background: color-mix(in srgb, var(--danger) 20%, transparent); color: color-mix(in srgb, var(--danger) 70%, var(--ink)); }
.stars { color: var(--brand); letter-spacing: 1px; }

.panel > h3, form.panel > h3 { margin-bottom: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-m); }

.footer { border-top: 1px solid var(--line); padding: 36px 0 48px; margin-top: 80px; color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.skeleton { background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-s); min-height: 20px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / .6); }
.modal-card { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
