/* =========================================================
   Secure Video — Minimalista
   Uma única sans (Geist), preto/branco/cinzas, sem decoração.
   ========================================================= */

@import url('https://fonts.bunny.net/css?family=geist:400,500,600,700&family=geist-mono:400,500&display=swap');

:root {
    /* Greys (tailwind neutral-ish) */
    --bg:        #FAFAFA;
    --surface:   #FFFFFF;
    --surface-2: #F4F4F4;
    --surface-3: #EAEAEA;
    --border:    #E5E5E5;
    --border-2:  #D4D4D4;
    --ink:       #0A0A0A;
    --ink-2:     #404040;
    --muted:     #737373;
    --muted-2:   #A3A3A3;

    /* Estados — usados sem destaque, apenas onde semanticamente preciso */
    --success:    #16A34A;
    --success-bg: #F0FDF4;
    --warn:       #B45309;
    --warn-bg:    #FFFBEB;
    --danger:     #DC2626;
    --danger-bg:  #FEF2F2;
    --info:       #1D4ED8;
    --info-bg:    #EFF6FF;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --ring:      0 0 0 3px rgba(10,10,10,.10);

    --font:      'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --mono:      'Geist Mono', ui-monospace, SFMono-Regular, monospace;

    --r-sm: 6px;
    --r:    8px;
    --r-lg: 12px;
}

[data-theme="dark"] {
    --bg:        #0A0A0A;
    --surface:   #111111;
    --surface-2: #171717;
    --surface-3: #1F1F1F;
    --border:    #262626;
    --border-2:  #404040;
    --ink:       #FAFAFA;
    --ink-2:     #D4D4D4;
    --muted:     #A3A3A3;
    --muted-2:   #737373;

    --success-bg: #052E16;
    --warn-bg:    #1F1402;
    --danger-bg:  #2A0808;
    --info-bg:    #0B1B3D;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow:    0 1px 3px rgba(0,0,0,.6);
    --ring:      0 0 0 3px rgba(250,250,250,.10);
}

* { box-sizing: border-box; }
*::selection { background: var(--ink); color: var(--surface); }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: var(--ink); }
a.unlink { text-decoration: none; }
a.unlink:hover { text-decoration: none; }

code, .mono { font-family: var(--mono); font-size: .85em; }
code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--ink-2);
}

h1, h2, h3, h4 {
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: -.012em;
    color: var(--ink);
    margin: 0 0 .5em;
    line-height: 1.2;
}
h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.022em; }
h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: .35em; }
h3 { font-size: .95rem; font-weight: 600; }

.muted { color: var(--muted); }
.eyebrow {
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    margin: 0 0 8px;
}

/* ----- Shell ----- */
.container { max-width: 1160px; margin: 0 auto; padding: 32px 28px 80px; }
@media (max-width: 720px) { .container { padding: 24px 16px 60px; } }

.topbar {
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar .container { padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 22px; height: 22px;
    border-radius: 5px;
    background: var(--ink);
    color: var(--bg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 700;
    letter-spacing: 0;
}

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .12s, background .12s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--ink); background: var(--surface-2); }
.nav .sep { width: 1px; height: 16px; background: var(--border); margin: 0 6px; }

.theme-toggle {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--border-2); }
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: inline; }

/* ----- Page head ----- */
.page-head { margin: 4px 0 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .lede { color: var(--muted); max-width: 58ch; margin: 6px 0 0; font-size: .92rem; }

/* ----- Cards ----- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px 22px;
}
.card .card-title { font-size: .92rem; font-weight: 600; margin: 0 0 2px; color: var(--ink); }
.card .card-sub { color: var(--muted); font-size: .82rem; margin: 0 0 14px; }
.card hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ----- Métricas — linha única, compactas ----- */
.metrics {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    overflow: hidden;
    margin-bottom: 24px;
}
.metrics .m {
    padding: 14px 16px;
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
}
.metrics .m:last-child { border-right: 0; }
.metrics .m .lbl {
    color: var(--muted);
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 500;
}
.metrics .m .num {
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.metrics .m .num.danger { color: var(--danger); }
.metrics .m .num.success { color: var(--success); }
.metrics .m .delta { font-size: .72rem; color: var(--muted-2); margin-top: 2px; }
@media (max-width: 1000px) { .metrics { grid-template-columns: repeat(3, 1fr); } .metrics .m:nth-child(3) { border-right: 0; } .metrics .m:nth-child(n+4) { border-top: 1px solid var(--border); } }
@media (max-width: 560px)  { .metrics { grid-template-columns: repeat(2, 1fr); } .metrics .m:nth-child(n) { border-right: 1px solid var(--border); } .metrics .m:nth-child(2n) { border-right: 0; } .metrics .m:nth-child(n+3) { border-top: 1px solid var(--border); } }

/* ----- Buttons ----- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r);
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--ink);
    font: 500 .85rem var(--font);
    line-height: 1.2;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-2); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-busy { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn.primary {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--surface);
}
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--surface); }
[data-theme="dark"] .btn.primary { background: var(--surface); border-color: var(--surface); color: var(--ink); }
[data-theme="dark"] .btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--surface); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }

.btn.danger { color: var(--danger); border-color: var(--border-2); background: var(--surface); }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn.sm { padding: 5px 10px; font-size: .78rem; border-radius: 6px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----- Forms ----- */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 540px; }
.form .row { display: flex; gap: 12px; }
.form .row > * { flex: 1; }
.form label, .field {
    display: flex; flex-direction: column; gap: 6px;
    font-size: .82rem;
    color: var(--ink-2);
    font-weight: 500;
}
.form label .hint, .field .hint {
    font-weight: 400;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.4;
}

input[type="text"], input[type="url"], input[type="email"],
input[type="password"], input[type="number"], input:not([type]),
textarea, select, .input {
    appearance: none;
    width: 100%;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border-2);
    border-radius: var(--r);
    padding: 10px 12px;
    font: 400 .9rem var(--font);
    line-height: 1.4;
    transition: border-color .12s, box-shadow .12s;
}
textarea { font: 400 .82rem var(--mono); line-height: 1.5; resize: vertical; min-height: 88px; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, textarea:hover, select:hover, .input:hover { border-color: var(--ink-2); }
input:focus, textarea:focus, select:focus, .input:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: var(--ring);
}
input[readonly], textarea[readonly] { background: var(--surface-2); color: var(--ink-2); }

