:root {
  --bg-main: #eef7fb;
  --bg-card: #ffffff;
  --primary: #0f6b8f;
  --primary-dark: #0a516c;
  --text-main: #1f2a37;
  --text-soft: #4b5563;
  --ok-bg: #e7f8ef;
  --ok-text: #146c43;
  --error-bg: #fdecec;
  --error-text: #9f1d1d;
  --warn-bg: #fff7e6;
  --warn-text: #8a5a14;
  --border: #d6e4ee;
  --shadow: 0 10px 28px rgba(15, 107, 143, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Nunito Sans", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, #d8f0fb 0%, transparent 42%),
    linear-gradient(160deg, #f6fbfe 0%, var(--bg-main) 100%);
}

.app-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.card-header h1 {
  margin: 10px 0 12px;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.25;
  color: #11455d;
}

.chip {
  display: inline-block;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e5f6ff;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.intro {
  margin: 0 0 20px;
  color: var(--text-soft);
  line-height: 1.65;
}

.welcome-card { text-align: center; padding: 50px 30px; }
.credits-box { margin: 30px 0; padding: 15px; background: #f0f7fb; border-left: 4px solid #0f6b8f; border-radius: 4px; display: inline-block; text-align: left; }
.credits-box p { margin: 0; color: #103b52; font-size: 1.1rem; }
.start-btn { margin-top: 20px; font-size: 1.15rem; padding: 16px 40px; background: linear-gradient(180deg, #1e86ae 0%, #0f6b8f 100%); color: white; border: none; border-radius: 12px; cursor: pointer; font-weight: bold; box-shadow: 0 4px 15px rgba(15, 107, 143, 0.3); transition: transform 0.2s; }
.start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15, 107, 143, 0.4); }

.medical-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f4760;
}

.field input,
.field select {
  height: 44px;
  width: 100%;
  border: 1px solid #bfd4e0;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 0.98rem;
  color: var(--text-main);
  background: #fdfefe;
}

.field input:focus,
.field select:focus {
  outline: 3px solid #d2edfa;
  border-color: #78b7d4;
}

#calculate-btn {
  grid-column: span 2;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #1e86ae 0%, var(--primary) 100%);
  color: #fff;
  height: 46px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

#calculate-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #1a799d 0%, var(--primary-dark) 100%);
}

#result-area {
  margin-top: 18px;
  min-height: 60px;
}

.step-card {
  margin-top: 16px;
}

.step-header h2 {
  margin: 10px 0 2px;
  color: #11455d;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}

.question-block {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fcfe;
}

.question-text {
  margin: 0;
  color: #1f4760;
  font-weight: 600;
  line-height: 1.5;
}

.answer-buttons {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

.binary-btn {
  min-width: 84px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #a8bac7;
  background: #f3f7fa;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.binary-btn:hover {
  transform: translateY(-1px);
}

.binary-btn.selected-yes {
  background: #fee2e2;
  border-color: #ef9a9a;
  color: #9f1d1d;
}

.binary-btn.selected-no {
  background: #e7f8ef;
  border-color: #9bd7b5;
  color: #146c43;
}

#step2-feedback {
  margin-top: 16px;
}

.continue-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #1e86ae 0%, var(--primary) 100%);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
}

.diagnosis-box {
  margin-top: 16px;
}

#final-diagnosis {
  margin-top: 16px;
  border: 1px solid var(--border);
  background: #f8fbfd;
  color: var(--text-main);
}

.therapy-card {
  margin-top: 14px;
  border: 1px solid #8bb7d6;
  background: #f5fbff;
}

.therapy-card h3 {
  margin: 0 0 10px;
  color: #103b52;
  font-size: 1.08rem;
}

#therapy-text {
  margin: 0 0 12px;
  color: #14364a;
  font-weight: 600;
}

#btn-reimbursement {
  border: 0;
  border-radius: 10px;
  min-height: 42px;
  padding: 10px 14px;
  background: #0f3d64;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

#btn-reimbursement:hover {
  background: #0b3150;
}

#reimbursement-info {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #eaf4fb;
  border: 1px solid #c4dded;
  color: #1f3f53;
  line-height: 1.5;
  font-size: 0.95rem;
}

.result-box {
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 600;
  line-height: 1.5;
}

.result-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid #b8e7cc;
}

.result-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid #f3b5b5;
}

.result-warning {
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid #f2d39c;
}

@media (max-width: 700px) {
  .card {
    padding: 20px;
    border-radius: 16px;
  }

  .medical-form {
    grid-template-columns: 1fr;
  }

  #calculate-btn {
    grid-column: auto;
  }

  .answer-buttons {
    flex-direction: column;
  }

  .binary-btn {
    width: 100%;
  }
}
