:root {
  --brick: #7f2d1f;
  --brick-deep: #5c1f15;
  --brick-hi: #9a3a28;
  --ink: #1b1b1a;
  --ink-2: #252423;
  --ink-3: #302e2c;
  --paper: #f3f8f6;
  --kraft: #a99a69;
  --volt: #ebbe2f;
  --line: rgba(243, 248, 246, 0.12);
  --muted: rgba(243, 248, 246, 0.62);
  --ok: #7fc99a;
  --bad: #ff9a86;
  --f-display: 'Anton', 'Impact', sans-serif;
  --f-body: 'Montserrat', system-ui, sans-serif;
  --f-script: 'Pinyon Script', cursive;
  --side: 252px;
}
@media (prefers-color-scheme: light) {
  /* a identidade da FOLKS é escura; o tema não muda com o sistema */
}

* { box-sizing: border-box; margin: 0; }
html { color-scheme: dark; }
body {
  background: var(--ink);
  color: var(--paper);
  font: 400 15px/1.55 var(--f-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- tipografia ---------- */
.display, h1, h2, h3.display { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.98; }
h1 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.swash { font-family: var(--f-script); text-transform: none; font-size: 1.55em; line-height: 0; margin-right: 0.07em; position: relative; top: 0.06em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.star { display: inline-block; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--star) center/contain no-repeat; mask: var(--star) center/contain no-repeat; flex: none; }

/* ---------- etiqueta de papel rasgado (assinatura) ---------- */
.tag {
  display: inline-block; background: var(--paper); color: var(--brick);
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em; padding: 0.35em 1.1em 0.35em 1.2em;
  clip-path: polygon(0 12%, 2.5% 0, 5% 14%, 8% 2%, 100% 0, 100% 100%, 7% 100%, 4% 86%, 1.5% 100%, 0 88%);
  transform: rotate(-0.8deg);
}
.tag.volt { background: var(--volt); color: var(--ink); }
.tag.dark { background: var(--ink-3); color: var(--paper); }

/* ---------- layout do app ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink-2); border-right: 1px solid var(--line);
  padding: 22px 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.logo { font-family: var(--f-body); font-weight: 600; letter-spacing: 0.04em; font-size: 1.9rem; display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 8px 14px; }
.logo .star { font-size: 0.9rem; color: var(--paper); }
.nav-group { margin: 14px 0 4px 8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 1px 0;
  text-decoration: none; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); border-radius: 3px;
}
.nav a:hover { color: var(--paper); background: rgba(243, 248, 246, 0.05); }
.nav a.on { background: var(--paper); color: var(--brick); transform: rotate(-0.9deg); clip-path: polygon(0 10%, 3% 0, 100% 0, 100% 100%, 4% 100%, 0 90%); padding-left: 16px; }
.nav .badge { margin-left: auto; background: var(--volt); color: var(--ink); border-radius: 99px; font-size: 0.7rem; padding: 0 7px; min-width: 20px; text-align: center; }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); font-size: 0.82rem; }
.side-foot strong { display: block; }
.main { padding: 38px clamp(18px, 4vw, 52px) 80px; max-width: 1180px; width: 100%; }
.topbar { display: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; margin-bottom: 28px; }
.page-head p { max-width: 56ch; color: var(--muted); margin-top: 10px; }
section + section, .cards + section, .stats + section, .hero + section, .band + section { margin-top: 48px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ---------- botões e formulários ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  background: var(--paper); color: var(--brick); border: 0; padding: 11px 20px; border-radius: 3px;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); background: #fff; }
.btn.brick { background: var(--brick); color: var(--paper); }
.btn.brick:hover { background: var(--brick-hi); }
.btn.ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: rgba(243, 248, 246, 0.07); }
.btn.sm { padding: 7px 13px; font-size: 0.72rem; }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px rgba(255, 154, 134, 0.4); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 11px 13px;
}
.input:focus { border-color: var(--paper); outline: 0; }
textarea.input { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.grid-form .full { grid-column: 1 / -1; }
.err { color: var(--bad); font-size: 0.88rem; min-height: 1.3em; }
.check { display: flex; gap: 10px; align-items: center; }
.check input { width: 18px; height: 18px; accent-color: var(--brick-hi); }

/* ---------- cartões ---------- */
.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 4px; padding: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card.link { text-decoration: none; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.15s, transform 0.15s; }
.card.link:hover { border-color: rgba(243, 248, 246, 0.4); transform: translateY(-2px); }
.cover { aspect-ratio: 16 / 9; background: var(--brick) center/cover; border-radius: 3px; display: grid; place-items: center; color: rgba(243, 248, 246, 0.28); font-size: 3rem; overflow: hidden; margin: -4px -4px 4px; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 2px 11px; font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.chip.ok { color: var(--ok); border-color: rgba(127, 201, 154, 0.4); }
.chip.wait { color: var(--volt); border-color: rgba(235, 190, 47, 0.45); }
.chip.bad { color: var(--bad); border-color: rgba(255, 154, 134, 0.4); }
.commission { font-family: var(--f-display); font-size: 2rem; line-height: 1; color: var(--volt); }
.card-meta { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin-top: auto; }

/* ---------- hero e faixa de avisos ---------- */
.hero {
  background: var(--brick); position: relative; overflow: hidden; border-radius: 4px;
  padding: clamp(28px, 5vw, 56px); min-height: 280px; display: flex; flex-direction: column; justify-content: center;
}
.hero::after {
  content: ''; position: absolute; inset: 0; opacity: 0.07; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .8 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); max-width: 14ch; }
.hero p { max-width: 46ch; margin-top: 14px; font-size: 1.05rem; }
.hero .s1, .hero .s2 { position: absolute; z-index: 1; color: var(--paper); }
.hero .s1 { width: 110px; height: 110px; right: 6%; top: 10%; transform: rotate(12deg); }
.hero .s2 { width: 56px; height: 56px; right: 22%; bottom: 14%; transform: rotate(-14deg); }
.band {
  background: var(--paper); color: var(--brick); transform: rotate(-1.4deg); margin: 34px -12px 58px;
  padding: 16px 28px; display: flex; flex-wrap: wrap; gap: 8px 36px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.band .item { display: flex; gap: 10px; align-items: baseline; max-width: 420px; }
.band .item strong { font-weight: 700; }
.band .item span { font-weight: 400; font-size: 0.9rem; opacity: 0.85; }
.band .star { font-size: 0.8rem; align-self: center; }

/* ---------- aulas ---------- */
.progress { height: 6px; background: var(--ink-3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--volt); }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.lesson-row:hover .lt { text-decoration: underline; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted); display: grid; place-items: center; flex: none; font-size: 0.7rem; }
.dot.done { background: var(--volt); border-color: var(--volt); color: var(--ink); font-weight: 800; }
.player-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.player { aspect-ratio: 16 / 9; background: #000; border-radius: 4px; overflow: hidden; display: grid; place-items: center; }
.player iframe, .player video { width: 100%; height: 100%; border: 0; }
.empty { border: 1.5px dashed var(--line); border-radius: 4px; padding: 34px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--paper); margin-bottom: 4px; }

/* ---------- abas, tabelas, tickets ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs button { background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 6px 15px; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--paper); color: var(--brick); border-color: var(--paper); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.thread { display: grid; gap: 12px; margin-bottom: 20px; }
.msg { max-width: 640px; padding: 14px 16px; border-radius: 4px; background: var(--ink-2); border: 1px solid var(--line); }
.msg.staff { background: var(--brick); border-color: transparent; justify-self: end; }
.msg .who { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; margin-bottom: 4px; }
.msg p { white-space: pre-wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stat b { display: block; font-family: var(--f-display); font-size: 3rem; font-weight: 400; line-height: 1; }

/* ---------- modal e toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); z-index: 200; display: grid; place-items: center; padding: 18px; overflow-y: auto; }
.modal { background: var(--ink-2); border: 1px solid var(--line); border-radius: 4px; width: min(640px, 100%); padding: 26px; }
.modal h2 { margin-bottom: 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 11px 20px; border-radius: 3px; font-weight: 600; z-index: 300; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

/* ---------- login / troca de senha ---------- */
.gate { min-height: 100vh; background: var(--brick); position: relative; overflow: hidden; display: grid; place-items: center; padding: 28px 18px 150px; }
.gate::after { content: ''; position: absolute; inset: 0; opacity: 0.07; pointer-events: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .8 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.gate > * { position: relative; z-index: 1; }
.gate-inner { width: min(420px, 100%); text-align: center; }
.gate .wordmark { font-weight: 600; font-size: clamp(3.4rem, 12vw, 5.4rem); letter-spacing: 0.02em; line-height: 1; display: flex; justify-content: center; align-items: center; gap: 18px; }
.gate .wordmark .star { font-size: 0.55em; }
.gate .slogan { font-size: 0.78rem; letter-spacing: 0.5em; margin: 10px 0 34px; opacity: 0.9; }
.gate form { text-align: left; }
.gate .input { background: rgba(0, 0, 0, 0.22); border-color: rgba(243, 248, 246, 0.35); }
.gate .field label { color: rgba(243, 248, 246, 0.8); }
.gate .btn { width: 100%; padding: 14px; }
.gate .err { color: #ffd2c8; }
.gate .stripe { position: absolute; left: -4%; right: -4%; bottom: 36px; z-index: 1; background: var(--paper); color: var(--brick); transform: rotate(-2deg); padding: 18px 0; display: flex; justify-content: center; gap: 6vw; flex-wrap: wrap; font-size: 0.95rem; font-weight: 500; }
.gate h2 { margin-bottom: 8px; }

/* ---------- responsivo ---------- */
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 150; left: 0; top: 0; width: min(290px, 84vw); transform: translateX(-102%); transition: transform 0.2s; }
  body.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--ink-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 120; }
  .topbar .logo { padding: 0; font-size: 1.5rem; }
  .player-wrap { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: 1fr; }
  .hero .s1 { width: 64px; height: 64px; }
  .hero .s2 { display: none; }
  .band .item { flex-direction: column; gap: 2px; }
  .band .star { display: none; }
  .band { margin-inline: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.hero .eyebrow { display: block; margin-bottom: 18px; }
.grid-form { align-items: start; }
