/* VIRACLIP - identidade propria: grafite profundo, roxo eletrico, ciano */
:root {
  --bg: #0a0a0f;
  --bg-elev: #101018;
  --surface: #14141e;
  --surface-2: #1a1a26;
  --border: #26263a;
  --border-soft: #1e1e2e;
  --text: #ececf5;
  --muted: #8b8ba3;
  --muted-2: #61617a;
  --purple: #7c5cff;
  --purple-dim: #5b40cc;
  --cyan: #35e0f0;
  --green: #34d99b;
  --amber: #ffbe3d;
  --red: #ff5c72;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(124, 92, 255, .18), transparent 62%),
    radial-gradient(680px 400px at 92% 4%, rgba(53, 224, 240, .10), transparent 60%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }

/* ---------------- utilitarios ---------------- */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* ---------------- marca ---------------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(140deg, var(--purple), var(--cyan));
  display: grid; place-items: center; color: #07070c; font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(124, 92, 255, .35);
}
.brand-name { font-size: 1.16rem; }
.brand-name span { background: linear-gradient(100deg, #fff, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------- botoes ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 11px 18px; border-radius: 12px; cursor: pointer; font-weight: 600;
  font-size: .92rem; transition: .16s ease; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #38385a; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(120deg, var(--purple), var(--purple-dim));
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 26px rgba(124, 92, 255, .32);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 32px rgba(124, 92, 255, .45); }
.btn-ghost { background: transparent; border-color: var(--border-soft); color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(255, 92, 114, .35); color: var(--red); }
.btn-sm { padding: 8px 13px; font-size: .82rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------------- formularios ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .8rem; color: var(--muted);
  margin-bottom: 7px; font-weight: 600; letter-spacing: .01em; }
.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  transition: .16s ease;
}
.input:focus { outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .16); }
select.input { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer;
  color: var(--muted); font-size: .88rem; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--purple); cursor: pointer; }

