:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --panel-soft: #fafafa;
  --ink: #121417;
  --muted: #6b7280;
  --line: #e4e7eb;
  --line-strong: #cfd5dd;
  --accent: #c6ff3d;
  --accent-ink: #1f2908;
  --dark: #0f1114;
  --focus: rgba(45, 112, 255, 0.18);
  --shadow: 0 16px 40px rgba(15, 17, 20, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  border-right: 1px solid #1e2329;
  background: var(--dark);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 6px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: #9ca3af;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  color: #c7ccd3;
  text-decoration: none;
  padding: 10px 11px;
  border-radius: 6px;
  font-size: 0.94rem;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.status-card {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #d1d5db;
}

.status-row strong {
  color: var(--accent);
}

.status-card p {
  margin: 0;
  color: #9ca3af;
  font-size: 0.85rem;
  line-height: 1.4;
}

.progress-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.content {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 26px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 22px 0 20px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
}

.button.primary {
  background: var(--dark);
  color: #fff;
}

.button.secondary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.button:hover {
  border-color: var(--line-strong);
}

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

.workflow-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workflow-status {
  display: grid;
  gap: 9px;
}

.workflow-status > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.workflow-status span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.workflow-status strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.step-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.step-nav button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.step-nav button:hover,
.step-nav button:focus-visible,
.step-nav button.active {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
  outline: none;
}

.brief-form {
  display: grid;
  gap: 14px;
}

.section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  scroll-margin-top: 22px;
}

.section:not(.is-active) {
  display: none;
}

.section.is-active {
  animation: sectionIn 0.18s ease-out;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 20px;
}

.section-heading > span {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 900;
}

.section-heading h2 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.grid {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #252a31;
  font-size: 0.9rem;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: #252a31;
  font-size: 0.9rem;
  font-weight: 800;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wide {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2d70ff;
  box-shadow: 0 0 0 4px var(--focus);
}

input.invalid,
textarea.invalid,
select.invalid {
  border-color: #d92d20;
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12);
}

.field-error {
  color: #b42318;
  font-size: 0.78rem;
  font-weight: 700;
}

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

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.multi-select {
  position: relative;
}

.multi-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  list-style: none;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary i {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}

.multi-select[open] summary {
  border-color: #2d70ff;
  box-shadow: 0 0 0 4px var(--focus);
}

.multi-select-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.multi-select-panel label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 8px;
  border-radius: 6px;
  background: var(--panel-soft);
  font-weight: 700;
}

.multi-select-panel input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: var(--dark);
}

.multi-select-panel .other-page {
  display: grid;
  align-items: stretch;
}

.multi-select-panel .other-page input {
  margin-top: 6px;
}

.audience-list {
  display: grid;
  gap: 8px;
}

.audience-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.audience-row label {
  font-size: 0.78rem;
}

.checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.checks legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: #252a31;
  font-weight: 900;
}

.checks label,
.consent {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  font-weight: 700;
}

.checks input,
.consent input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: var(--dark);
}

.no-website-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted, #6b7280);
  cursor: pointer;
  user-select: none;
}

.no-website-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  accent-color: var(--dark);
}

#currentWebsite:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--panel-soft);
}

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

.asset-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.asset-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.asset-icon {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--dark);
  color: var(--accent);
  font-weight: 900;
}

.asset-head h3 {
  margin-bottom: 1px;
  font-size: 1rem;
}

.asset-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.dropzone {
  min-height: 150px;
  place-items: center;
  text-align: center;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.dropzone.dragover,
.asset-block.dragover .dropzone {
  border-color: #2d70ff;
  background: #f4f8ff;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.dropzone strong {
  font-size: 0.95rem;
}

.dropzone small {
  max-width: 260px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.attachment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.attachment {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.attachment-preview {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #eef1f4;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-meta {
  min-width: 0;
}

.attachment-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.attachment-meta small {
  color: var(--muted);
  font-size: 0.76rem;
}

.attachment .button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.consent {
  margin-top: 16px;
  align-items: flex-start;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.thankyou-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 100vh;
  padding: 48px 24px;
  text-align: center;
}

[data-sent] .app-header,
[data-sent] .workflow-panel,
[data-sent] .brief-form {
  display: none;
}

[data-sent] .thankyou-screen {
  display: flex;
  animation: sectionIn 0.3s ease-out;
}

.thankyou-icon {
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 2rem;
  font-weight: 900;
}

.thankyou-screen h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.thankyou-screen > p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.thankyou-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.thankyou-chip {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(390px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .status-card {
    margin-top: 0;
  }

  .app-header,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .step-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .content,
  .section {
    padding: 16px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .nav,
  .grid.two,
  .checks,
  .step-nav {
    grid-template-columns: 1fr;
  }

  .attachment {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .attachment .button {
    grid-column: 1 / -1;
  }

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

  .multi-select-panel {
    position: static;
    margin-top: 6px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .actions,
  .toast {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .content {
    width: 100%;
    padding: 0;
  }

  .section,
  .workflow-panel {
    box-shadow: none;
    break-inside: avoid;
  }
}
