:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #e8eaef;
  --muted: #9aa3b5;
  --accent: #5b8cff;
  --accent-dim: #3d5fb8;
  --danger: #ff6b6b;
  --ok: #5bd39a;
  --border: #2a3140;
  font-family: "SF Pro Text", system-ui, -apple-system, Segoe UI, Roboto,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, #1c2440 0%, var(--bg) 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.head h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lead code {
  font-size: 0.85em;
  background: var(--panel);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.label {
  font-weight: 600;
  font-size: 0.9rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.2);
}

textarea {
  resize: vertical;
  min-height: 160px;
}

.generate {
  margin-top: 0.5rem;
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 1.15rem 1.5rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dim) 100%);
  box-shadow: 0 12px 40px rgba(91, 140, 255, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.generate:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.generate:active:not(:disabled) {
  transform: translateY(0);
}

.generate:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.status {
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.95rem;
}

.status[data-kind="error"] {
  border-color: rgba(255, 107, 107, 0.45);
  color: #ffc9c9;
}

.status[data-kind="ok"] {
  border-color: rgba(91, 211, 154, 0.45);
  color: #c8f5de;
}

.status code {
  font-size: 0.88em;
  word-break: break-all;
}

.result-link {
  margin: 1rem 0 0;
}

.result-link a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.result-link a:hover {
  text-decoration: underline;
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.15em;
  margin-right: 0.35em;
}

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