/* ---------------- login ---------------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 34px 30px; box-shadow: var(--shadow);
}
.auth-card .tagline { color: var(--muted); font-size: .9rem; margin: 14px 0 26px; line-height: 1.5; }
.auth-tabs { display: flex; gap: 6px; background: var(--bg-elev);
  padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.auth-tabs button { flex: 1; padding: 9px; border: none; background: transparent;
  color: var(--muted); border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .88rem; }
.auth-tabs button.active { background: var(--surface-2); color: var(--text); }

/* ---------------- layout do app ---------------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--border-soft); padding: 22px 16px;
  display: flex; flex-direction: column; gap: 26px;
  background: rgba(16, 16, 24, .6); backdrop-filter: blur(8px);
  position: sticky; top: 0; height: 100vh;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 11px; color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: .14s ease;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: rgba(124, 92, 255, .13); color: #cfc4ff; font-weight: 600; }
.nav .ico { width: 18px; text-align: center; opacity: .85; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted-2); padding: 0 12px; margin-bottom: 6px; font-weight: 700; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border-soft); padding-top: 16px; }

.main { padding: 30px 34px 70px; max-width: 1320px; width: 100%; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 1.7rem; }
.page-head p { color: var(--muted); margin-top: 7px; font-size: .92rem; }

.topbar { display: none; }

/* ---------------- cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 20px;
}
.card-pad-lg { padding: 26px; }
.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.grid-clips { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.grid-videos { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.stat { background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px; }
.stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted-2); font-weight: 700; }
.stat .v { font-size: 1.85rem; font-weight: 800; margin-top: 8px; letter-spacing: -.03em; }
.stat .v.accent { background: linear-gradient(100deg, var(--purple), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------- status ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .01em;
  border: 1px solid transparent;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-run { background: rgba(124, 92, 255, .14); color: #b7a6ff; border-color: rgba(124, 92, 255, .3); }
.chip-done { background: rgba(52, 217, 155, .12); color: var(--green); border-color: rgba(52, 217, 155, .28); }
.chip-fail { background: rgba(255, 92, 114, .12); color: var(--red); border-color: rgba(255, 92, 114, .28); }
.chip-idle { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.chip .dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.progress { height: 7px; background: var(--bg-elev); border-radius: 999px;
  overflow: hidden; border: 1px solid var(--border-soft); }
.progress > i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--cyan)); transition: width .5s ease; }

.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.step { font-size: .7rem; padding: 4px 9px; border-radius: 7px;
  background: var(--bg-elev); color: var(--muted-2); border: 1px solid var(--border-soft); }
.step.on { background: rgba(124, 92, 255, .14); color: #c3b4ff; border-color: rgba(124, 92, 255, .3); }
.step.past { color: var(--green); border-color: rgba(52, 217, 155, .25); }

/* ---------------- clip card ---------------- */
.clip-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden; transition: .18s ease;
  display: flex; flex-direction: column;
}
.clip-card:hover { border-color: #33334f; transform: translateY(-3px); box-shadow: var(--shadow); }
.clip-thumb {
  position: relative; aspect-ratio: 9 / 16; background: #07070c;
  display: grid; place-items: center; cursor: pointer; overflow: hidden;
}
.clip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip-thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.5)); opacity: 0; transition: .16s;
}
.clip-thumb:hover .play { opacity: 1; }
.clip-thumb .play i {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.94); color: #0a0a0f; font-style: normal; font-size: 1.15rem;
  padding-left: 4px;
}
.clip-badge {
  position: absolute; top: 10px; left: 10px; padding: 5px 10px; border-radius: 9px;
  background: rgba(10,10,15,.82); backdrop-filter: blur(6px);
  font-size: .74rem; font-weight: 800; border: 1px solid rgba(255,255,255,.1);
}
.clip-dur {
  position: absolute; bottom: 10px; right: 10px; padding: 3px 8px; border-radius: 7px;
  background: rgba(10,10,15,.82); font-size: .72rem; font-weight: 700;
}
.clip-body { padding: 15px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.clip-title { font-weight: 700; font-size: .94rem; line-height: 1.35; }
.score-bar { height: 5px; border-radius: 999px; background: var(--bg-elev); overflow: hidden; }
.score-bar > i { display: block; height: 100%; }
.reasons { display: flex; flex-wrap: wrap; gap: 5px; }
.reason { font-size: .68rem; padding: 3px 8px; border-radius: 6px;
  background: var(--bg-elev); color: var(--muted); border: 1px solid var(--border-soft); }
.clip-actions { display: flex; gap: 8px; margin-top: auto; }
.clip-actions .btn { flex: 1; }

/* ---------------- player ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(5, 5, 9, .88); backdrop-filter: blur(10px); padding: 20px;
}
.player-shell { width: min(390px, 92vw); display: flex; flex-direction: column; gap: 14px; }
.player-shell video {
  width: 100%; aspect-ratio: 9 / 16; border-radius: 20px; background: #000;
  border: 1px solid var(--border); box-shadow: var(--shadow); display: block;
}
.player-meta { text-align: center; }
.modal-close {
  position: fixed; top: 20px; right: 22px; width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; font-size: 1.15rem;
}

/* ---------------- upload ---------------- */
.drop {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 46px 24px; text-align: center; cursor: pointer; transition: .18s ease;
  background: var(--bg-elev);
}
.drop:hover, .drop.over { border-color: var(--purple); background: rgba(124, 92, 255, .06); }
.drop .ico { font-size: 2.4rem; }
.drop h3 { margin-top: 12px; font-size: 1.05rem; }
.drop p { color: var(--muted); font-size: .85rem; margin-top: 7px; }

/* ---------------- tabela ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th { text-align: left; padding: 11px 12px; color: var(--muted-2);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  border-bottom: 1px solid var(--border-soft); font-weight: 700; }
.table td { padding: 12px; border-bottom: 1px solid var(--border-soft); }
.table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

/* ---------------- diversos ---------------- */
.toast-host { position: fixed; bottom: 22px; right: 22px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 17px; box-shadow: var(--shadow);
  font-size: .88rem; max-width: 340px; animation: slide .22s ease; }
.toast.err { border-color: rgba(255, 92, 114, .4); color: #ffc0c8; }
.toast.ok { border-color: rgba(52, 217, 155, .4); color: #b6f0d8; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .ico { font-size: 2.6rem; opacity: .55; }
.empty h3 { margin-top: 14px; color: var(--text); font-size: 1.05rem; }
.empty p { margin-top: 8px; font-size: .89rem; }

.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.2);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { border-radius: 12px; padding: 13px 16px; font-size: .86rem; line-height: 1.5; }
.notice-err { background: rgba(255, 92, 114, .1); border: 1px solid rgba(255, 92, 114, .3); color: #ffc0c8; }
.notice-info { background: rgba(53, 224, 240, .07); border: 1px solid rgba(53, 224, 240, .22); color: #a6e9f2; }

.transcript { max-height: 230px; overflow-y: auto; font-size: .87rem;
  line-height: 1.7; color: var(--muted); white-space: pre-wrap; }

/* ---------------- responsivo ---------------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    gap: 14px; overflow-x: auto; padding: 12px 14px;
    border-right: none; border-bottom: 1px solid var(--border-soft);
  }
  .sidebar .brand-name, .nav-label, .sidebar-foot .small { display: none; }
  .sidebar-foot { margin-top: 0; border-top: none; padding-top: 0; margin-left: auto; }
  .nav { flex-direction: row; gap: 4px; }
  .nav a { padding: 9px 11px; font-size: .82rem; }
  .main { padding: 20px 16px 60px; }
  .page-head h1 { font-size: 1.35rem; }
  .grid-clips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .grid-videos { grid-template-columns: 1fr; }
  .clip-actions { flex-direction: column; }
}

@media (max-width: 520px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .stat .v { font-size: 1.4rem; }
  .auth-card { padding: 26px 20px; }
}

/* selo de enquadramento no card do corte */
.clip-layout {
  position: absolute; top: 10px; right: 10px; padding: 4px 9px; border-radius: 8px;
  background: rgba(10, 10, 15, .82); backdrop-filter: blur(6px);
  font-size: .66rem; font-weight: 700; letter-spacing: .01em;
  border: 1px solid rgba(255, 255, 255, .1); color: var(--cyan);
}
