:root {
  --bg: #f5f8fb;
  --paper: #ffffff;
  --line: #dfe7ef;
  --text: #243244;
  --muted: #718195;
  --blue: #2f8ee5;
  --blue-soft: #edf6ff;
  --green: #22b985;
  --green-soft: #eaf9f3;
  --red: #e8627c;
  --red-soft: #fff0f3;
  --yellow: #e6ad29;
  --yellow-soft: #fff8e5;
  --shadow: 0 18px 45px rgba(36, 50, 68, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.page,
.resume-page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero,
.resume-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px 0 10px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 5px;
  font-size: 20px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  font-size: 16px;
  letter-spacing: 0;
}

.intro {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.flow-card,
.form-card,
.resume-paper {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.flow-card {
  margin-bottom: 18px;
  padding: 18px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  gap: 12px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.step.active {
  border-color: #badcf9;
  background: var(--blue-soft);
}

.step span,
.section-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.step strong,
.step small {
  display: block;
}

.step small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.form-card {
  margin-bottom: 18px;
  padding: 22px;
}

.section-title {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-title p,
.soap-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: #3f4f61;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 94px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 142, 229, 0.12);
}

.note-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid #cfe3f8;
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-status span {
  color: var(--muted);
  font-size: 13px;
}

.soap-block {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.soap-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 15px;
}

.soap-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  color: #ffffff;
  font-weight: 900;
}

.soap-badge.s {
  background: var(--yellow);
}

.soap-badge.o {
  background: var(--blue);
}

.soap-badge.a {
  background: var(--red);
}

.soap-badge.p {
  background: var(--green);
}

.button-row,
.final-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.button-row {
  margin-top: 20px;
}

.compact-row {
  margin-top: 0;
}

.final-actions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.primary-button,
.secondary-button,
.finish-button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  border: 0;
  color: #ffffff;
  background: var(--blue);
}

.secondary-button,
.secondary-link {
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.finish-button {
  border: 0;
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(34, 185, 133, 0.22);
}

.saved-list {
  display: grid;
  gap: 12px;
}

.saved-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.saved-card strong,
.saved-card small {
  display: block;
}

.saved-card small {
  margin-top: 4px;
  color: var(--muted);
}

.saved-card p {
  margin: 10px 0 0;
  color: #506174;
  line-height: 1.45;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tiny-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #b7d7f5;
  border-radius: 6px;
  color: var(--blue);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 6px;
  min-height: 120px;
  place-content: center;
  padding: 20px;
  border: 1px dashed #c7d4e3;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  min-width: 230px;
  max-width: min(380px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #ffffff;
  background: #243244;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.resume-paper {
  padding: 28px;
}

.resume-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--line);
}

.resume-title h2 {
  font-size: 24px;
}

.resume-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.meta-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.meta-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.resume-section {
  margin-top: 18px;
}

.resume-section h3 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.resume-section p,
.resume-section li {
  color: #45566a;
  line-height: 1.65;
}

.resume-section ul,
.resume-section ol {
  padding-left: 20px;
}

.warning-box {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid #f4d591;
  border-radius: var(--radius);
  background: var(--yellow-soft);
  color: #6b5113;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .hero,
  .resume-header {
    flex-direction: column;
  }

  .note-status,
  .note-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .steps,
  .field-grid.two,
  .field-grid.three,
  .field-grid.six,
  .resume-meta {
    grid-template-columns: 1fr;
  }

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

  .button-row,
  .final-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .resume-header {
    display: none;
  }

  .resume-page {
    width: 100%;
    padding: 0;
  }

  .resume-paper {
    border: 0;
    box-shadow: none;
  }
}
