/* Reels Factory: "uma ferramenta editorial inteligente e tranquila".
   Azul claro e branco, muito espaço, sombras suaves, cantos arredondados, hierarquia simples. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f4f7fd;
  --bg-tint: #eaf0fc;
  --surface: #ffffff;
  --surface-soft: #f7f9fe;
  --line: #e2e9f6;
  --line-strong: #cfdaef;
  --text: #17213b;
  --text-2: #56638a;
  --text-3: #8592b3;
  --blue: #3366ff;
  --blue-ink: #2449c7;
  --blue-soft: #e5ecff;
  --blue-softer: #f0f4ff;
  --ok: #1e7f55;
  --ok-soft: #e6f5ed;
  --warn: #8a6100;
  --warn-soft: #fff4d6;
  --err: #b42318;
  --err-soft: #fdecec;
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 33, 59, 0.04);
  --shadow: 0 1px 2px rgba(23, 33, 59, 0.04), 0 10px 30px rgba(51, 102, 255, 0.06);
  --shadow-lg: 0 24px 60px rgba(23, 33, 59, 0.14);
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(51, 102, 255, 0.35); outline-offset: 2px; border-radius: 8px; }

/* ---------- estrutura ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--blue);
  box-shadow: inset 0 0 0 4px var(--blue-soft);
}
.nav { display: flex; gap: 6px; flex: 1; }
.nav a, .nav span {
  white-space: nowrap; padding: 7px 14px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14px;
}
.nav a:hover { background: var(--bg-tint); text-decoration: none; }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.nav .soon { color: var(--text-3); cursor: default; }
.nav .soon small { font-size: 11px; margin-left: 4px; }
.logout { background: none; border: 0; color: var(--text-3); font: inherit; font-size: 14px; cursor: pointer; padding: 7px 4px; }
.logout:hover { color: var(--text-2); }

.page { max-width: 1200px; margin: 0 auto; padding: 8px var(--gutter) 80px; }
.section { margin-top: 56px; }
.section:first-child { margin-top: 24px; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 650; margin: 0; }
h2 { font-size: 19px; letter-spacing: -0.01em; font-weight: 600; margin: 0 0 18px; }
.lede { color: var(--text-2); font-size: 16px; margin: 10px 0 0; max-width: 560px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(51, 102, 255, 0.22); }
.btn-primary:hover { background: var(--blue-ink); }
.btn-soft { background: var(--blue-soft); color: var(--blue-ink); }
.btn-soft:hover { background: #d8e3ff; }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--text); border-color: #b9c8e6; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ---------- campos ---------- */
.field { display: block; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.input, .textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-softer); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ---------- pílulas de status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--bg-tint); color: var(--text-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: var(--blue-soft); color: var(--blue-ink); }
.pill.plain::before { display: none; }

/* ---------- nova sessão ---------- */
.new-session { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 28px; }
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; }
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-soft);
  padding: 44px 24px; text-align: center; transition: background 0.15s, border-color 0.15s;
}
.drop.over { background: var(--blue-softer); border-color: var(--blue); }
.drop-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: var(--blue-soft);
  display: grid; place-items: center; color: var(--blue);
}
.drop-title { font-weight: 600; font-size: 16px; margin: 0; }
.drop-sub { color: var(--text-3); font-size: 13.5px; margin: 6px 0 18px; }
.files { list-style: none; margin: 18px 0 0; padding: 0; text-align: left; }
.files li {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); font-size: 14px;
}
.files li + li { margin-top: 8px; }
.files .size { color: var(--text-3); white-space: nowrap; }
.form-row { display: flex; gap: 14px; align-items: end; margin-top: 22px; }
.form-row .field { flex: 1; }
.upload-status { margin-top: 18px; }
.bar { height: 6px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width 0.3s; }
.upload-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.error-text { color: var(--err); font-size: 14px; margin: 14px 0 0; }

/* etapas do processamento */
.progress-card h2 { margin-bottom: 6px; }
.progress-card .progress-name { color: var(--text-2); font-size: 14px; margin: 0 0 20px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: flex; align-items: center; gap: 14px; padding: 9px 0; color: var(--text-3); font-size: 14.5px; }
.step + .step::before {
  content: ""; position: absolute; left: 11px; top: -9px; height: 18px; width: 2px; background: var(--line);
}
.step .dot {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong);
  background: var(--surface); display: grid; place-items: center; font-size: 12px; z-index: 1;
}
.step.done { color: var(--text-2); }
.step.done .dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.step.active { color: var(--text); font-weight: 600; }
.step.active .dot { border-color: var(--blue); box-shadow: 0 0 0 5px var(--blue-softer); }
.step.active .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: breathe 2.4s ease-in-out infinite; }
.step.error { color: var(--err); font-weight: 600; }
.step.error .dot { border-color: var(--err); background: var(--err); color: #fff; }
@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .step.active .dot::after { animation: none; } }
.progress-empty { color: var(--text-3); font-size: 14px; margin: 0; }
.progress-actions { margin-top: 20px; }

