:root {
  --bg: #f5ead7;
  --bg-deep: #e3d2b2;
  --ink: #1a1611;
  --muted: #65584a;
  --panel: rgba(255, 249, 239, 0.8);
  --panel-strong: rgba(255, 252, 247, 0.94);
  --line: rgba(70, 51, 31, 0.14);
  --accent: #b34d20;
  --accent-deep: #7f2f14;
  --accent-soft: rgba(179, 77, 32, 0.12);
  --shadow: 0 28px 80px rgba(52, 35, 18, 0.12);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(223, 131, 73, 0.18), transparent 22%),
    linear-gradient(135deg, var(--bg) 0%, #efe2ca 45%, var(--bg-deep) 100%);
}

code,
input,
button {
  font-family: var(--font-mono);
}

.page-glow {
  position: fixed;
  inset: auto;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.4;
  pointer-events: none;
}

.page-glow-left {
  top: -8rem;
  left: -10rem;
  background: rgba(255, 255, 255, 0.78);
}

.page-glow-right {
  right: -6rem;
  bottom: -8rem;
  background: rgba(179, 77, 32, 0.22);
}

.shell {
  position: relative;
  width: min(860px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.section-kicker {
  margin: 0 0 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.77rem;
  color: var(--accent-deep);
}

.section-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.section-copy p,
.field-help,
.status,
.derived-help {
  color: var(--muted);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.form-panel {
  padding: 1.2rem;
  background: linear-gradient(180deg, var(--panel-strong), rgba(255, 249, 239, 0.92));
}

.form-section {
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid rgba(70, 51, 31, 0.08);
}

.form-section + .form-section {
  margin-top: 1rem;
}

.section-copy {
  margin-bottom: 1rem;
}

.section-copy h2,
.summary-top h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.section-copy p,
.summary-top p {
  margin: 0.7rem 0 0;
  line-height: 1.6;
}

.field {
  display: block;
}

.field + .field {
  margin-top: 0.95rem;
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.field-help {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

input {
  width: 100%;
  border: 1px solid rgba(70, 51, 31, 0.15);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.94rem;
  padding: 0.95rem 1rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input:focus {
  border-color: rgba(179, 77, 32, 0.55);
  box-shadow: 0 0 0 4px rgba(179, 77, 32, 0.11);
  transform: translateY(-1px);
}

input::placeholder {
  color: rgba(101, 88, 74, 0.62);
}

.derived-card,
.status {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(70, 51, 31, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.derived-card {
  margin-top: 0.95rem;
  padding: 1rem 1.05rem;
}

.derived-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.derived-card strong {
  display: block;
  margin: 0.3rem 0;
  font-size: 1.28rem;
  font-family: var(--font-display);
}

.derived-help {
  display: block;
  font-size: 0.88rem;
  line-height: 1.45;
}

.form-actions {
  margin-top: 1rem;
}

.status {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  line-height: 1.5;
}

.status.is-error {
  color: #7b1e1e;
  background: rgba(190, 40, 40, 0.08);
  border-color: rgba(190, 40, 40, 0.16);
}

.status.is-success {
  color: #0d4e39;
  background: rgba(22, 128, 89, 0.08);
  border-color: rgba(22, 128, 89, 0.16);
}

.status-hidden {
  display: none;
}

.download-button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, #d26734 100%);
  color: #fffaf3;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 1rem 1.15rem;
  cursor: pointer;
  box-shadow: 0 18px 32px rgba(127, 47, 20, 0.2);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.download-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 22px 36px rgba(127, 47, 20, 0.24);
}

.download-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (max-width: 980px) {
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 1rem, 100%);
    padding-top: 1.4rem;
    padding-bottom: 2rem;
  }

  .form-panel {
    padding: 0.9rem;
    border-radius: 24px;
  }

  .form-section {
    padding: 1rem;
  }
}
