@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4f7fb;
  --ink: #152238;
  --muted: #4d607f;
  --card: #ffffff;
  --line: #d5dfef;
  --accent: #0a7a5c;
  --accent-2: #1448b8;
  --danger: #ba1a1a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 100% 0%, rgba(20, 72, 184, 0.08), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(10, 122, 92, 0.08), transparent 35%),
    var(--bg);
  color: var(--ink);
}

.shell {
  width: min(1100px, 92vw);
  margin: 30px auto 48px;
}

.hero {
  background: linear-gradient(125deg, #112a5e, #133a79 60%, #0a7a5c);
  border-radius: 18px;
  color: white;
  padding: 24px 26px;
  box-shadow: 0 10px 30px rgba(20, 40, 90, 0.25);
}

.hero h1 {
  margin: 6px 0 8px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  opacity: 0.9;
}

.sub {
  margin: 0;
  opacity: 0.92;
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 14px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(20, 40, 90, 0.06);
}

.step h2 {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 1.1rem;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

select,
input[type="text"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="email"],
input[type="url"],
input[type="password"],
button,
textarea {
  font: inherit;
}

select,
input[type="text"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="email"],
input[type="url"],
input[type="password"] {
  min-width: 300px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--accent-2);
  color: white;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.05);
}

.status {
  color: var(--muted);
  font-size: 0.95rem;
}

.code {
  white-space: pre-wrap;
  background: #0f1728;
  color: #b9caf2;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  font-size: 0.85rem;
  max-height: 280px;
  overflow: auto;
}

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

.module-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  position: relative;
}

.module-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.module-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.help-wrap {
  position: relative;
}

.help-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  background: #1f4aa6;
}

.help-tip {
  position: absolute;
  top: 30px;
  right: 0;
  width: min(360px, 76vw);
  background: #0f1728;
  color: #d4def2;
  border: 1px solid #2b3c64;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  z-index: 20;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.help-wrap:hover .help-tip,
.help-wrap:focus-within .help-tip {
  opacity: 1;
  transform: translateY(0);
}

.module-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.module-picker {
  margin-top: 12px;
  margin-bottom: 10px;
}

.module-picker p {
  margin: 0 0 8px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.checkbox-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-height: 30px;
  font-size: 0.9rem;
  cursor: pointer;
  overflow: hidden;
}

.checkbox-item input[type="checkbox"] {
  margin: 0;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  align-self: center;
}

.checkbox-item span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  text-align: center;
}

.config-row {
  margin-top: 10px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.upload-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.slot-title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 0.92rem;
}

.dropzone {
  border: 2px dashed #9eb3da;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  color: var(--muted);
  background: #f9fbff;
  cursor: pointer;
  transition: all 120ms ease;
}

.dropzone.active {
  border-color: var(--accent-2);
  background: #edf3ff;
  color: #173669;
}

.slot-status {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-word;
}

.slot-status.ok {
  color: #0a7a5c;
}

.slot-status.fail {
  color: var(--danger);
}

.validation-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.validation-item {
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.validation-item.ok {
  border-left-color: var(--accent);
}

.validation-item.fail {
  border-left-color: var(--danger);
}

.editor-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(to right, #f3f6fb 52px, #ffffff 52px);
  display: grid;
  grid-template-columns: 52px 1fr;
  overflow: hidden;
  height: 460px;
}

.line-numbers {
  margin: 0;
  padding: 10px 6px;
  height: auto;
  min-height: 100%;
  background: #f3f6fb;
  color: #6c7b98;
  text-align: right;
  font-size: 0.9rem;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
  user-select: none;
  overflow: visible;
  white-space: pre;
  transform: translateY(0px);
}

textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin-top: 0;
  border-radius: 0;
  border: 0;
  padding: 10px;
  background: #ffffff;
  color: #142541;
  line-height: 1.5;
  resize: none;
  overflow: auto;
  font-size: 0.9rem;
  font-family: Consolas, "Courier New", monospace;
  tab-size: 2;
}

textarea.json-valid {
  box-shadow: inset 0 0 0 2px rgba(10, 122, 92, 0.35);
}

textarea.json-invalid {
  box-shadow: inset 0 0 0 2px rgba(186, 26, 26, 0.35);
}

.json-validation {
  margin-top: 8px;
  font-size: 0.85rem;
}

.json-validation.neutral {
  color: var(--muted);
}

.json-validation.valid {
  color: #0a7a5c;
  font-weight: 600;
}

.json-validation.invalid {
  color: #ba1a1a;
  font-weight: 600;
}

.subtle {
  margin-top: 0;
  color: var(--muted);
}

code {
  background: #e8edf7;
  border-radius: 5px;
  padding: 1px 4px;
}

@media (max-width: 720px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  select {
    min-width: 0;
    width: 100%;
  }

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

@media (max-width: 520px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}