/* sessões recentes */
.sessions { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.session-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 24px; align-items: center;
  padding: 18px 24px; border-top: 1px solid var(--line);
}
.session-row:first-child { border-top: 0; }
.session-row .name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-row .meta { color: var(--text-3); font-size: 13.5px; white-space: nowrap; }
.empty { padding: 36px 24px; text-align: center; color: var(--text-3); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* ---------- revisão da sessão ---------- */
.session-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-top: 24px; }
.crumb { font-size: 13.5px; color: var(--text-3); margin-bottom: 10px; display: inline-block; }
.session-meta { color: var(--text-2); margin-top: 10px; font-size: 14.5px; }
.session-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.stat {
  display: flex; align-items: baseline; gap: 8px; padding: 10px 16px; background: var(--surface);
  border-radius: 999px; box-shadow: var(--shadow-sm); font-size: 14px; color: var(--text-2);
}
.stat b { font-size: 16px; color: var(--text); font-weight: 650; }
.banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; padding: 16px 20px;
  border-radius: var(--radius); background: var(--blue-softer); color: var(--blue-ink); font-size: 14.5px;
}
.banner .bar { flex: 1; min-width: 160px; background: #d9e3ff; }
.banner.err { background: var(--err-soft); color: var(--err); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 36px; }
.reel {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 14px;
  display: flex; flex-direction: column; transition: box-shadow 0.2s, opacity 0.2s;
}
.reel-media { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: var(--bg-tint); }
.reel-media video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0f1526; }
.reel-pending { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--text-3); font-size: 14px; padding: 20px; }
.reel-pending .dot-wait { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin: 0 auto 10px; animation: breathe 2.4s ease-in-out infinite; }
.reel-body { padding: 16px 6px 4px; display: flex; flex-direction: column; flex: 1; }
.reel-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.reel-title h3 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.reel-title .dur { color: var(--text-3); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.reel-first { color: var(--text-2); font-size: 14px; margin: 8px 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.reel-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.reel-actions { display: flex; gap: 8px; margin-top: auto; }
.reel-actions .btn { flex: 1; }
.reel-actions .more { flex: 0 0 auto; padding: 0 14px; }
.reel[data-status="APPROVED"] { box-shadow: 0 0 0 2px var(--ok-soft), var(--shadow); }
.reel[data-status="REJECTED"] .reel-media, .reel[data-status="REJECTED"] .reel-first { opacity: 0.45; }
.btn[aria-pressed="true"].approve { background: var(--ok); color: #fff; box-shadow: none; }
.btn[aria-pressed="true"].reject { background: var(--err-soft); color: var(--err); border-color: transparent; }

/* ---------- painel do Reel ---------- */
.scrim { position: fixed; inset: 0; background: rgba(23, 33, 59, 0.28); backdrop-filter: blur(2px); z-index: 20; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 21;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px 0; }
.panel-head h2 { margin: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg-tint); color: var(--text-2); cursor: pointer; font-size: 18px; }
.icon-btn:hover { color: var(--text); }
.panel-scroll { overflow-y: auto; padding: 16px 24px 32px; flex: 1; }
.panel-video { display: block; margin: 0 auto; max-height: 56vh; aspect-ratio: 9 / 16; width: auto; max-width: 100%; border-radius: var(--radius); background: #0f1526; }
.panel-review { display: flex; gap: 8px; justify-content: center; margin: 16px 0 6px; }
.tabs { display: flex; gap: 4px; padding: 4px; margin: 18px 0 20px; background: var(--bg-tint); border-radius: 999px; }
.tab { flex: 1; height: 36px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.facts { margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: 14px 18px; font-size: 14.5px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; }
.quote { margin: 0; color: var(--text); }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alerts li { padding: 10px 14px; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); font-size: 14px; }
.alerts li.none { background: var(--ok-soft); color: var(--ok); }
details.tech { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
details.tech summary { cursor: pointer; color: var(--text-3); font-size: 13.5px; }
details.tech pre { white-space: pre-wrap; font-size: 12px; color: var(--text-2); background: var(--surface-soft); padding: 12px; border-radius: var(--radius-sm); }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.lines li:first-child { border-top: 0; }
.lines .t { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 2px; }
.note { font-size: 13.5px; color: var(--text-2); background: var(--blue-softer); padding: 12px 14px; border-radius: var(--radius-sm); margin: 0 0 16px; }
mark { background: var(--blue-soft); color: var(--blue-ink); border-radius: 4px; padding: 0 3px; }
.pub-block { padding: 18px 0; border-top: 1px solid var(--line); }
.pub-block:first-child { border-top: 0; padding-top: 0; }
.pub-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pub-head h3 { font-size: 14.5px; margin: 0; font-weight: 650; }
.counter { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.save-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.save-state { font-size: 13px; color: var(--text-3); }
.channels { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-3); font-size: 13.5px; font-weight: 500; background: var(--surface-soft); }
.pub-actions { display: flex; gap: 10px; margin-top: 8px; }
.soon-tag { font-size: 11.5px; font-weight: 600; color: var(--text-3); background: var(--bg-tint); padding: 3px 9px; border-radius: 999px; }

/* ---------- login e configurações ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); }
.login-card .brand { margin-bottom: 28px; }
.login-card h1 { font-size: 26px; margin-bottom: 6px; }
.login-card form { margin-top: 24px; display: grid; gap: 16px; }
.settings-list { margin: 0; display: grid; grid-template-columns: 200px 1fr; gap: 16px 24px; }
.settings-list dt { color: var(--text-3); }
.settings-list dd { margin: 0; font-weight: 500; }

/* ---------- responsivo ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .new-session { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .topbar { gap: 8px 12px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 8px; }
  .topbar form { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 -8px; }
  .nav .soon small { display: none; }
  .card { padding: 20px; }
  .drop { padding: 32px 16px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: 1fr; gap: 20px; margin-top: 28px; }
  .session-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 16px 18px; }
  .session-row .meta { grid-column: 1; }
  .session-row .pill { grid-column: 2; grid-row: 1; }
  .session-row .open { grid-column: 2; grid-row: 2 / span 3; align-self: center; }
  .session-actions { width: 100%; }
  .session-actions .btn { flex: 1; }
  .panel { width: 100%; border-radius: 0; }
  .facts, .settings-list { grid-template-columns: 1fr; gap: 4px; }
  .facts dd, .settings-list dd { margin-bottom: 12px; }
}
