:root {
  --bg: #f3efe7;
  --ink: #1f1b16;
  --muted: #6b645c;
  --accent: #ff6b4a;
  --accent-2: #008f7a;
  --card: #fff9f2;
  --border: #e6dccf;
  --shadow: 0 24px 60px rgba(37, 28, 19, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: radial-gradient(circle at top left, #fff7eb 0%, #f2e8d7 40%, #efe1cf 100%);
  padding: 64px 20px 120px;
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.55;
  z-index: 0;
}

.orb-1 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.6), rgba(255, 107, 74, 0));
  top: -80px;
  right: 12%;
}

.orb-2 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(0, 143, 122, 0.5), rgba(0, 143, 122, 0));
  bottom: -120px;
  left: -60px;
}

.orb-3 {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(34, 83, 120, 0.45), rgba(34, 83, 120, 0));
  top: 45%;
  left: 60%;
}

.hero {
  max-width: 900px;
  margin: 0 auto 32px;
  text-align: left;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.8s ease-out;
}

.eyebrow {
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  margin-bottom: 16px;
}

.lead {
  font-size: 18px;
  max-width: 620px;
  color: var(--muted);
}

.content {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 32px;
  animation: rise 0.8s ease-out;
}

.card-header {
  margin-bottom: 24px;
}

.card-header h2 {
  font-family: "Fraunces", serif;
  font-size: 28px;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field:last-of-type {
  margin-bottom: 28px;
}

label {
  font-weight: 600;
}

.required {
  color: var(--accent);
}

input,
textarea,
select {
  font: inherit;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fffdf9;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.15);
}

textarea {
  resize: vertical;
}

.help {
  font-size: 13px;
  color: var(--muted);
}

.error {
  color: #c13b2f;
  font-size: 13px;
  min-height: 16px;
}

.chips {
  display: grid;
  gap: 12px;
}

.chip {
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 16px;
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: grid;
  gap: 6px;
}

.chip span {
  font-weight: 600;
}

.chip small {
  color: var(--muted);
  font-size: 13px;
}

.chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(255, 107, 74, 0.14);
}

.chip.active {
  border-color: var(--accent);
  background: rgba(255, 107, 74, 0.12);
}

.tag-input {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: #fffdf9;
}

.tag-input input {
  border: none;
  padding: 8px;
  flex: 1;
  min-width: 180px;
  background: transparent;
}

.tag-input input:focus {
  outline: none;
  box-shadow: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: rgba(0, 143, 122, 0.12);
  color: #005548;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag button {
  background: none;
  border: none;
  color: #005548;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.primary {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(130deg, var(--accent), #ff915f 60%, #ffae7a 100%);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-loading {
  display: none;
  position: absolute;
  right: 20px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-top-color: transparent;
  transform: translateY(-50%);
  animation: spin 0.8s linear infinite;
}

.loading .btn-loading {
  display: inline-block;
}

.result {
  border-left: 6px solid var(--accent-2);
}

.result-grid {
  display: grid;
  gap: 24px;
}

.result pre {
  background: #16130f;
  color: #f7f2ec;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
}

.timestamp {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-grid div:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body {
    padding: 48px 16px 80px;
  }

  .card {
    padding: 24px;
  }

  .hero h1 {
    font-size: 36px;
  }
}

[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  animation: fieldIn 0.6s ease forwards;
}

[data-animate]:nth-child(1) { animation-delay: 0.05s; }
[data-animate]:nth-child(2) { animation-delay: 0.12s; }
[data-animate]:nth-child(3) { animation-delay: 0.2s; }
[data-animate]:nth-child(4) { animation-delay: 0.28s; }
[data-animate]:nth-child(5) { animation-delay: 0.36s; }
[data-animate]:nth-child(6) { animation-delay: 0.44s; }

@keyframes fieldIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
