:root {
  color-scheme: light;
  --bg-top: #f7f3ea;
  --bg-bottom: #dbe7f2;
  --panel: rgba(255, 252, 246, 0.92);
  --panel-border: rgba(51, 63, 72, 0.14);
  --text: #1f2933;
  --muted: #52606d;
  --accent: #1f7a5a;
  --accent-hover: #14533d;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 34%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(760px, 100%);
  padding: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.intro {
  margin: 12px 0 24px;
  max-width: 58ch;
  color: var(--muted);
}

.label,
.result-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(82, 96, 109, 0.25);
  border-radius: 16px;
  resize: vertical;
  min-height: 240px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.85);
}

textarea:focus,
button:focus {
  outline: 2px solid rgba(31, 122, 90, 0.28);
  outline-offset: 2px;
}

button {
  margin-top: 18px;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #267a8d);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

.spinner.is-hidden {
  display: none;
}

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

button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--accent-hover), #1b5d6d);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.result {
  margin-top: 24px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(240, 247, 244, 0.95);
  border: 1px solid rgba(31, 122, 90, 0.16);
}

.result.is-hidden {
  display: none;
}

#riskLevel {
  margin: 0 0 18px;
  font-size: 2rem;
}

#explanation {
  margin: 0;
  line-height: 1.6;
}

.status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .panel {
    padding: 22px;
    border-radius: 20px;
  }

  textarea {
    min-height: 200px;
  }
}
