:root {
  --bg: #0a0a0a;
  --surface: #1a1412;
  --elevated: #2a2018;
  --text: #f2f2f0;
  --muted: #787872;
  --secondary: #b3b3af;
  --accent: #c1272d;
  --accent-hover: #d43a3e;
  --border: #2b2420;
  --border-strong: #4a3f35;
  --ok: #3d9b6a;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wrap {
  width: min(100% - 2rem, 720px);
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-decoration: none;
}

.brand img {
  height: 56px;
  width: auto;
}

.brand span {
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.kicker {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}

.lede {
  color: var(--secondary);
  margin-bottom: 2.5rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.tab {
  font: inherit;
  color: var(--secondary);
  background: none;
  border: 1px solid transparent;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  border-radius: 4px;
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.card p,
.hint {
  color: var(--secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.step {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.step-badge {
  position: absolute;
  left: -11px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.script-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  font-style: italic;
  color: var(--secondary);
  margin: 0.75rem 0 0;
}

.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: 4px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.drop-zone strong {
  color: var(--accent);
}

.file-input {
  display: none;
}

.file-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
}

.file-item button {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
}

label.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--secondary);
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.75rem 0.85rem;
}

select {
  min-height: 44px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field-grid {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--secondary);
  line-height: 1.45;
}

.check input {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.workspace {
  position: relative;
}

.workspace.is-locked .tabs,
.workspace.is-locked .panel {
  pointer-events: none;
  opacity: 0.35;
  filter: grayscale(0.4);
}

.workspace-lock {
  display: none;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: rgba(193, 39, 45, 0.08);
  color: var(--secondary);
  font-size: 0.9rem;
}

.workspace.is-locked .workspace-lock {
  display: block;
}

#rights-card.is-complete {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--border));
}

.download-item.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 2px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:disabled {
  background: #475569;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.download-list {
  display: grid;
  gap: 0.65rem;
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  text-decoration: none;
}

.download-item:hover {
  border-color: var(--border-strong);
}

.status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--secondary);
}

.status.is-ok {
  color: var(--ok);
}

.status.is-err {
  color: #ef4444;
}

.success {
  text-align: center;
  padding: 2rem 0;
}

.success .mark {
  font-size: 2.5rem;
  color: var(--ok);
  margin-bottom: 0.75rem;
}

.hidden {
  display: none !important;
}

.note {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: min(100% - 2rem, 520px);
  margin: 0 auto;
  padding: 3rem 0 2rem;
}

.gate__inner .brand img {
  height: 72px;
  width: auto;
}

.gate__form {
  position: sticky;
  bottom: 0;
  padding: 1.25rem 0 0.5rem;
  background: linear-gradient(transparent, var(--bg) 28%);
}

.gate__form .field {
  margin-bottom: 0.5rem;
}

.gate__row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.gate__row input {
  flex: 1;
  min-height: 44px;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.75rem 0.85rem;
}

.gate__row .btn {
  width: auto;
  flex-shrink: 0;
  padding-inline: 1.25rem;
}

.portal.hidden,
.gate.hidden {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
