:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0b0b0c;
  --panel-strong: #101012;
  --line: #232327;
  --line-soft: #1a1a1d;
  --text: #f4f4f2;
  --muted: #97979d;
  --accent: #7c3aed;
  --accent-strong: #8b5cf6;
  --danger: #ff6b6b;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 56px 20px 40px;
  background:
    radial-gradient(1100px 600px at 50% -20%, rgba(124, 58, 237, 0.11), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.masthead {
  margin-bottom: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.card {
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 650;
}

h2 {
  font-size: 20px;
  font-weight: 620;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.password-field {
  margin-top: 14px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #080809;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder {
  color: #606066;
}

input:hover,
select:hover {
  border-color: #34343a;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.form-row .primary {
  min-width: 132px;
}

.custom-size {
  max-width: 130px;
}

.primary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border-radius: 11px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.primary:active:not(:disabled) {
  transform: translateY(1px);
}

.primary:disabled {
  cursor: progress;
  opacity: 0.55;
}

.ghost {
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.ghost:hover {
  border-color: #3a3a40;
  background: #141416;
}

.error {
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 107, 107, 0.28);
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.07);
  color: var(--danger);
  font-size: 14px;
}

.progress-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.progress-head {
  display: flex;
  min-width: 180px;
  flex: 1;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

#percent {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar {
  width: min(320px, 40vw);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #1b1b1f;
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 240ms ease;
}

.progress-card .ghost {
  flex: none;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.result-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.result-actions .ghost {
  flex: none;
  white-space: nowrap;
}

video {
  display: block;
  width: 100%;
  max-height: 68vh;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #000;
}

.footnote {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 620px) {
  body {
    padding-top: 32px;
  }

  .card {
    padding: 18px;
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-row .primary {
    width: 100%;
  }

  .custom-size {
    max-width: none;
  }

  .progress-card {
    flex-wrap: wrap;
    gap: 14px;
  }

  .progress-head {
    flex-basis: 100%;
    min-width: 0;
  }

  .bar {
    width: 100%;
    flex: 1;
  }

  .result-head {
    flex-direction: column;
    gap: 14px;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions .ghost {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
