:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #fff;
  --soft: #f7f8fa;
  --accent: #059669;
  --accent-dark: #047857;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
}

.environment {
  font-size: 13px;
  color: var(--muted);
}

.shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.page-heading {
  margin-bottom: 32px;
}

.page-heading.compact {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.15;
}

.page-heading p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.setup-form {
  display: grid;
  min-width: 0;
  gap: 24px;
}

.theme-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  padding: 0;
  border: 0;
}

.theme-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option-body {
  display: flex;
  min-width: 0;
  min-height: 92px;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.theme-option-body > img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  object-position: top;
  background: #eef1f5;
}

.theme-option-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
}

.theme-option-copy > span {
  font-size: 14px;
  color: var(--muted);
}

.theme-option input:checked + .theme-option-body {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(5 150 105 / 12%);
}

.theme-option input:focus-visible + .theme-option-body {
  outline: 3px solid rgb(5 150 105 / 25%);
  outline-offset: 2px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.inline-button {
  width: auto;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  padding: 24px;
  background: #fff;
  border-radius: 8px;
}

.panel h2 {
  margin: 0 0 20px;
  font-size: 18px;
}

.panel-copy {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.panel form {
  margin-top: 20px;
}

.panel button {
  width: 100%;
}

.credentials {
  display: grid;
  gap: 14px;
  margin: 0;
}

.credentials div {
  display: grid;
  gap: 4px;
}

.credentials dt {
  font-size: 12px;
  color: var(--muted);
}

.credentials dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}

.progress {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #fff;
  border-radius: 8px;
  color: var(--muted);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #d0d5dd;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.stop-form {
  margin-top: 24px;
  text-align: center;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 6px;
  background: #fff;
}

.notice-error {
  color: var(--danger);
}

.error-panel {
  max-width: 620px;
  padding: 32px;
  background: var(--surface);
  border-radius: 8px;
}

.error-panel h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.error-panel > p:not(.eyebrow) {
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.access-panel form {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 40px 0;
  }

  .page-heading h1 {
    font-size: 30px;
  }

  .error-panel {
    padding: 24px;
  }

  .error-panel h1 {
    font-size: 28px;
  }

  .theme-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }
}
