/* cut67 — tema escuro roxo/azul */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0b0d10; --bg2: #0f1217; --panel: #12161c; --panel2: #171c24;
  --line: #282e36; --text: #e9edf3; --muted: #8b94a3;
  --accent: #7c3aed; --accent2: #6d28d9; --accent-soft: #a78bfa;
  --blue: #3b82f6; --ok: #4ade80; --err: #f87171; --warn: #fbbf24;
  --radius: 14px;
}
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, sans-serif; font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
a { color: var(--accent-soft); }

h1, h2, h3 { font-weight: 800; letter-spacing: -.02em; }
.section-title { font-size: 22px; margin-bottom: 4px; }
.section-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* ---------- inputs ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], select, textarea {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; outline: none;
  font-family: inherit; width: 100%;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
input[type="color"] {
  width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel2); cursor: pointer;
}
button {
  font-family: inherit; font-weight: 600; border: 0; border-radius: 10px;
  padding: 11px 18px; font-size: 14px; cursor: pointer;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  transition: filter .15s, transform .05s, border-color .15s;
}
button:hover { filter: brightness(1.15); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  color: #fff; border: 0; box-shadow: 0 4px 18px rgba(124, 58, 237, .35);
}
button.ghost { background: none; border: 1px solid var(--line); color: var(--muted); }
button.danger { color: var(--err); border-color: #4a2626; }
.icon-btn { padding: 9px 12px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 15px; font-weight: 600; font-size: 13px;
}
.chip.active { border-color: var(--accent); color: var(--accent-soft); background: rgba(124, 58, 237, .12); }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 14px; }
.checks label { display: flex; gap: 7px; align-items: center; cursor: pointer; }

.msg { margin-top: 10px; font-size: 14px; color: var(--muted); min-height: 18px; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 95; background: rgba(4, 6, 10, .72);
  display: grid; place-items: center; padding: 20px; animation: toast-in .15s ease-out;
}
.modal-card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 28px; max-width: 440px; width: 100%;
  text-align: center; box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.modal-card h3 { font-size: 20px; margin-bottom: 10px; }
.modal-card .modal-ico {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--blue));
}
.modal-card .row { margin-top: 20px; }
.modal-card .row button { flex: 1; }
.modal-x {
  position: absolute; top: 10px; right: 10px; background: none; border: 0;
  color: var(--muted); font-size: 16px; padding: 8px 10px;
}

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 18px; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  animation: toast-in .2s ease-out;
}
.toast.err { border-color: #5b2727; color: var(--err); }
.toast.ok { border-color: #1e4d31; color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* =========================================================== landing */
#landing-shell { min-height: 100vh; }
.landing-nav {
  display: flex; align-items: center; gap: 14px; padding: 18px 28px;
  max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand .logo-ico {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--blue)); color: #fff; font-size: 14px;
}
.hero { text-align: center; padding: 72px 20px 40px; max-width: 860px; margin: 0 auto; }
.hero .kicker {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent-soft);
  border: 1px solid rgba(124, 58, 237, .4); background: rgba(124, 58, 237, .08);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 54px); line-height: 1.08;
  background: linear-gradient(180deg, #fff, #b9a8e8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 18px;
}
.hero p { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 auto 34px; line-height: 1.6; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .cta-row button { font-size: 15px; padding: 14px 26px; }
.hero-input {
  display: flex; gap: 10px; max-width: 620px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px; box-shadow: 0 10px 40px rgba(124, 58, 237, .12);
}
.hero-input input { border: 0; background: none; font-size: 15px; flex: 1; }
.hero-input input:focus { box-shadow: none; }
.hero-input button { white-space: nowrap; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 10px; }
.nav-link:hover { color: var(--text); }
.plan-card .plan-price { font-size: 26px; font-weight: 800; margin: 4px 0 2px; }
.plan-card .plan-price span { font-size: 13px; color: var(--muted); font-weight: 500; }
.landing-section { max-width: 1080px; margin: 0 auto; padding: 44px 20px; }
.landing-section h2 { text-align: center; font-size: 28px; margin-bottom: 8px; }
.landing-section .sub { text-align: center; color: var(--muted); margin-bottom: 34px; }

.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 0; }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 40px rgba(124, 58, 237, .18); }
.plan-card .plan-name { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.plan-card .plan-credits { color: var(--accent-soft); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.plan-card ul { list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 14px; color: var(--muted); }
.plan-card ul i { color: var(--accent-soft); width: 18px; margin-right: 6px; }
.plan-tag {
  position: absolute; top: -11px; right: 16px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.landing-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 20px 34px;
  text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6;
}
.landing-footer .notice {
  max-width: 640px; margin: 0 auto 10px; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg2);
}

/* auth */
.auth-card { max-width: 400px; margin: 9vh auto 0; text-align: center; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card input { margin-top: 10px; }
.auth-card .row { margin-top: 16px; }
.auth-card .row button { flex: 1; }

/* =========================================================== app shell */
#app-shell { display: flex; min-height: 100vh; }
#sidebar {
  width: 232px; flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0;
  height: 100vh;
}
#sidebar .brand { padding: 4px 10px 20px; }
#sidebar nav { display: flex; flex-direction: column; gap: 4px; }
#sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500;
  font-size: 14px; transition: background .12s, color .12s;
}
#sidebar nav a i { width: 20px; text-align: center; font-size: 15px; }
#sidebar nav a:hover { background: var(--panel2); color: var(--text); }
#sidebar nav a.active {
  background: rgba(124, 58, 237, .14); color: var(--accent-soft);
  border: 1px solid rgba(124, 58, 237, .35);
}
#sidebar .side-bottom { margin-top: auto; padding: 10px; color: var(--muted); font-size: 12px; }

