:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #52607a;
  --accent: #0c8f62;
  --accent-ink: #ffffff;
  --border: #dae2ef;
  --ok: #1a7f37;
  --warn: #956900;
  --no: #a40014;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top right, #d7f3e8 0%, var(--bg) 40%);
  color: var(--text);
  font-family:
    "Manrope",
    "Segoe UI",
    -apple-system,
    sans-serif;
}

.page {
  width: min(1000px, 92vw);
  margin: 2rem auto 4rem;
  display: grid;
  gap: 1rem;
}

.hero {
  background: linear-gradient(120deg, #073a2c, #0b5e46);
  color: #fff;
  padding: 1.5rem;
  border-radius: 14px;
  box-shadow: 0 18px 30px rgba(7, 58, 44, 0.2);
}

.hero h1 {
  margin: 0.2rem 0 0.6rem;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.eyebrow {
  margin: 0;
  color: #b0e8d5;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0;
  max-width: 60ch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.grid-form {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

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

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

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.52rem 0.62rem;
  background: #fff;
}

textarea {
  width: 100%;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

.checkbox input {
  width: 1rem;
  height: 1rem;
}

.actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.75rem;
}

.doc-row > label {
  min-width: 0;
}

.lang-label {
  display: inline-grid;
  width: 100%;
  margin-top: 0;
}

input[type="file"] {
  max-width: 100%;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 0.62rem 0.9rem;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

button:hover {
  filter: brightness(1.06);
}

button.secondary {
  background: #0d4f9e;
}

.helper {
  color: var(--muted);
  margin: 0.15rem 0 0.7rem;
}

.hints {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.draft-preview {
  margin: 0.85rem 0 0;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fbff;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.86rem;
}

.results {
  display: grid;
  gap: 0.75rem;
}

.card {
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: 10px;
  padding: 0.85rem;
  background: #fdfefe;
}

.status-eligible {
  border-left-color: var(--ok);
}

.status-likely_eligible {
  border-left-color: var(--warn);
}

.status-not_eligible {
  border-left-color: var(--no);
}

.card h3 {
  margin: 0;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  margin-top: 0.3rem;
  font-weight: 700;
}

.pill-eligible {
  background: rgba(26, 127, 55, 0.12);
  color: var(--ok);
}

.pill-likely_eligible {
  background: rgba(149, 105, 0, 0.14);
  color: #7a5600;
}

@media (max-width: 640px) {
  .doc-row {
    grid-template-columns: 1fr;
  }
}

.pill-not_eligible {
  background: rgba(164, 0, 20, 0.12);
  color: var(--no);
}

.amount-chip {
  margin: 0.55rem 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid #9dd1f9;
  background: #eef7ff;
  border-radius: 8px;
}

ul {
  margin-top: 0.42rem;
}

@media (max-width: 720px) {
  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
