:root {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: #0c0d12;
  color: #eef0f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #1f2233 0%, #0c0d12 45%, #090a0f 100%);
}

.page {
  min-height: 100vh;
  padding: 48px 8vw 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

.badge {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  background: #292d44;
  color: #c8cfe9;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(2.2rem, 3vw, 3.4rem);
  margin: 0 0 12px;
}

.subtitle {
  font-size: 1.1rem;
  color: #c3c7da;
  max-width: 480px;
}

.disclaimer {
  font-size: 0.9rem;
  color: #f2b8b5;
  margin-top: 18px;
  background: rgba(222, 84, 74, 0.1);
  padding: 12px 14px;
  border-radius: 10px;
}

.preview-card {
  background: #151826;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid #2a2f45;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.preview-title {
  font-weight: 600;
  margin-bottom: 16px;
}

.preview-area {
  position: relative;
  background: linear-gradient(135deg, #262b40 0%, #141725 100%);
  border-radius: 16px;
  height: 200px;
  overflow: hidden;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
  mix-blend-mode: screen;
}

.preview-node {
  position: absolute;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(96, 144, 255, 0.2);
  border: 1px solid #5a6cc7;
}

.preview-node.start {
  right: 14px;
  top: 14px;
}

.preview-node.mid {
  left: 11%;
  top: 57%;
}

.preview-node.end {
  right: 14px;
  bottom: 14px;
}

.preview-caption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #aab1ca;
}

.content {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel {
  background: rgba(16, 18, 28, 0.85);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid #23263a;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel h2 {
  margin: 0;
  font-size: 1.2rem;
}

.upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px dashed #3a3f59;
  border-radius: 14px;
  cursor: pointer;
}

.upload input {
  display: none;
}

.upload-label {
  font-weight: 600;
}

.upload-meta {
  font-size: 0.9rem;
  color: #9da4c1;
}

.video-wrapper {
  position: relative;
  background: #0a0b12;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #1f2234;
}

.video-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 10;
}

#pathCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.handle {
  position: absolute;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  background: rgba(108, 123, 216, 0.3);
  border: 2px solid #6c7bd8;
  border-radius: 4px;
  cursor: grab;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0;
}

.handle:hover {
  background: rgba(108, 123, 216, 0.5);
  z-index: 11;
}

.handle.active,
.handle:active {
  cursor: grabbing;
  background: rgba(108, 123, 216, 0.7);
  border-color: #fff;
  z-index: 12;
}

.handle::after {
  content: attr(data-point);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: #292d44;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  text-transform: capitalize;
}

.handle:hover::after,
.handle:active::after {
  opacity: 1;
}

video {
  width: 100%;
  border-radius: 10px;
  background: #05060a;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.path-point {
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid #2d3148;
  background: #161a2b;
  color: inherit;
  cursor: pointer;
}

.path-point.active {
  border-color: #6c7bd8;
  box-shadow: 0 0 0 2px rgba(108, 123, 216, 0.3);
}

.path-values {
  font-size: 0.9rem;
  color: #adb3cd;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: 160px 1fr 60px;
  gap: 12px;
  align-items: center;
}

.form-row select {
  background: #111421;
  border: 1px solid #2c3148;
  color: #eef0f4;
  padding: 8px 10px;
  border-radius: 10px;
}

.helper {
  font-size: 0.85rem;
  color: #9da4c1;
}

.processing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.progress-status {
  margin: 0;
  font-size: 0.95rem;
  color: #aab1ca;
  min-height: 1.2em;
}

input[type="range"] {
  accent-color: #6c7bd8;
}

.primary {
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(120deg, #4c5bd6, #8a5df3);
  color: white;
  font-weight: 600;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.secondary {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #3a3f59;
  background: transparent;
  color: #c3c7da;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.2s ease;
}

.processing-actions .secondary {
  margin-top: 0;
}

.secondary:hover {
  border-color: #6c7bd8;
  color: #eef0f4;
  background: rgba(108, 123, 216, 0.1);
}

.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #3a3f59;
  color: #9da4c1;
}

.hint {
  font-size: 0.85rem;
  color: #9fa6c4;
}

@media (max-width: 720px) {
  .page {
    padding: 32px 6vw 60px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}

.mode-selector {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mode-selector label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #c3c7da;
  white-space: nowrap;
}

.mode-selector input[type="radio"] {
  accent-color: #6c7bd8;
  margin: 0;
  width: 16px;
  height: 16px;
}

.resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #292d44;
  border: 2px solid #6c7bd8;
  border-radius: 50%;
  cursor: nwse-resize;
  pointer-events: auto;
  z-index: 20;
  transition: transform 0.1s;
}

.resize-handle:hover {
  transform: scale(1.2);
  background: #6c7bd8;
}

.dimension-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dimension-inputs input {
  width: 60px;
  background: #161a2b;
  border: 1px solid #3a3f59;
  border-radius: 6px;
  color: white;
  padding: 4px 8px;
  font-size: 0.9rem;
}

.dimension-inputs span {
  font-size: 0.85rem;
  color: #9da4c1;
}
