:root {
  --bg-color: #0b0c10;
  --bg-elevated: #14151f;
  --accent: #ff4d6a;
  --accent-soft: rgba(255, 77, 106, 0.18);
  --border-color: #2a2b3b;
  --text-main: #f5f5f7;
  --text-muted: #a0a3b1;
  --field-bg: #1c1d29;
  --radius: 8px;
  --shadow-soft: 0 18px 30px rgba(0, 0, 0, 0.35);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #17182a 0, #05060a 55%);
  color: var(--text-main);
  font-family: var(--font-main);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1.5rem 1.5rem 0.5rem;
  text-align: center;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.8rem;
  letter-spacing: 0.03em;
}

header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr);
  gap: 1.25rem;
  padding: 1.25rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

section {
  background: linear-gradient(145deg, #111320, #111118);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-soft);
}

.form-section {
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

.output-section {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-block {
  border-radius: 14px;
  padding: 0.8rem 0.9rem 0.9rem;
  margin-bottom: 0.8rem;
  background: radial-gradient(circle at top left, #202237 0, #111118 55%);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.section-block h2 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.45rem;
}

.field-group label {
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  color: var(--text-muted);
}

input,
select,
textarea {
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--field-bg);
  color: var(--text-main);
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #62657a;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
  background: #232438;
}

textarea {
  resize: vertical;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.buttons-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

button {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: #1b1c28;
  color: var(--text-main);
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

button:hover {
  background: #222437;
  transform: translateY(-1px);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 77, 106, 0.35);
}

button.primary:hover {
  background: #ff617b;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.output-block {
  background: radial-gradient(circle at top right, #1f2135 0, #101018 55%);
  border-radius: 14px;
  padding: 0.7rem 0.8rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-height: 0;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.output-header h2 {
  margin: 0;
  font-size: 1rem;
}

.output-box {
  margin: 0;
  padding: 0.6rem;
  border-radius: 10px;
  background: #05060b;
  border: 1px solid #232437;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 45vh;
  overflow: auto;
}

.copy-message {
  min-height: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.1rem;
}

footer {
  padding: 0.5rem 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Responsive */

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-section {
    max-height: none;
  }
}

@media (max-width: 600px) {
  header h1 {
    font-size: 1.5rem;
  }

  main {
    padding: 0.8rem;
  }

  .two-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}
