:root {
  --ink: #1f2d6d;
  --deep: #0e1b4d;
  --sun: #fcb76e;
  --paper: #fffdf8;
  --sand: #f7efe3;
  --mist: #eef1ff;
  --line: #e4e0d8;
  --white: #ffffff;
}

@font-face {
  font-family: runaltoregular;
  src: url("runalto.regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans Pro", Arial, sans-serif;
  background: radial-gradient(circle at 15% 5%, #f7efe3 0%, #fdfaf5 35%, #eef1ff 100%);
  color: var(--ink);
  min-height: 100vh;
}

h1 {
  font-family: runaltoregular, "Source Sans Pro", serif;
  color: rgb(255, 255, 255);
  font-size: 34.576px;
  letter-spacing: 0.3px;
  margin: 0 0 8px;
}

h2 {
  font-family: runaltoregular, "Source Sans Pro", serif;
  color: rgb(252, 183, 110);
  font-size: 22.4px;
  margin: 0 0 12px;
  letter-spacing: 0.2px;
}

h3 {
  font-family: "Source Sans Pro", Arial, sans-serif;
  color: rgb(31, 45, 109);
  font-size: 34.576px;
  margin: 0 0 16px;
}

h4 {
  font-family: "Source Sans Pro", Arial, sans-serif;
  color: rgb(31, 45, 109);
  font-size: 24.256px;
  margin: 24px 0 10px;
}

p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.hero {
  background: linear-gradient(135deg, #0e1b4d 0%, #1f2d6d 60%, #1a3a7a 100%);
  color: var(--white);
  padding: 2px 24px 2px;
  position: relative;
  overflow: hidden;
}

.hero-welcome {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  text-align: right;
  margin-top: 28px;
}

.hero-welcome-text {
  font-family: runaltoregular, "Source Sans Pro", serif;
  font-size: 24px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.4px;
}

.hero-logo {
  height: 92px;
  width: auto;
  display: block;
}

.form-footer-logo {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
  padding: 0;
}

.form-footer-logo img {
  height: 88px;
  width: auto;
  display: block;
}

.app {
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 0 20px 40px;
}

.hero .app {
  margin-bottom: 12px;
  padding-bottom: 6px;
}

.card {
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(15, 26, 70, 0.18);
  padding: 28px;
  margin-top: -18px;
  border: 1px solid rgba(31, 45, 109, 0.08);
}

.note {
  background: rgba(252, 183, 110, 0.18);
  border-left: 4px solid var(--sun);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.progress {
  margin-bottom: 24px;
}

.progress.hidden {
  display: none;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(31, 45, 109, 0.12);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fcb76e 0%, #f6a652 70%, #f28f3b 100%);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 14px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: rgba(31, 45, 109, 0.7);
  margin-bottom: 6px;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(31, 45, 109, 0.6);
}

.progress-steps .step {
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
  background: rgba(31, 45, 109, 0.05);
}

.progress-steps .step.active {
  background: rgba(31, 45, 109, 0.15);
  color: var(--ink);
  font-weight: 600;
}

.progress-steps .step.done {
  background: rgba(252, 183, 110, 0.25);
  color: #6d4a20;
  font-weight: 600;
}

.form-page {
  display: none;
}

.form-page.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

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

.section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(31, 45, 109, 0.8);
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(31, 45, 109, 0.2);
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.inline-fields input,
.inline-fields select {
  width: 100%;
}

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

.weight-goal-field {
  margin-top: 24px;
}

.grid.weight-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 720px) {
  .inline-fields {
    grid-template-columns: minmax(0, 1fr) 70px;
  }

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(31, 45, 109, 0.6);
  box-shadow: 0 0 0 3px rgba(31, 45, 109, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-top: 6px;
}

.options label {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(31, 45, 109, 0.8);
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}

.conditional.hidden {
  display: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 24px;
}

button {
  font-family: "Source Sans Pro", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

button.primary {
  background: linear-gradient(90deg, #fcb76e 0%, #f4a652 100%);
  color: #4a2d10;
  box-shadow: 0 14px 30px rgba(252, 183, 110, 0.35);
}

button.ghost {
  background: rgba(31, 45, 109, 0.08);
  color: var(--ink);
}

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

.medication-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.medication-row button {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(31, 45, 109, 0.1);
  color: var(--ink);
  justify-self: start;
}

.summary-box {
  background: rgba(31, 45, 109, 0.05);
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(31, 45, 109, 0.2);
  margin-top: 20px;
  overflow: auto;
}

.letter-output {
  font-size: 14px;
  line-height: 1.6;
  color: #111;
}

.letter-output p {
  margin: 0 0 12px;
}

.letter-output .letter-gap {
  height: 14px;
}

.letter-output .section-title {
  font-weight: 700;
  margin: 18px 0 8px;
}

.letter-output .subhead {
  font-weight: 700;
  margin: 12px 0 4px;
}

.letter-output .letter-list {
  margin: 0 0 10px 18px;
  padding: 0;
}

.letter-output .letter-placeholder {
  color: rgba(31, 45, 109, 0.6);
}

.footer-note {
  margin-top: 16px;
  color: rgba(31, 45, 109, 0.75);
}

@media (max-width: 720px) {
  .hero {
    padding: 2px 20px 2px;
  }

  .hero-welcome {
    gap: 10px;
  }

  .hero-welcome-text {
    font-size: 20px;
  }

  .hero-logo {
    height: 72px;
  }

  .card {
    padding: 22px;
  }

  h1,
  h3 {
    font-size: 28px;
  }

  h4 {
    font-size: 20px;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }
}
.intro-title {
  font-family: runaltoregular, "Source Sans Pro", serif;
  font-size: 34.576px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.intro-text {
  margin-bottom: 16px;
}
