:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #24323d;
  --muted: #68747b;
  --line: #dde3df;
  --teal: #198f90;
  --teal-dark: #106c6d;
  --teal-soft: #e3f3f1;
  --coral: #f36f5b;
  --coral-soft: #fff0ec;
  --ochre: #e5a03c;
  --ochre-soft: #fff5df;
  --plum: #755b78;
  --plum-soft: #f4eef5;
  --danger: #ad3d32;
  --danger-soft: #fff1ef;
  --shadow: 0 22px 70px rgba(36, 50, 61, .1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --pointer-x: 50%;
  --pointer-y: 20%;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(25, 143, 144, .08), transparent 28rem),
    radial-gradient(circle at 92% 82%, rgba(243, 111, 91, .08), transparent 30rem),
    var(--paper);
}

button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(25, 143, 144, .35);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(340px circle at var(--pointer-x) var(--pointer-y), rgba(229, 160, 60, .12), transparent 72%);
  transition: background-position .18s ease-out;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 780;
  letter-spacing: .015em;
}

.wordmark-mark {
  position: relative;
  width: 39px;
  height: 31px;
  flex: 0 0 auto;
}

.wordmark-mark span {
  position: absolute;
  width: 25px;
  height: 19px;
  border-radius: 8px 8px 8px 2px;
  background: var(--teal);
}

.wordmark-mark span:first-child { left: 0; top: 0; }
.wordmark-mark span:last-child { right: 0; bottom: 0; background: var(--coral); transform: scaleX(-1); }

.language-reset {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, .74);
  color: var(--ink);
  font-size: .86rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.language-reset:hover { border-color: var(--teal); color: var(--teal-dark); }

#app {
  width: min(1180px, calc(100% - 40px));
  margin: 18px auto 46px;
}

.screen { animation: screen-in .42s cubic-bezier(.2, .75, .25, 1) both; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.preview-ribbon {
  width: fit-content;
  margin: 0 0 18px;
  padding: 7px 11px;
  border: 1px solid #ecd39e;
  border-radius: 999px;
  color: #77571d;
  background: var(--ochre-soft);
  font-size: .75rem;
  font-weight: 760;
  letter-spacing: .02em;
}

.language-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, .92fr);
  min-height: 670px;
  overflow: hidden;
  border: 1px solid rgba(36, 50, 61, .09);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: #f7eee0;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 670px;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  transform: scale(1.015);
  transition: transform 7s cubic-bezier(.2, .8, .2, 1);
}

.language-layout:hover .hero-visual img { transform: scale(1.055); }

.hero-caption {
  position: absolute;
  inset: auto 24px 24px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 17px;
  background: rgba(255, 255, 255, .83);
  box-shadow: 0 14px 42px rgba(36, 50, 61, .12);
  backdrop-filter: blur(13px);
}

.hero-caption strong { display: block; font-size: 1rem; }
.hero-caption span { display: block; margin-top: 4px; color: var(--muted); font-size: .84rem; line-height: 1.45; }

