* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: #0f172a;
  color: #f8fafc;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

.toolbar__brand {
  display: flex;
  align-items: center;
}

.toolbar__title {
  font-size: clamp(18px, 2.6vw, 28px);
  font-weight: 600;
  color: #0f172a;
}

.toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.input-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-error {
  font-size: 12px;
  color: #ef4444;
  display: none;
}

.input-error--show {
  display: block;
}

.input--error {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.input-shake {
  animation: input-shake 0.3s ease;
}

@keyframes input-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-3px);
  }
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.toolbar__group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.toolbar__label {
  font-size: 14px;
  color: #475569;
}

.toolbar__radio {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 14px;
}

.toolbar input[type="number"] {
  width: 72px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.toolbar button {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #2563eb;
  background: #1d4ed8;
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}

.toolbar button:hover {
  background: #2563eb;
}

.toolbar button:active {
  transform: scale(0.98);
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 48px;
  gap: 16px;
  outline: none;
}

.slide {
  width: min(1100px, 90vw);
  aspect-ratio: 16 / 9;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.45);
}

.slide__text {
  font-size: clamp(28px, 6vw, 72px);
  font-weight: 600;
  text-align: center;
  padding: 24px;
  z-index: 1;
}

.slide__image {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.5);
}

.slide__logo {
  position: absolute;
  right: 24px;
  bottom: 18px;
  height: 21px;
  width: auto;
  opacity: 0.9;
  pointer-events: none;
}

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
  color: #cbd5f5;
}

.action-button {
  position: relative;
  overflow: hidden;
}

.action-button__label {
  position: relative;
  z-index: 1;
}

.action-button__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.28);
  transition: width 0.2s ease;
}

.toolbar__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.toolbar__logo img,
.toolbar__logo-img {
  height: 19px;
  width: auto;
  min-width: 48px;
  display: block;
  object-fit: contain;
}

/* Белый логотип на светлом фоне шапки не виден — инвертируем для контраста */
.toolbar__logo img,
.toolbar__logo-img {
  filter: invert(1);
}

.toolbar__logo-caption {
  font-size: 12px;
  color: #64748b;
}

.nav button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  cursor: pointer;
}

.nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden-render {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1280px;
  height: 720px;
}

.hidden-render .slide {
  width: 1280px;
  height: 720px;
  border-radius: 0;
  box-shadow: none;
}

.hidden-render .slide__logo {
  height: 24px;
}

body.fullscreen .toolbar,
body.fullscreen .nav {
  display: none;
}

body.fullscreen .stage {
  padding: 0;
  min-height: 100vh;
  justify-content: center;
}

body.fullscreen .slide {
  width: 100vw;
  max-width: none;
  height: 100vh;
  border-radius: 0;
  border: none;
}
