/* ===========================================================
   NIVEO CAPTURE — Design System + App do Cliente
   base premium escura · laranja = energia/direção · Sora + Inter
   diagonal 35–45° como assinatura · geométrico e incisivo
   =========================================================== */
:root {
  /* Brand NIVEO */
  --niveo-orange: #ff4800;
  --niveo-orange-dark: #ee4b00;
  --niveo-orange-light: #ff6400;
  --niveo-ember: #480b07;
  --niveo-black: #000000;
  --niveo-graphite: #212121;
  --niveo-white: #ffffff;

  /* Aliases legados (mesmos nomes, valores NIVEO) */
  --pink: var(--niveo-orange);
  --pink-dark: var(--niveo-orange-dark);
  --pink-soft: rgba(255, 72, 0, 0.14);
  --accent-bright: var(--niveo-orange-light);

  --bg: #000000;
  --surface: #161616;
  --surface-2: #212121;
  --surface-3: #2c2b2a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: #a8a29c;
  --muted-2: #726c67;
  --ok: #1e9e5a;
  --warn: #c98a00;
  --danger: #d93b30;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --slash: 40deg;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 44px -16px rgba(0, 0, 0, 0.7);

  --font-head: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --maxw: 560px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.4em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }

.brand-mark {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--pink);
  font-size: 0.85rem;
}

/* Layout */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 20px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar .title { font-family: var(--font-head); font-weight: 700; font-size: 1rem; }
.content { flex: 1; }
.spacer { flex: 1; }

/* Botões */
.btn {
  --bg-btn: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: var(--radius-sm);
  background: var(--bg-btn); color: var(--text);
  border: 1px solid var(--line-strong); cursor: pointer;
  font-size: 0.95rem; font-weight: 600; width: 100%;
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { --bg-btn: var(--niveo-orange); border-color: var(--niveo-orange); color: #fff; position: relative; overflow: hidden; }
.btn-primary:hover { --bg-btn: var(--niveo-orange-dark); border-color: var(--niveo-orange-dark); }
/* assinatura NIVEO: brilho diagonal 40° atravessa a ação primária */
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(var(--slash), transparent 44%, rgba(255, 255, 255, 0.28) 50%, transparent 56%);
  transform: translateX(-140%); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.btn-primary:hover::after { transform: translateX(140%); }
@media (prefers-reduced-motion: reduce) { .btn-primary::after { display: none; } }
.btn-ghost { --bg-btn: transparent; border-color: var(--line-strong); }
.btn-danger { --bg-btn: transparent; border-color: rgba(217, 59, 48, 0.5); color: #ff8f88; }
.btn-sm { padding: 9px 14px; font-size: 0.85rem; width: auto; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: 100%; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.card-tap { cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.card-tap:hover { border-color: var(--line-strong); background: var(--surface-2); }
.card h3 { font-size: 1.05rem; }

.eyebrow { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.75rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; }

/* Chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.chip-pink { background: var(--pink-soft); border-color: transparent; color: var(--accent-bright); }
.chip-ok { color: #7ee2a8; border-color: rgba(34, 197, 94, 0.3); }
.chip-warn { color: #ffcf87; border-color: rgba(245, 166, 35, 0.3); }
.chip-danger { color: #ff8f88; border-color: rgba(217, 59, 48, 0.35); }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 0.95rem; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--pink); }
.textarea { min-height: 90px; resize: vertical; }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--pink); width: 0; transition: width 0.25s ease; }

/* Steps */
.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps > i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps > i.done { background: var(--pink); }
.steps > i.active { background: var(--accent-bright); }

/* Login */
.auth-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 4px; }
.strike-logo { display: block; filter: drop-shadow(0 6px 20px rgba(255, 72, 0, 0.35)); }
.auth-card .brand-big {
  font-family: var(--font-head); font-weight: 800; letter-spacing: 0.18em;
  color: var(--pink); font-size: 1.05rem; text-align: center;
}
.gis-slot { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }
.gis-host { display: flex; justify-content: center; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 0.75rem; width: 100%; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.install-wrap { margin-top: 12px; }
.install-hint { text-align: center; line-height: 1.5; }
.install-wrap .btn { font-size: 0.85rem; }

/* Footer Strike */
.strike-footer { text-align: center; padding: 8px 0 4px; color: var(--muted-2); }
.strike-footer .sf-brand {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--muted); text-decoration: none;
}
.strike-footer .sf-bolt { color: var(--pink); }
.strike-footer .sf-links { margin: 4px 0 2px; }
.strike-footer .sf-links a { color: var(--pink); font-size: 0.8rem; }
.strike-footer .sf-copy { color: var(--muted-2); }
.content .strike-footer { margin-top: 34px; padding-bottom: 24px; border-top: 1px solid var(--line); padding-top: 18px; }

/* Banner de notificacoes */
.notif-banner {
  background: var(--pink-soft); border: 1px solid rgba(255, 72, 0, 0.30);
  border-radius: var(--radius); padding: 14px; margin: 14px 0 4px;
}

/* Menu do usuario */
.usermenu { position: relative; }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 6px; box-shadow: var(--shadow); display: none; z-index: 40;
}
.usermenu.open .usermenu-pop { display: block; }
.usermenu-pop .um-name { padding: 8px 10px 6px; word-break: break-all; }
.usermenu-pop .um-item {
  display: block; width: 100%; text-align: left; padding: 10px; border: 0; background: transparent;
  color: var(--text); font-size: 0.9rem; border-radius: 8px; cursor: pointer;
}
.usermenu-pop .um-item:hover { background: var(--surface-3); }

/* Toast */
.toast-host { position: fixed; left: 0; right: 0; bottom: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 9999; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--text); padding: 12px 16px; border-radius: 10px; font-size: 0.88rem; max-width: 90vw;
  box-shadow: var(--shadow); animation: toastIn 0.2s ease;
}
.toast.err { border-color: rgba(217, 59, 48, 0.5); }
.toast.ok { border-color: rgba(34, 197, 94, 0.45); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* Loading */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--pink); animation: spin 0.8s linear infinite; }
.loading-full { min-height: 60dvh; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg { opacity: 0.4; margin-bottom: 12px; }

/* ===================== CAPTURA ===================== */
.capture-stage { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; }
.capture-stage video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.capture-video-wrap { position: absolute; inset: 0; }
.capture-hud { position: absolute; inset: 0; display: flex; flex-direction: column; pointer-events: none; }
.capture-hud .pointer-on { pointer-events: auto; }
.hud-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pink); animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.hud-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-family: var(--font-head); }