.language-panel {
  padding: clamp(36px, 6vw, 78px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3, p { text-wrap: pretty; }

h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.25rem, 5vw, 4.8rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.language-prompt {
  margin: 26px 0 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.language-options { display: grid; gap: 12px; }

.language-card {
  position: relative;
  width: 100%;
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.language-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 13px 30px rgba(25, 143, 144, .1);
}

.language-code {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 840;
}

.language-card:last-child .language-code { color: #934436; background: var(--coral-soft); }
.language-name { font-size: 1.08rem; font-weight: 760; }
.language-arrow { margin-left: auto; color: var(--muted); font-size: 1.2rem; }

.compact-shell {
  width: min(720px, 100%);
  margin: 56px auto 80px;
}

.panel {
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(36, 50, 61, .1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.panel h1 {
  max-width: 15ch;
  font-size: clamp(2.25rem, 6vw, 4rem);
}

.lede {
  max-width: 58ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.field { margin-top: 28px; }
.field-label { display: block; margin: 0 0 9px; font-size: .88rem; font-weight: 760; }

.text-input, .select-input, .text-area {
  width: 100%;
  border: 1px solid #cad3cf;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.text-input, .select-input { min-height: 54px; padding: 0 15px; }
.text-input:focus, .select-input:focus, .text-area:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(25, 143, 144, .09); outline: none; }

.passcode-wrap { position: relative; }
.passcode-wrap .text-input { padding-right: 88px; }
.reveal-button {
  position: absolute;
  right: 8px;
  top: 8px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 730;
}

.field-hint { margin: 9px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }

.button-row { display: flex; align-items: center; gap: 12px; margin-top: 28px; }

.primary-button, .secondary-button {
  min-height: 52px;
  border-radius: 14px;
  padding: 0 21px;
  font-weight: 780;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 9px 24px rgba(25, 143, 144, .19);
}

.primary-button:hover:not(:disabled) { background: var(--teal-dark); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(25, 143, 144, .24); }
.primary-button:disabled { opacity: .6; cursor: wait; }

.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { border-color: var(--teal); color: var(--teal-dark); }

.inline-error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #f0c9c3;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .86rem;
  line-height: 1.5;
}

.privacy-note {
  display: flex;
  gap: 11px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}

.privacy-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--teal); }

.survey-shell { width: min(940px, 100%); margin: 32px auto 80px; }
.survey-heading { padding: 22px 0 34px; }
.survey-heading h1 { max-width: 20ch; font-size: clamp(2.35rem, 6vw, 4.8rem); }

.category-section {
  margin: 0 0 24px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(36, 50, 61, .1);
  border-top: 5px solid var(--category-vivid);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 15px 48px rgba(36, 50, 61, .065);
}

.category-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.category-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--category); background: var(--category-soft); font-size: .83rem; font-weight: 850; }
.category-title { margin: 0; font-size: clamp(1.1rem, 3vw, 1.35rem); letter-spacing: -.02em; }

.question-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.question-card:hover { border-color: color-mix(in srgb, var(--category), white 44%); transform: translateY(-2px); box-shadow: 0 13px 32px rgba(36, 50, 61, .075); }
.question-card.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(173,61,50,.08); }
.question-title { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 1rem; line-height: 1.55; font-weight: 710; }
.question-index { color: var(--category); font-size: .82rem; font-weight: 850; padding-top: 2px; }
.required-mark { color: var(--danger); }

.rating-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 16px; }
.rating-choice { position: relative; min-width: 0; }
.rating-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rating-choice label {
  min-height: 74px;
  height: 100%;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
  font-size: .7rem;
  line-height: 1.25;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.rating-choice label:hover { border-color: var(--category); color: var(--ink); transform: translateY(-1px); }
.rating-choice input:focus-visible + label { outline: 3px solid rgba(25, 143, 144, .3); outline-offset: 2px; }
.rating-choice input:checked + label { border-color: var(--category); color: var(--ink); background: var(--category-soft); box-shadow: inset 0 0 0 1px var(--category); }
.rating-label { color: var(--category); font-size: .76rem; font-weight: 800; }

.text-area { min-height: 130px; margin-top: 14px; padding: 14px 15px; resize: vertical; line-height: 1.55; }

.sfa-shell {
  --category: #08728a;
  --category-vivid: #10b3d2;
  --category-soft: #e5f7fb;
  width: min(880px, 100%);
}
.sfa-shell[data-category="health_wellbeing"] { --category: #9a4b00; --category-vivid: #ff8b1a; --category-soft: #fff0df; }
.sfa-shell[data-category="construction_safety"] { --category: #2e7418; --category-vivid: #57c429; --category-soft: #ebf8e7; }
.sfa-shell[data-category="reporting_culture"] { --category: #08728a; --category-vivid: #10b3d2; --category-soft: #e5f7fb; }
.sfa-shell[data-category="safety_competency"] { --category: #285f9d; --category-vivid: #468ad6; --category-soft: #eaf2fc; }
.sfa-shell[data-category="technology"] { --category: #6d32a5; --category-vivid: #a055e3; --category-soft: #f4ecfb; }
.sfa-heading { padding-bottom: 26px; }
.sfa-heading h1 { color: var(--category); }
.sfa-counter {
  width: fit-content;
  margin-bottom: 16px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--category-vivid), white 58%);
  border-radius: 999px;
  background: var(--category-soft);
  color: var(--category);
  font-size: .76rem;
  font-weight: 800;
}
.sfa-section { margin-bottom: 0; }
.scale-hint {
  margin: 0 0 4px;
  padding: 12px 14px;
  border-left: 4px solid var(--category-vivid);
  border-radius: 12px;
  color: var(--muted);
  background: var(--category-soft);
  font-size: .82rem;
  line-height: 1.5;
}
.open-question { margin-top: 30px; background: color-mix(in srgb, var(--category-soft), white 66%); }

.sfa-actions .primary-button {
  border-color: var(--category);
  background: var(--category);
  box-shadow: 0 9px 24px color-mix(in srgb, var(--category), transparent 78%);
}
.sfa-actions .primary-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--category), black 14%);
  background: color-mix(in srgb, var(--category), black 14%);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--category), transparent 72%);
}
.sfa-actions .secondary-button:hover { border-color: var(--category); color: var(--category); }

