@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:wght@300;400;500&display=swap");
:root {
  --bg: #0d0d0f;
  --surface: #16161a;
  --surface2: #1e1e24;
  --border: #2a2a35;
  --accent: #6c63ff;
  --accent2: #ff6584;
  --text: #e8e8f0;
  --muted: #6b6b80;
  --success: #4ade80;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Mono", monospace;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(108, 99, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 99, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
.wrapper {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
header {
  margin-bottom: 56px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 0 32px rgba(108, 99, 255, 0.3);
}
h1 {
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #e8e8f0 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
  letter-spacing: 0.05em;
}
.steps {
  display: flex;
  gap: 4px;
  margin-bottom: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
}
.step-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.step-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 16px rgba(108, 99, 255, 0.4);
}
.step-btn span {
  display: block;
  font-size: 1.1em;
  margin-bottom: 2px;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
}
.card-title {
  font-family: "Syne", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.field {
  margin-bottom: 18px;
}
label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}
input[type="text"],
input[type="date"],
textarea,
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: "DM Mono", monospace;
  font-size: 0.85rem;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.section-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 12px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section-num {
  background: var(--accent);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}
.section-title-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: "DM Mono", monospace;
  font-size: 0.82rem;
  outline: none;
}
.section-title-input:focus {
  border-color: var(--accent);
}
.btn-remove {
  background: none;
  border: 1px solid #3a2a2a;
  color: #ff6584;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-remove:hover {
  background: rgba(255, 101, 132, 0.1);
}
.img-drop {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
  position: relative;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-drop:hover,
.img-drop.dragover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.05);
}
.img-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: none;
  background: none;
  padding: 0;
}
.img-drop p {
  color: var(--muted);
  font-size: 0.75rem;
  pointer-events: none;
}
.img-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.img-thumb {
  position: relative;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-thumb .del-img {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-add {
  background: transparent;
  border: 1px dashed var(--accent);
  color: var(--accent);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
  width: 100%;
  transition: all 0.2s;
  margin-top: 4px;
}
.btn-add:hover {
  background: rgba(108, 99, 255, 0.1);
}
.btn-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 0.82rem;
  transition: all 0.2s;
}
.btn-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-generate {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  color: white;
  padding: 16px 40px;
  border-radius: 10px;
  cursor: pointer;
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  box-shadow: 0 0 32px rgba(108, 99, 255, 0.3);
  width: 100%;
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(108, 99, 255, 0.5);
}
.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}
#preview-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}
.preview-field {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.preview-field:last-child {
  border-bottom: none;
}
.preview-field .k {
  color: var(--muted);
}
.preview-field .v {
  color: var(--text);
  text-align: right;
  max-width: 60%;
}
.preview-section {
  background: var(--surface2);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 6px 0;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.preview-section .badge {
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 4px;
}
#toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--success);
  color: #0d0d0f;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 999;
}
#toast.show {
  transform: translateY(0);
  opacity: 1;
}
.loading {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 540px) {
  .row2 {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 1.5rem;
  }
}
