:root {
  --ink: #22324A;
  --muted: #5A6372;
  --card: #FFFFFF;
  --line: #DDD6CB;
  --line-strong: #CFC7BA;
  --soft: #F8F6F2;
  --yes: #9A2C93;
  --yes-hover: #7E2178;
  --danger: #B42318;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.5;
  background-color: #C49A6C;
  background-image: radial-gradient(rgba(90,55,25,.22) 1.2px, transparent 1.4px), radial-gradient(rgba(255,240,215,.18) 1px, transparent 1.2px);
  background-size: 14px 14px, 22px 22px; background-position: 0 0, 7px 9px;
}
button, input { font: inherit; color: inherit; }

.top { color: #FFFFFF; background: linear-gradient(90deg, #0FA58E, #0A8FCC 25%, #4F63B8 45%, #B02BA6 62%, #EC1C8E 80%, #F06A84); box-shadow: 0 4px 14px rgba(40,20,0,.25); }
.top-inner { max-width: 640px; margin: 0 auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.brand { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }

.main { max-width: 640px; margin: 0 auto; padding: 24px 14px 28px; }
.card {
  background: var(--card); border-radius: 16px; box-shadow: 0 20px 50px rgba(40,20,0,.3);
  padding: 24px 20px; display: flex; flex-direction: column; gap: 20px; margin: 0;
}
.card[hidden] { display: none; }
.intro h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; }
.intro p { margin: 0; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 15px; font-weight: 700; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ''; position: absolute; right: 18px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); pointer-events: none;
}
#company {
  width: 100%; height: 54px; padding: 0 44px 0 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  font-size: 17px; font-weight: 600; background: #FFFFFF; color: var(--ink); -webkit-appearance: none; appearance: none; cursor: pointer;
}
#company:invalid { color: #6B7280; font-weight: 400; }
#company option { color: var(--ink); font-weight: 400; }
#company:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(34,50,74,.14); }
#company.missing { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(180,35,24,.15); }

.questions { display: flex; flex-direction: column; gap: 12px; }
.q { margin: 0; padding: 14px 14px 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.q legend { float: left; flex: 1 1 160px; padding: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.q.missing { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(180,35,24,.15); }
.seg { display: flex; gap: 8px; flex: none; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  min-width: 76px; height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; cursor: pointer; user-select: none;
}
.seg input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
.seg input[value="1"]:checked + label { background: var(--yes); border-color: var(--yes); color: #FFFFFF; }
.seg input[value="0"]:checked + label { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

.msg { margin: 0; color: var(--danger); font-weight: 600; }
.msg:empty { display: none; }

.btn { height: 54px; padding: 0 24px; border-radius: 12px; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.primary { border: 0; background: var(--yes); color: #FFFFFF; font-weight: 700; width: 100%; }
.primary:hover:not(:disabled) { background: var(--yes-hover); }
.primary:disabled { opacity: .6; cursor: wait; }
.ghost { border: 1px solid var(--line-strong); background: #FFFFFF; font-weight: 600; }

.done { align-items: center; text-align: center; }
.done h1 { margin: 0; font-size: 28px; }
.done p { margin: 0; color: var(--muted); }
.tick { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #FFFFFF; background: linear-gradient(135deg, #4F63B8, #B02BA6); }
.summary { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.summary li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--soft); font-weight: 600; }
.summary .ans { flex: none; }
.summary .ans.yes { color: var(--yes); }
.summary .ans.no { color: var(--muted); }

.powered {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: fit-content; margin: 0 auto 28px; padding: 8px 16px; border-radius: 999px; background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(40,20,0,.25); font-size: 13px; font-weight: 600; color: #2B2860;
}
.powered img { display: block; width: 96px; height: auto; }

@media (min-width: 600px) {
  .main { padding-top: 40px; }
  .card { padding: 32px; }
  .intro h1 { font-size: 30px; }
}