.scene-panel {
  margin: auto 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
  padding: 15px; border-radius: 16px;
  background: rgba(10, 10, 10, 0.74); backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  flex: 0 1 auto; min-height: 0;
  max-height: 66dvh; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.scene-panel .scene-count { font-size: 0.72rem; letter-spacing: 0.12em; color: #ff8fb5; text-transform: uppercase; }
.scene-panel .scene-text { font-size: 1.12rem; font-weight: 600; margin: 6px 0 10px; }
.scene-panel.speech .scene-text { font-size: 1.05rem; }

.scene-instruction {
  font-size: 1.05rem; font-weight: 600; line-height: 1.4; margin: 8px 0;
  display: flex; gap: 8px; align-items: flex-start;
}
.scene-tag, .tp-tag {
  flex: 0 0 auto; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em;
  padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,0.14); color: #fff;
  margin-top: 2px;
}
.tp-tag { display: inline-block; background: var(--pink); margin-bottom: 6px; }

.scene-panel.scene-paused { border-color: rgba(34,197,94,0.4); max-height: 80dvh; }
.scene-panel.scene-paused .next-preview {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  max-height: 24dvh; overflow-y: auto;
}
.scene-panel.scene-paused .btn-row {
  position: sticky; bottom: -15px; margin: 12px -15px -15px;
  padding: 12px 15px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: linear-gradient(180deg, rgba(10,10,10,0), rgba(10,10,10,0.92) 40%);
}
.rec-dot.paused { background: var(--warn); animation: none; }

/* Bottom sheet de configuracoes */
.sheet-back { position: absolute; inset: 0; background: rgba(0,0,0,0.55); z-index: 200; display: flex; align-items: flex-end; pointer-events: auto; }
.sheet .select { margin-bottom: 4px; }
.sheet {
  width: 100%; background: var(--surface); border-top-left-radius: 20px; border-top-right-radius: 20px;
  border-top: 1px solid var(--line-strong); padding: 20px 18px calc(env(safe-area-inset-bottom,0px) + 20px);
  animation: sheetUp 0.2s ease;
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0.6; } }
.sheet-h { font-family: var(--font-head); font-weight: 700; margin-bottom: 14px; }
.seg-group { display: flex; gap: 6px; background: var(--surface-3); padding: 4px; border-radius: 10px; }
.seg {
  flex: 1; padding: 9px 6px; border-radius: 8px; border: 0; background: transparent;
  color: var(--muted); font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.seg.on { background: var(--pink); color: #fff; }
.seg-group:has(.seg-block) { flex-direction: column; background: transparent; padding: 0; gap: 8px; }
.seg-block {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
.seg-block strong { font-size: 0.9rem; }
.seg-block .tiny { line-height: 1.35; }
.seg-block.on { background: var(--pink-soft); border-color: var(--pink); color: var(--text); }
.seg-block.on strong { color: var(--accent-bright); }

.teleprompter {
  max-height: 34dvh; overflow: hidden; position: relative;
  border-radius: 12px; background: rgba(0, 0, 0, 0.45); padding: 12px 14px;
}
.teleprompter .tp-scroll { transition: transform 0.1s linear; }
.teleprompter p { font-size: var(--tp-size, 1.35rem); line-height: 1.6; margin: 0; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.teleprompter .tp-current { color: #ff8fb5; }

.hud-bottom {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 22px);
  background: linear-gradient(0deg, rgba(0,0,0,0.6), transparent);
}
.shutter {
  width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff;
  background: var(--pink); cursor: pointer; flex: 0 0 auto;
}
.shutter.recording { border-radius: 18px; background: var(--pink); }
.hud-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line-strong); color: #fff; cursor: pointer;
}
.tp-controls { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 10px; }
.tp-controls button { width: 38px; height: 34px; border-radius: 8px; background: rgba(255,255,255,0.1); border: 1px solid var(--line-strong); color: #fff; cursor: pointer; }

.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: 6rem; font-weight: 800; color: #fff; background: rgba(0,0,0,0.4); }

/* Photo overlay guides */
.guide-face { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 55%; aspect-ratio: 3/4; border: 2px dashed rgba(255,255,255,0.7); border-radius: 50% / 42%; }
.guide-rule { position: absolute; background: rgba(255,255,255,0.25); }

/* Perm denied */
.perm-screen { position: fixed; inset: 0; background: var(--bg); z-index: 60; display: grid; place-items: center; padding: 24px; }

@media (min-width: 640px) {
  .capture-stage { max-width: 420px; margin: 0 auto; inset: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ===== Solicitação de mídia (wizard) ===== */
.home-cta { display: flex; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; }
.home-cta .btn { flex: 1 1 auto; }

.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.req-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 14px; border-radius: var(--radius-sm); text-align: left;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.req-card:hover { border-color: var(--pink); }
.req-card-ic { color: var(--pink); }
.req-card-label { font-weight: 600; font-size: 0.9rem; }
.req-card-tag { font-size: 0.65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); }

.req-progress-bar { height: 4px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-bottom: 4px; }
.req-progress-bar > i { display: block; height: 100%; background: var(--pink); transition: width .25s ease; }
.req-fields { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.req-field { display: flex; flex-direction: column; }
.req-flabel { font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.req-req { color: var(--pink); }
.req-checks { display: flex; flex-direction: column; gap: 8px; }
.req-check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.req-check input { width: 16px; height: 16px; accent-color: var(--pink); }
.req-rows, .req-uploads { display: flex; flex-direction: column; gap: 8px; }
.req-row { display: flex; gap: 8px; align-items: center; }
.req-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.req-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; cursor: pointer;
}
.req-chip.sel { background: var(--pink-soft); border-color: transparent; color: var(--accent-bright); }
.req-chip-x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; }
.req-upitem { display: flex; align-items: center; gap: 6px; color: var(--muted); }

.req-palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.req-pal {
  text-align: left; padding: 10px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.req-pal.sel { border-color: var(--pink); }
.req-pal-sw { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.req-pal-sw > span { flex: 1; }
.req-pal-name { font-weight: 600; font-size: 0.85rem; }
.req-pal-usage { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.req-pal-urow { display: flex; align-items: center; gap: 6px; }
.req-pal-dot { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }

.req-aicopy { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.req-review { display: flex; flex-direction: column; gap: 8px; }
.req-review-row { display: flex; justify-content: space-between; gap: 14px; font-size: 0.86rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.req-review-row > span:last-child { text-align: right; color: var(--text); }

/* ===== Dashboard admin ===== */
.dash-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 22px; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.dash-big { font-family: var(--font-head, inherit); font-size: 1.9rem; font-weight: 800; }
.kv { display: flex; justify-content: space-between; gap: 14px; font-size: 0.86rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv > span:last-child { text-align: right; }

.card-review { border-color: var(--pink); background: linear-gradient(180deg, var(--pink-soft), transparent); }
