:root {
  --bg: #f4efe6;
  --bg-soft: #fbf8f3;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --text: #172124;
  --muted: #5b676c;
  --border: rgba(23, 33, 36, 0.12);
  --accent: #0f6b63;
  --accent-strong: #094841;
  --accent-soft: #e1f1ee;
  --warm: #c46f4a;
  --warm-soft: #f7e6de;
  --success: #2f7d49;
  --success-soft: #e7f5ea;
  --danger: #a33e3e;
  --danger-soft: #f8e5e5;
  --shadow: 0 18px 44px rgba(17, 29, 31, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Tahoma", "Segoe UI", "Arial", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(196, 111, 74, 0.10), transparent 22%),
    radial-gradient(circle at left 18%, rgba(15, 107, 99, 0.10), transparent 26%),
    linear-gradient(180deg, #f8f4ed 0%, #f3eee4 100%);
  color: var(--text);
  line-height: 1.7;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
  border-radius: 999px;
  filter: blur(8px);
}

body::before {
  width: 220px;
  height: 220px;
  top: 120px;
  left: -60px;
  background: rgba(15, 107, 99, 0.07);
}

body::after {
  width: 280px;
  height: 280px;
  right: -100px;
  bottom: 12%;
  background: rgba(196, 111, 74, 0.08);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea,
input[type="text"],
input[type="tel"],
input[type="date"],
input[type="search"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0.9rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

textarea {
  min-height: 130px;
  resize: vertical;
  overflow: hidden;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: rgba(15, 107, 99, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 107, 99, 0.12);
}

.page-shell {
  width: min(calc(100% - 2rem), var(--container));
  margin: 1.25rem auto 3rem;
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
}

.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 250, 244, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(23, 33, 36, 0.08);
}

.sticky-bar__group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.progress-inline {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.progress-inline__label {
  color: var(--muted);
  font-size: 0.92rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  border-radius: 999px;
  padding: 0 0.85rem;
  background: rgba(23, 33, 36, 0.06);
  color: var(--text);
  font-size: 0.9rem;
}

.pill--live {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--warm);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-card h1,
.section-heading h2,
.section-card__title,
.question-card__title {
  margin: 0;
  line-height: 1.4;
}

.hero-card__description,
.section-heading p,
.section-card__meta,
.feedback-line,
.question-card__meta,
.no-results,
.empty-state {
  margin: 0;
  color: var(--muted);
}

.hero-card__stats {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat-box {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid rgba(23, 33, 36, 0.07);
}

.stat-box--accent {
  background: linear-gradient(135deg, rgba(15, 107, 99, 0.92), rgba(9, 72, 65, 0.96));
  color: #fff;
}

.stat-box--accent .stat-box__label {
  color: rgba(255, 255, 255, 0.86);
}

.stat-box__label {
  display: block;
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat-box__value {
  font-size: 1.6rem;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-heading--split {
  flex-wrap: wrap;
}

.coach-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field-group {
  display: grid;
  gap: 0.55rem;
}

.field-group span {
  font-weight: 700;
}

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

.search-box {
  min-width: min(100%, 320px);
  display: grid;
  gap: 0.45rem;
}

.search-box__label {
  font-weight: 700;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.btn {
  border: 0;
  border-radius: 14px;
  min-height: 46px;
  padding: 0.75rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 107, 99, 0.2);
}

.btn--secondary {
  background: #eef3f2;
  color: var(--text);
  border: 1px solid rgba(23, 33, 36, 0.08);
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(23, 33, 36, 0.14);
  color: var(--text);
}

.btn--danger {
  color: var(--danger);
  border-color: rgba(163, 62, 62, 0.22);
  background: rgba(248, 229, 229, 0.42);
}

.feedback-line {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(15, 107, 99, 0.08);
}

.feedback-line.is-error {
  background: rgba(163, 62, 62, 0.08);
  color: var(--danger);
}

.sections-wrapper {
  display: grid;
  gap: 1rem;
}

.section-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.section-card__toggle {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 241, 233, 0.92));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.3rem;
}

.section-card__toggle:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 247, 245, 0.98));
}

.section-card__title-wrap {
  display: grid;
  gap: 0.3rem;
  text-align: right;
}

.section-card__title {
  font-size: 1.2rem;
}

.section-card__meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.section-card__count,
.section-card__completion,
.section-card__match {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.86rem;
}

.section-card__count {
  background: rgba(23, 33, 36, 0.06);
}

.section-card__completion {
  background: var(--success-soft);
  color: var(--success);
}

.section-card__match {
  background: var(--warm-soft);
  color: var(--warm);
}

.section-card__chevron {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 107, 99, 0.08);
  color: var(--accent-strong);
  font-size: 1.4rem;
  transition: transform 0.2s ease;
}

.section-card.is-collapsed .section-card__chevron {
  transform: rotate(-90deg);
}

.section-card__body {
  padding: 0 1.3rem 1.3rem;
  display: grid;
  gap: 1rem;
}

.section-card.is-collapsed .section-card__body {
  display: none;
}

.question-card {
  border: 1px solid rgba(23, 33, 36, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.82);
  scroll-margin-top: 6rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.question-card.is-complete {
  border-color: rgba(47, 125, 73, 0.26);
  background: linear-gradient(180deg, rgba(231, 245, 234, 0.68), rgba(255, 255, 255, 0.92));
}

.question-card__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.question-card__meta {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.question-card__title {
  font-size: 1.05rem;
}

.question-card__badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(23, 33, 36, 0.07);
  color: var(--muted);
  font-size: 0.88rem;
}

.question-card.is-complete .question-card__badge {
  background: var(--success-soft);
  color: var(--success);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

.answer-field {
  display: grid;
  gap: 0.55rem;
}

.answer-field label {
  font-weight: 700;
}

.section-card.is-hidden,
.question-card.is-hidden {
  display: none;
}

.no-results.is-hidden {
  display: none;
}

.no-results,
.empty-state,
.noscript-box {
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px dashed rgba(23, 33, 36, 0.14);
}

.highlight-target {
  animation: highlightPulse 1.8s ease;
}

@keyframes highlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 107, 99, 0.25);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(15, 107, 99, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 107, 99, 0);
  }
}

@media (max-width: 960px) {
  .sticky-bar,
  .hero-card,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .sticky-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .sticky-bar__group {
    justify-content: space-between;
  }

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

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--container));
    margin-top: 1rem;
  }

  .card,
  .section-card__body,
  .section-card__toggle {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .coach-grid {
    grid-template-columns: 1fr;
  }

  .question-card__header,
  .section-card__toggle {
    grid-template-columns: 1fr;
    display: grid;
  }

  .question-card__header {
    gap: 0.75rem;
  }

  .sticky-bar__group {
    width: 100%;
  }

  .sticky-bar__group--actions .btn {
    flex: 1 1 0;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  body::before,
  body::after,
  .no-print,
  .sticky-bar {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    margin: 0;
    gap: 0.75rem;
  }

  .card,
  .section-card,
  .question-card {
    box-shadow: none;
    background: #fff;
    border: 1px solid #d6d6d6;
  }

  .section-card__body {
    display: grid !important;
  }

  textarea,
  input[type="text"],
  input[type="tel"],
  input[type="date"] {
    border: 1px solid #d6d6d6;
    box-shadow: none;
    background: #fff;
    color: #000;
  }
}