#app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 26px;
  border-bottom: 1px solid var(--line); background: var(--bg2);
  position: sticky; top: 0; z-index: 20;
}
#credits-badge .credits {
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px;
}
#credits-badge .credits i { color: var(--warn); }
#user-menu { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
#view { padding: 28px 30px 60px; max-width: 1060px; width: 100%; margin: 0 auto; }

/* ---------- dropzone / upload ---------- */
.drop {
  display: block; border: 2px dashed var(--line); border-radius: 12px;
  padding: 38px 16px; text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color .15s;
}
.drop:hover, .drop.armed { border-color: var(--accent); color: var(--text); }
.drop input { display: none; }
.drop .big-ico { font-size: 28px; color: var(--accent-soft); display: block; margin-bottom: 10px; }
.progress-track {
  background: var(--panel2); border-radius: 8px; height: 20px;
  position: relative; overflow: hidden; border: 1px solid var(--line);
}
.progress-fill {
  background: linear-gradient(90deg, var(--accent2), var(--accent)); height: 100%;
  width: 0%; transition: width .2s;
}
.progress-label { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 20px; font-weight: 600; }

/* ---------- tabs / filtros ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600;
  background: none; border: 1px solid var(--line); color: var(--muted);
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- jobs / vídeos gerados ---------- */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.job-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.job-card .jname { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card .jmeta { color: var(--muted); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.job-card video { width: 100%; border-radius: 10px; background: #000; max-height: 300px; }
.status {
  font-size: 12px; padding: 4px 11px; border-radius: 999px; font-weight: 600;
  background: rgba(124, 58, 237, .15); color: var(--accent-soft); align-self: flex-start;
}
.status.done { background: rgba(74, 222, 128, .12); color: var(--ok); }
.status.error { background: rgba(248, 113, 113, .12); color: var(--err); }
.spin { display: inline-block; animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- painel de downloads ---------- */
#downloads-panel {
  position: fixed; right: 18px; bottom: 18px; width: 320px; z-index: 80;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
}
#downloads-panel h4 { font-size: 13px; margin-bottom: 10px; color: var(--muted); }
.dl-item { margin-bottom: 10px; font-size: 12px; }
.dl-item .dl-name { display: flex; justify-content: space-between; margin-bottom: 4px; gap: 8px; }
.dl-item .dl-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- editor ---------- */
.editor-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.video-pick {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin-bottom: 8px;
  background: var(--panel2); transition: border-color .12s;
}
.video-pick:hover { border-color: var(--accent); }
.video-pick.selected { border-color: var(--accent); background: rgba(124, 58, 237, .1); }
.video-pick .vp-ico { color: var(--accent-soft); font-size: 18px; width: 24px; text-align: center; }
.video-pick .vp-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-pick .vp-meta { color: var(--muted); font-size: 12px; }

.aspect-row { display: flex; gap: 14px; align-items: flex-end; }
.aspect-opt { text-align: center; cursor: pointer; }
.aspect-opt .shape {
  border: 2px solid var(--line); border-radius: 6px; background: var(--panel2);
  margin: 0 auto 6px; display: grid; place-items: center; color: var(--muted); font-size: 10px;
  transition: border-color .12s;
}
.aspect-opt.selected .shape { border-color: var(--accent); background: rgba(124, 58, 237, .14); color: var(--accent-soft); }
.aspect-opt .shape.s916 { width: 34px; height: 60px; }
.aspect-opt .shape.s11 { width: 48px; height: 48px; }
.aspect-opt .shape.s169 { width: 64px; height: 36px; }
.aspect-opt .alabel { font-size: 12px; color: var(--muted); font-weight: 600; }
.aspect-opt.selected .alabel { color: var(--accent-soft); }

/* preview do modelo */
.tpl-preview {
  border: 1px solid var(--line); border-radius: 12px; background: #000;
  margin: 0 auto; position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.tpl-preview .p-video { flex: 1; background: linear-gradient(135deg, #1e2735, #11151c); display: grid; place-items: center; color: #3a4657; font-size: 26px; }
.tpl-preview .p-cap {
  position: absolute; left: 8%; right: 8%; text-align: center; font-weight: 800;
  font-size: 12px; color: #fff; text-shadow: 0 1px 4px #000;
}
.tpl-preview .p-card { background: linear-gradient(180deg, #241a45, #16102b); display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #cfc4f5; }

/* ---------- templates ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tpl-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.tpl-card .tname { font-weight: 700; font-size: 15px; }
.tpl-card .tdesc { color: var(--muted); font-size: 13px; flex: 1; }
.tpl-card .row { gap: 8px; }
.tpl-card .row button { flex: 1; padding: 8px 10px; font-size: 13px; }

/* ---------- confirmação de créditos ---------- */
.confirm-card { max-width: 520px; margin: 0 auto; text-align: center; }
.confirm-card .big-num { font-size: 40px; font-weight: 800; color: var(--accent-soft); margin: 6px 0; }
.confirm-stats { display: flex; justify-content: center; gap: 34px; margin: 22px 0; }
.confirm-stats .cs { font-size: 13px; color: var(--muted); }
.confirm-stats .cs b { display: block; font-size: 22px; color: var(--text); margin-bottom: 2px; }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  #sidebar { width: 64px; padding: 18px 8px; }
  #sidebar .brand span, #sidebar nav a span, #sidebar .side-bottom { display: none; }
  #sidebar nav a { justify-content: center; }
  .editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #app-shell { flex-direction: column; }
  #sidebar {
    width: 100%; height: auto; position: fixed; bottom: 0; top: auto; z-index: 50;
    flex-direction: row; border-top: 1px solid var(--line); border-right: 0; padding: 6px;
  }
  #sidebar .brand, #sidebar .side-bottom { display: none; }
  #sidebar nav { flex-direction: row; width: 100%; }
  #sidebar nav a { flex: 1; flex-direction: column; gap: 4px; font-size: 10px; padding: 8px 4px; }
  #sidebar nav a span { display: block; }
  #view { padding: 20px 16px 90px; }
  #downloads-panel { right: 8px; bottom: 74px; width: calc(100% - 16px); }
}