.survey-actions {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid rgba(36,50,61,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 16px 50px rgba(36,50,61,.13);
  backdrop-filter: blur(16px);
}

.survey-actions-note { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.survey-actions .primary-button { flex: 0 0 auto; }
.action-end { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }

.completion-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid rgba(36, 50, 61, .1);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.completion-visual { min-height: 650px; overflow: hidden; background: #f7eee0; }
.completion-visual img { width: 100%; height: 100%; min-height: 650px; display: block; object-fit: cover; object-position: 50% 50%; }
.completion-content { padding: clamp(34px, 6vw, 76px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.confirmation-mark {
  width: 84px;
  height: 84px;
  margin: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 2.25rem;
  font-weight: 900;
  transform: rotate(-3deg);
}
.completion-content h1 { max-width: 11ch; font-size: clamp(2.45rem, 5vw, 4.6rem); }
.anonymous-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--teal-dark);
  background: var(--teal-soft);
}
.anonymous-note svg { flex: 0 0 auto; }
.complete-preview-note { margin: 16px 0 26px; color: var(--muted); font-size: .86rem; line-height: 1.5; }

.site-footer {
  width: min(1180px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .04em;
}
.footer-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--coral); }
.noscript { margin: 30px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: white; }

@media (max-width: 820px) {
  .language-layout { grid-template-columns: 1fr; min-height: auto; }
  .hero-visual { min-height: 300px; }
  .hero-visual img { min-height: 300px; max-height: 380px; }
  .language-panel { padding: 38px 28px 42px; }
  .language-panel h1 { max-width: 14ch; }
  .compact-shell { margin-top: 28px; }
  .completion-layout { grid-template-columns: 1fr; min-height: auto; }
  .completion-visual { min-height: 310px; max-height: 390px; }
  .completion-visual img { min-height: 310px; height: 100%; }
  .completion-content { padding: 38px 28px 44px; }
}

@media (max-width: 560px) {
  .site-header, #app, .site-footer { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 68px; }
  .wordmark { font-size: .78rem; letter-spacing: 0; }
  .wordmark-mark { width: 32px; height: 26px; }
  .wordmark-mark span { width: 21px; height: 16px; }
  .language-reset { padding: 8px 10px; font-size: .72rem; }
  #app { margin-top: 8px; }
  .language-layout { border-radius: 21px; }
  .hero-visual { min-height: 255px; }
  .hero-visual img { min-height: 255px; height: 255px; }
  .hero-caption { inset: auto 14px 14px; padding: 13px 14px; }
  .language-panel { padding: 30px 20px 28px; }
  h1 { font-size: 2.35rem; }
  .language-card { min-height: 78px; padding: 12px 14px; }
  .language-code { width: 46px; height: 46px; }
  .panel { padding: 27px 20px; border-radius: 21px; }
  .panel h1 { font-size: 2.3rem; }
  .button-row { align-items: stretch; flex-direction: column-reverse; }
  .button-row button { width: 100%; }
  .survey-shell { margin-top: 12px; }
  .survey-heading { padding-top: 12px; }
  .category-section { padding: 17px 12px; border-radius: 19px; }
  .question-card { padding: 16px 12px; }
  .rating-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .rating-choice label { min-height: 70px; padding: 8px 4px; font-size: .68rem; }
  .rating-label { font-size: .72rem; }
  .survey-actions { align-items: stretch; flex-direction: column; bottom: 8px; }
  .survey-actions .primary-button { width: 100%; }
  .action-end { align-items: stretch; flex-direction: column; gap: 10px; }
  .sfa-actions .secondary-button { width: 100%; }
  .completion-visual { min-height: 240px; height: 240px; }
  .completion-visual img { min-height: 240px; height: 240px; }
  .completion-content { padding: 30px 20px 36px; }
  .completion-content h1 { font-size: 2.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ambient { display: none; }
}
