@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --bg: #0b1424;
  --bg-glow: #1b2a40;
  --card: #f7f3ec;
  --panel: #fff6ea;
  --ink: #0d121a;
  --muted: #5a616b;
  --accent: #d9682b;
  --accent-strong: #b7490f;
  --accent-soft: #f0b896;
  --border: #e1d8cc;
  --shadow: 0 30px 60px rgba(11, 20, 36, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(237, 191, 142, 0.3), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(143, 188, 216, 0.35), transparent 50%),
    linear-gradient(160deg, var(--bg), var(--bg-glow));
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.25;
  z-index: 0;
}

body::before {
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(217, 104, 43, 0.6), transparent 70%);
}

body::after {
  bottom: -120px;
  right: -60px;
  background: radial-gradient(circle, rgba(98, 156, 200, 0.55), transparent 70%);
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.hero {
  color: #f8f4ef;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(248, 244, 239, 0.7);
  margin: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 700;
}

.lede {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(248, 244, 239, 0.78);
  max-width: 640px;
}

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: lift 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.15), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.card-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--muted);
}

.card-title h2 {
  margin: 0;
  font-size: 1.6rem;
}

.card-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 440px;
}

.badge {
  background: rgba(217, 104, 43, 0.12);
  color: var(--accent-strong);
  border: 1px solid rgba(217, 104, 43, 0.25);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 24px;
  align-items: start;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  font-weight: 600;
}

textarea {
  resize: vertical;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
  font-size: 0.98rem;
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  color: var(--ink);
  background: #fffdf9;
  min-height: 220px;
  line-height: 1.6;
}

textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 104, 43, 0.12);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

button {
  border-radius: 999px;
  border: none;
  padding: 12px 24px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 24px rgba(217, 104, 43, 0.3);
}

.primary:hover {
  background: var(--accent-strong);
}

.secondary {
  background: #f2e8db;
  color: var(--ink);
}

.helper-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.helper {
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(90, 97, 107, 0.15);
}

.validation {
  min-height: 1.2em;
  font-size: 0.85rem;
  margin: 0;
  color: #9a5b2e;
}

.validation[data-state="error"] {
  color: #a03838;
}

.validation[data-state="warn"] {
  color: #9a5b2e;
}

.side-panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 16px;
  border: 1px dashed rgba(90, 97, 107, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  background: #ffffff;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-alert {
  border-color: rgba(160, 56, 56, 0.45);
  box-shadow: 0 0 0 2px rgba(160, 56, 56, 0.08);
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.tip-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.tip-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.divider {
  margin: 24px 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(90, 97, 107, 0.1), rgba(90, 97, 107, 0.35), rgba(90, 97, 107, 0.1));
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.results-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

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

.results {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.result-card {
  border-radius: 16px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.4s ease-out;
}

.result-card.is-ok {
  border-left: 4px solid rgba(42, 110, 63, 0.8);
}

.result-card.is-error {
  border-left: 4px solid rgba(160, 56, 56, 0.8);
}

.result-card.is-invalid {
  border-left: 4px solid rgba(185, 73, 15, 0.7);
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.result-url {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.status-pill {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-ok {
  background: rgba(72, 142, 92, 0.16);
  color: #2a6e3f;
}

.status-error {
  background: rgba(189, 74, 74, 0.14);
  color: #a03838;
}

.status-pending {
  background: rgba(49, 85, 131, 0.18);
  color: #2c4f7a;
}

.status-warn {
  background: rgba(217, 104, 43, 0.16);
  color: #9a5b2e;
}

.payload {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  font-size: 0.78rem;
  color: #4b515c;
  white-space: pre-wrap;
}

.note {
  color: rgba(248, 244, 239, 0.72);
  font-size: 0.88rem;
  max-width: 620px;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

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

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

@media (max-width: 640px) {
  .page {
    padding: 48px 18px 60px;
  }

  .card {
    padding: 20px;
  }

  .card-title {
    flex-direction: column;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
    justify-content: center;
  }

  .helper-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
