html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #18202b;
  background:
    radial-gradient(circle at 18% 8%, rgba(239, 68, 68, 0.12), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(0, 119, 255, 0.14), transparent 30%),
    linear-gradient(135deg, #f7f9fc 0%, #edf3f8 48%, #f6f4ef 100%);
}

.app-nav {
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: 0;
}

.nav-link {
  color: #384252;
  font-weight: 600;
}

main {
  min-height: calc(100vh - 128px);
}

.download-hero {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 22px;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin-bottom: 10px;
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  font-weight: 900;
  line-height: 1.02;
}

.hero-copy p:last-child {
  max-width: 700px;
  margin-bottom: 0;
  color: #526071;
  font-size: 1.08rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
  align-items: start;
}

.download-panel,
.status-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.download-panel {
  padding: 28px;
}

.cli-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 22px;
  border: 1px solid rgba(20, 184, 166, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(18, 34, 47, 0.96)),
    #101827;
  color: #f8fafc;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.cli-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.cli-heading strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 1.15rem;
}

.cli-heading p,
.cli-note {
  margin: 0;
  color: #b7c3d1;
}

.cli-badge {
  display: inline-grid;
  min-width: 44px;
  min-height: 28px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(209, 250, 229, 0.28);
  border-radius: 8px;
  color: #d1fae5;
  background: rgba(15, 118, 110, 0.32);
  font-size: 0.78rem;
  font-weight: 900;
}

.cli-panel .cli-command {
  display: block;
  width: 100% !important;
  min-height: clamp(260px, 42vh, 520px);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(2, 6, 23, 0.96)),
    #0b1220;
  color: #d1fae5;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  resize: both;
  white-space: pre-wrap;
  overflow: auto;
  caret-color: #d1fae5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.cli-panel .cli-command:focus {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
  border-color: #14b8a6;
  box-shadow:
    0 0 0 4px rgba(20, 184, 166, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.cli-note code {
  color: #d1fae5;
}

.download-form {
  display: grid;
  gap: 22px;
}

.section-title {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}

.section-title > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #0f766e;
  font-weight: 800;
}

.section-title h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
}

.section-title p {
  margin: 0;
  color: #647184;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.platform-option,
.format-option {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 112px;
  padding: 15px;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.platform-option:hover,
.format-option:hover {
  transform: translateY(-1px);
}

.platform-option input,
.format-option input {
  position: absolute;
  inset: 12px 12px auto auto;
  width: 18px;
  height: 18px;
  accent-color: #0f766e;
}

.platform-option:has(input:checked),
.format-option:has(input:checked) {
  border-color: #0f766e;
  background: #f0fdfa;
}

.platform-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 900;
}

.platform-auto .platform-mark {
  background: #0f766e;
}

.platform-youtube .platform-mark {
  background: #dc2626;
}

.platform-vk .platform-mark {
  background: #0077ff;
}

.platform-ok .platform-mark {
  background: #ee8208;
}

.platform-option span:last-child,
.format-option span,
.platform-option strong,
.platform-option small,
.format-option strong,
.format-option small {
  display: block;
}

.platform-option small,
.format-option small {
  margin-top: 4px;
  color: #637083;
  line-height: 1.3;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  color: #243041;
  font-weight: 800;
}

.form-control {
  min-height: 52px;
  border-color: #c9d3df;
  border-radius: 8px;
}

.form-control:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.18);
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.format-option {
  grid-template-columns: 1fr;
  min-height: 96px;
}

.download-button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: #0f766e;
  font-weight: 800;
}

.download-button:hover,
.download-button:focus {
  background: #115e59;
}

.progress-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  background: #f8fafc;
}

.progress-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #243041;
}

.progress-topline span {
  font-weight: 800;
  white-space: nowrap;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe5ef;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #0077ff);
  transition: width 220ms ease;
}

.progress-fill-pulse {
  animation: progressPulse 1.2s ease-in-out infinite alternate;
}

.progress-fill-error {
  background: #dc2626;
}

.progress-panel p {
  margin: 0;
  color: #536174;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.download-ready {
  justify-self: start;
  border-radius: 8px;
  font-weight: 800;
}

.status-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.status-card {
  padding: 20px;
}

.status-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1rem;
}

.status-card p,
.status-card ul {
  margin: 0;
  color: #536174;
}

.status-card ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.status-card code {
  color: #0f766e;
}

.alert {
  border-radius: 8px;
}

.footer {
  padding: 20px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .status-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .download-hero {
    padding-top: 32px;
  }

  .workspace,
  .platform-grid,
  .format-grid,
  .status-panel {
    grid-template-columns: 1fr;
  }

  .download-panel {
    padding: 20px;
  }

  .cli-panel {
    padding: 18px;
  }

  .cli-panel .cli-command {
    min-height: 360px;
    font-size: 0.84rem;
    resize: vertical;
  }
}

@keyframes progressPulse {
  from {
    opacity: 0.45;
  }

  to {
    opacity: 1;
  }
}
