:root {
  --bg-top: #0f172a;
  --bg-bottom: #111827;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-border: rgba(148, 163, 184, 0.22);
  --text: #0f172a;
  --muted: #475569;
  --accent: #1d4ed8;
  --accent-strong: #1e3a8a;
  --accent-soft: rgba(29, 78, 216, 0.14);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.28);
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 28px 64px;
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", sans-serif;
  color: #e2e8f0;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), transparent 30%),
    radial-gradient(circle at right 20%, rgba(37, 99, 235, 0.18), transparent 28%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 26px;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #f8fafc;
  text-wrap: balance;
}

.app-layout {
  display: flex;
  gap: 28px;
  align-items: start;
  justify-content: flex-start;
}

.form-column {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 860px;
}

.form-column h1 {
  margin-bottom: 22px;
}

h2 {
  margin: 0 0 22px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

h3 {
  margin: 28px 0 14px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

p {
  margin: 14px 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.workflow-preview {
  flex: 0 0 420px;
  width: 420px;
  position: sticky;
  top: 32px;
  align-self: start;
  margin-top: 0;
}

.workflow-preview-window {
  display: block;
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(241, 245, 249, 0.95));
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.26);
}

.workflow-preview-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.workflow-preview-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.55);
}

.workflow-preview-panel {
  padding: 22px;
  margin-bottom: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.workflow-preview-panel h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 2.8vw, 2.5rem);
  line-height: 1.02;
}

.workflow-preview-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.workflow-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workflow-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.workflow-chip-active {
  background: rgba(29, 78, 216, 0.12);
  color: var(--accent);
}

.workflow-preview-list {
  display: grid;
  gap: 12px;
}

.workflow-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  color: var(--text);
}

.workflow-preview-item strong {
  font-size: 1.02rem;
}

.workflow-preview-item span,
.workflow-preview-item strong {
  color: var(--text);
}

.step {
  display: none;
  padding: 28px;
  margin-bottom: 22px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-lg);
}

.step.active {
  display: block;
}

.step-top-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.field {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease,
    transform 160ms ease;
}

input:hover,
select:hover,
textarea:hover {
  background: #ffffff;
  border-color: rgba(15, 118, 110, 0.35);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding-top: 6px;
}

.buttons > div {
  flex: 1;
}

button {
  min-width: 132px;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #eff6ff;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.link-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.22);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 16px 28px rgba(29, 78, 216, 0.3);
}

button:active {
  transform: translateY(0);
}

button:focus-visible {
  outline: 3px solid rgba(226, 232, 240, 0.55);
  outline-offset: 3px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
}

.icon-button[disabled] {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.45;
  box-shadow: none;
}

.icon-button[disabled]:hover {
  transform: none;
  filter: grayscale(0.2);
  box-shadow: none;
}

@media (max-width: 1100px) {
  .app-layout {
    flex-direction: column;
  }

  .workflow-preview {
    position: static;
    width: 100%;
    flex-basis: auto;
    order: -1;
  }

  .form-column {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 700px) {
  body {
    padding: 28px 14px 40px;
  }

  body::before {
    inset: 10px;
    border-radius: 22px;
  }

  .step {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .workflow-preview-window {
    padding: 16px;
    border-radius: 24px;
  }

  .workflow-preview-panel,
  .workflow-preview-item {
    padding: 16px;
  }

  .workflow-preview-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions {
    justify-content: stretch;
  }

  .link-button {
    width: 100%;
  }

  .buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .buttons > div {
    display: none;
  }

  button {
    width: 100%;
  }
}
