:root {
  --bg-main: #f4f0e7;
  --bg-card: #fffdf9;
  --ink: #1f2a37;
  --ink-muted: #5a6470;
  --accent: #0c7c73;
  --accent-strong: #095951;
  --accent-soft: #d8f2ee;
  --line: #d8ddd6;
  --danger: #9b1d20;
  --shadow: 0 16px 45px rgba(27, 42, 57, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #e8f7f4 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, #f6e6d2 0%, transparent 35%),
    var(--bg-main);
}

.background-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.28;
  animation: drift 11s ease-in-out infinite;
}

.shape-a {
  width: 38vw;
  height: 38vw;
  min-width: 220px;
  min-height: 220px;
  background: linear-gradient(145deg, #26a69a, #70c1b3);
  top: -12vw;
  right: -8vw;
}

.shape-b {
  width: 30vw;
  height: 30vw;
  min-width: 180px;
  min-height: 180px;
  background: linear-gradient(145deg, #ffd9a0, #ffb77d);
  bottom: -10vw;
  left: -6vw;
  animation-delay: 1.6s;
}

@keyframes drift {
  0% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(14px) rotate(4deg);
  }

  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.page {
  width: min(1080px, 92vw);
  margin: 2.5rem auto 4rem;
  display: grid;
  gap: 1.25rem;
}

.card {
  background: color-mix(in srgb, var(--bg-card) 92%, white 8%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.hero {
  padding: 1.6rem;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.76rem;
}

h1,
h2,
legend {
  font-family: "Source Serif 4", Georgia, serif;
  margin-top: 0;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}

h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

p {
  line-height: 1.45;
}

code {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.section-grid,
.form-grid {
  display: grid;
  gap: 1rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

legend {
  padding: 0 0.35rem;
  color: var(--accent-strong);
  font-weight: 700;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.62rem 0.72rem;
  border-radius: 10px;
  border: 1px solid #bcc6bc;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 50%, white 50%);
  outline-offset: 1px;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}

.checkbox-row input {
  width: auto;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

button {
  border: none;
  padding: 0.66rem 0.95rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

button:active {
  transform: translateY(0);
}

button.primary {
  background: linear-gradient(120deg, var(--accent), #15978c);
  color: #fff;
}

button.ghost {
  background: #edf4f2;
  color: var(--accent-strong);
  border: 1px solid #c9dfda;
}

.status-line {
  margin: 0;
  font-size: 0.92rem;
  min-height: 1.2rem;
  color: var(--ink-muted);
}

.status-line.error {
  color: var(--danger);
}

.optional-grid {
  padding-top: 0.2rem;
  display: grid;
  gap: 0.7rem;
}

.hidden {
  display: none;
}

.output-card pre {
  margin: 0;
  background: #17212b;
  color: #ebf5ff;
  padding: 0.95rem;
  border-radius: 10px;
  overflow: auto;
  min-height: 210px;
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .page {
    width: min(1080px, 94vw);
    margin-top: 1.1rem;
  }

  .card {
    padding: 1rem;
  }
}
