:root {
  --purple-900: #3b1d6e;
  --purple-700: #6d28d9;
  --purple-600: #7c3aed;
  --purple-100: #f3e8ff;
  --purple-50: #faf5ff;
  --white: #ffffff;
  --text: #2e1a47;
  --muted: #6b5b80;
  --error: #b42318;
  --error-bg: #fff1f0;
  --success: #067647;
  --success-bg: #ecfdf3;
  --shadow: 0 16px 40px rgba(109, 40, 217, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, #e9d5ff 0%, transparent 42%),
    linear-gradient(180deg, var(--purple-50) 0%, var(--white) 100%);
}

.page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 48px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--purple-700);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  color: var(--purple-900);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
}

.subtitle {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.card {
  background: var(--white);
  border: 1px solid #e9d8fd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.editor-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--purple-900);
}

.editor {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #ddc8f5;
  border-radius: 14px;
  background: #fdfbff;
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.98rem;
  line-height: 1.55;
}

.editor:focus {
  outline: 3px solid #d8b4fe;
  border-color: var(--purple-600);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: var(--white);
  background: var(--purple-700);
  box-shadow: 0 8px 18px rgba(109, 40, 217, 0.28);
}

.btn-primary:hover {
  background: var(--purple-600);
}

.btn-secondary {
  color: var(--purple-700);
  background: var(--purple-100);
}

.btn-ghost {
  color: var(--purple-900);
  background: var(--white);
  border: 1px solid #e4d4f5;
}

.status {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.status.error {
  color: var(--error);
  background: var(--error-bg);
  border-radius: 10px;
  padding: 10px 12px;
}

.status.success {
  color: var(--success);
  background: var(--success-bg);
  border-radius: 10px;
  padding: 10px 12px;
}

.info-section {
  margin-top: 24px;
  background: var(--white);
  border: 1px solid #e9d8fd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.info-section h2 {
  margin: 0 0 12px;
  color: var(--purple-900);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.3;
}

.info-section p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.how-to-section {
  margin-top: 24px;
}

.how-to-section h2 {
  margin: 0 0 16px;
  color: var(--purple-900);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.3;
}

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

.step-card {
  background: var(--white);
  border: 1px solid #e9d8fd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.step-card h3 {
  margin: 0 0 8px;
  color: var(--purple-700);
  font-size: 1.05rem;
  line-height: 1.4;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 24px, 920px);
    padding: 24px 0 36px;
  }

  .card,
  .info-section {
    padding: 16px;
  }

  .editor {
    min-height: 240px;
  }

  .btn {
    width: 100%;
  }

  .step-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    padding: 16px;
  }
}
