:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --blue: #0071e3;
  --blue-dark: #005bb5;
  --soft: #f0f0f2;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.match-app {
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  display: grid;
  align-items: center;
}

.view {
  display: none;
  width: 100%;
}

.view.active {
  display: block;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 40px;
  line-height: 1.08;
  font-weight: 760;
}

h2 {
  font-size: 30px;
  line-height: 1.18;
  font-weight: 740;
}

.lead {
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.primary,
.secondary,
.ghost {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.primary {
  width: 100%;
  margin-top: 36px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.primary:active {
  background: var(--blue-dark);
}

.primary:disabled {
  cursor: default;
  background: #b7cfe8;
}

.secondary {
  width: 100%;
  background: var(--soft);
  color: var(--text);
  font-weight: 700;
}

.secondary.saved {
  background: #eaf7ef;
  color: #137333;
  animation: savePop 420ms ease;
}

.ghost {
  min-height: 36px;
  padding: 0;
  background: transparent;
  color: var(--blue);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.progress-track {
  height: 4px;
  margin-bottom: 28px;
  background: #e7e7ea;
  border-radius: 999px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 16.66%;
  height: 100%;
  background: var(--blue);
  transition: width 180ms ease;
}

.options-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.question-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.question-next {
  margin-top: 18px;
}

.option-btn {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  font-weight: 700;
  border-radius: 8px;
}

.option-btn:active,
.option-btn.selected {
  border-color: var(--blue);
  background: #edf5ff;
}

.contact-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.hint {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.ai-loading-view {
  text-align: center;
}

.ai-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border: 1px solid rgba(0, 113, 227, 0.28);
  background: #edf5ff;
  color: var(--blue);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
  animation: aiPulse 1.2s ease-in-out infinite;
}

.ai-steps {
  display: grid;
  gap: 10px;
  margin: 26px 0 16px;
  text-align: left;
}

.ai-steps span {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.ai-steps span.active {
  border-color: rgba(0, 113, 227, 0.34);
  background: #edf5ff;
  color: var(--text);
}

@keyframes aiPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.16);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(0, 113, 227, 0);
  }
}

@keyframes savePop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

.report-view {
  align-self: start;
}

.report-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.report-summary-card {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(0, 113, 227, 0.22);
  background: #edf5ff;
  border-radius: 8px;
}

.report-summary-card span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.report-summary-card strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.32;
}

.report-list article {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}

.report-list span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.report-list p {
  font-size: 15px;
  line-height: 1.65;
}

.report-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.report-actions .primary {
  margin-top: 0;
}

@media (min-width: 720px) {
  body {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 245, 247, 1)),
      var(--bg);
  }

  .match-app {
    width: min(620px, calc(100% - 48px));
  }

  .view {
    padding: 32px;
    border: 1px solid rgba(210, 210, 215, 0.86);
    background: rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  h1 {
    font-size: 52px;
  }

  .report-actions {
    grid-template-columns: 1fr 1fr;
  }
}