.file-drop {
    border: 1px dashed var(--border-2);
    border-radius: var(--r);
    padding: 24px 16px;
    text-align: center;
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
}
.file-drop:hover, .file-drop.dragover {
    border-color: var(--ink);
    background: var(--surface);
    color: var(--ink);
}
.file-drop input[type=file] { display: none; }
.file-drop .file-name { color: var(--ink); font-weight: 500; font-size: .9rem; word-break: break-all; }
.file-drop .file-sub { font-size: .76rem; color: var(--muted); margin-top: 4px; }

/* progress */
.progress {
    width: 100%; height: 4px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
}
.progress .bar {
    height: 100%;
    background: var(--ink);
    width: 0;
    transition: width .35s ease;
}
.progress-text {
    font: 500 .78rem var(--mono);
    color: var(--muted);
    margin-top: 6px;
    display: flex; justify-content: space-between; gap: 8px;
}

/* ----- Alerts ----- */
.alert {
    padding: 10px 12px;
    border-radius: var(--r);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--ink-2);
    font-size: .85rem;
}
.alert.err  { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger); }
.alert.ok   { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert.warn { background: var(--warn-bg);    border-color: var(--warn);    color: var(--warn); }

/* ----- Pills (status) ----- */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px;
    font: 500 .7rem var(--font);
    text-transform: lowercase;
    letter-spacing: 0;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
}
.pill::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .9;
}
.pill-uploaded   { color: var(--info);    background: var(--info-bg);    border-color: color-mix(in srgb, var(--info) 25%, var(--border)); }
.pill-processing { color: var(--warn);    background: var(--warn-bg);    border-color: color-mix(in srgb, var(--warn) 25%, var(--border)); }
.pill-processing::before { animation: pulse 1.4s infinite; }
.pill-ready      { color: var(--success); background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 25%, var(--border)); }
.pill-error      { color: var(--danger);  background: var(--danger-bg);  border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ----- Tables ----- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.tbl thead th {
    color: var(--muted);
    font-weight: 500;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: var(--surface-2);
}
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.num { font-variant-numeric: tabular-nums; }
.tbl td.right, .tbl th.right { text-align: right; }

/* ----- Mini bar chart ----- */
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-chart .row { display: grid; grid-template-columns: 1fr 100px 38px; gap: 12px; align-items: center; font-size: .82rem; }
.bar-chart .row .title { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chart .bar { height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-chart .bar > span { display: block; height: 100%; background: var(--ink); }
.bar-chart .row .v { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: .8rem; }

/* ----- Grid 2 / 3 col ----- */
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
@media (max-width: 880px) { .grid-2 { grid-template-columns: 1fr; } }

/* ----- Player preview ----- */
.player-preview { margin-top: 14px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/9; background: #000; }
.player-preview iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ----- Snippet (input + copy) ----- */
.snippet { position: relative; }
.snippet textarea { width: 100%; padding-right: 86px; }
.snippet input[type="text"] { padding-right: 86px; }
.snippet .copy-btn { position: absolute; top: 6px; right: 6px; }

/* ----- Footer ----- */
.footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: 56px;
    background: var(--bg);
    color: var(--muted);
    font-size: .78rem;
}

/* ----- Login ----- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 36px 32px;
    width: 100%; max-width: 360px;
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 4px; }
.login-box .sub { color: var(--muted); margin: 0 0 22px; font-size: .85rem; }
.login-box .form { gap: 12px; }

/* ----- Reveal ----- */
@media (prefers-reduced-motion: no-preference) {
    .reveal > * {
        opacity: 0;
        transform: translateY(4px);
        animation: rv .35s cubic-bezier(.2,.7,.2,1) forwards;
    }
    .reveal > *:nth-child(1) { animation-delay: 0.02s; }
    .reveal > *:nth-child(2) { animation-delay: 0.06s; }
    .reveal > *:nth-child(3) { animation-delay: 0.10s; }
    .reveal > *:nth-child(4) { animation-delay: 0.14s; }
    .reveal > *:nth-child(5) { animation-delay: 0.18s; }
    .reveal > *:nth-child(6) { animation-delay: 0.22s; }
    .reveal > *:nth-child(7) { animation-delay: 0.26s; }
    .reveal > *:nth-child(8) { animation-delay: 0.30s; }
    @keyframes rv { to { opacity: 1; transform: none; } }
}

/* ----- Utilities ----- */
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.text-sm { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.divider { border-top: 1px solid var(--border); margin: 18px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
