/* Questionnaire and result. Fonts and colours come from /theme.css. */
*{box-sizing:border-box}
body{position:relative;margin:0;min-width:320px;color:var(--ink);background:var(--cream);font-family:var(--font);font-size:16px;line-height:1.55;-webkit-font-smoothing:antialiased}
a{color:inherit;text-underline-offset:.2em}
button,input,textarea{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
[tabindex="-1"]:focus{outline:none}
h1,h2,h3,p{margin-top:0}
.wrap{width:min(760px,calc(100% - 40px));margin-inline:auto}

/* Header */
.site-header{position:relative;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:16px;padding:24px max(20px,calc((100% - 1200px)/2));border-bottom:1px solid #eee3ea}
.brand{display:flex;flex-direction:column;gap:2px;font-size:14px;font-weight:800;letter-spacing:1.6px;text-transform:uppercase;text-decoration:none;line-height:1.25}
.brand span{font-size:12px;font-weight:500;letter-spacing:0;text-transform:none;color:#8a7b93}
.header-link{font-size:13px;font-weight:600;letter-spacing:1.3px;text-transform:uppercase}

/* Questionnaire */
.test-shell{display:flex;flex-direction:column;gap:24px;padding-block:56px 96px}
.eyebrow{margin:0;font-size:13px;font-weight:700;letter-spacing:2.2px;text-transform:uppercase;color:var(--orange)}
.test-intro{display:flex;flex-direction:column;gap:14px}
.test-intro h1{margin:0;font:600 clamp(36px,4.6vw,56px)/1.14 var(--head);text-transform:uppercase}
.test-intro>p:last-child{max-width:700px;margin:0;font-size:17px;line-height:1.6;color:var(--text)}
.data-note{margin:0;padding:14px 18px;border:1px solid #f6dcc6;border-radius:14px;background:#fff3e8;color:#6b4a39;font-size:14px;line-height:1.55}
.question-card{display:flex;flex-direction:column;gap:22px;padding:36px 44px 40px;background:#fff;border:1px solid var(--line);border-radius:26px;box-shadow:0 16px 48px rgba(46,28,56,.06)}
.progress-caption{display:flex;align-items:center;gap:16px}
#step-label{display:block;color:var(--ink);font:500 32px/1.25 var(--head)}
#question-prompt{display:block;margin-top:12px;color:var(--ink);font:700 23px/1.4 var(--font)}
#step-count{flex:none;font-size:14px;font-weight:500;color:var(--muted);white-space:nowrap}
.progress-track{height:6px;border-radius:3px;background:#f1e7ee;overflow:hidden}
#progress-fill{height:100%;width:0;border-radius:3px;background:var(--peach);transition:width .15s}
#question-form{display:flex;flex-direction:column;gap:22px}
fieldset{min-width:0;margin:0;padding:0;border:0}
legend{width:100%;max-width:600px;padding:0;font:500 32px/1.22 var(--head)}
#question-hint{display:grid;gap:6px;max-width:672px;margin:22px 0;padding:14px 18px;border:1px solid var(--line);border-radius:14px;background:var(--pill);color:var(--ink);font-size:16px;line-height:1.5}
#question-hint strong{font-weight:700}
#question-hint .question-hint-detail{color:var(--text);font-size:15px}
.question-hint-heading{display:flex;align-items:center;flex-wrap:wrap;gap:10px 12px}
.question-hint-heading>strong{flex:1;min-width:180px}
.selection-example{display:inline-flex;align-items:center;gap:3px;flex:none}
.selection-example-box{position:relative;width:18px;height:18px;border:1.5px solid var(--accent);border-radius:5px;background:#fff}
.selection-example-box.is-checked{background:var(--peach);border-color:var(--peach)}
.selection-example-box.is-checked::after{content:"";position:absolute;left:5px;top:2px;width:4px;height:8px;border:solid var(--ink);border-width:0 2px 2px 0;transform:rotate(45deg)}
.selection-count{flex:none;margin-left:auto;padding:5px 10px;border:1px solid var(--line);border-radius:100px;background:#fff;color:var(--muted);font-size:14px;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}
.selection-count[data-has-selection="true"]{background:var(--peach);border-color:var(--peach);color:var(--ink)}
.choices{display:grid;gap:10px}
.choice{display:flex;align-items:flex-start;gap:16px;padding:17px 20px;border:1px solid #e7dce3;border-radius:14px;background:#fff;font-size:16px;font-weight:500;line-height:1.45;cursor:pointer;transition:border-color .15s,background .15s}
.choice:hover{border-color:#e9b49a;background:#fffaf6}
.choice:has(input:checked){padding:16.5px 19.5px;border:1.5px solid var(--orange);background:#fff3ea;font-weight:600}
.choice:has(input:focus-visible){outline:3px solid var(--accent);outline-offset:3px}
.choice input{flex:none;width:22px;height:22px;margin:0;border:1.5px solid #bfb0c8;background:#fff;-webkit-appearance:none;appearance:none;cursor:pointer}
.choice input[type="radio"]{border-radius:50%}
.choice input[type="radio"]:checked{border-color:var(--orange);background:radial-gradient(circle,var(--orange) 0 5px,#fff 5.5px)}
.choice input[type="checkbox"]{border-radius:6px}
.choice input[type="checkbox"]:checked{border-color:var(--orange);background:var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.4 3.4L16.2 7.6' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat}
.choice input:focus-visible{outline:none}
.choice span{min-width:0;overflow-wrap:anywhere}
.choice.exclusive{color:var(--ink)}
/* «Свой вариант» opens a field inside the selected option */
.custom-choice:has(input:checked){padding:17px 20px 20px;border:1.5px solid var(--orange);border-radius:14px;background:#fff3ea}
.custom-choice:has(input:checked)>.choice{padding:0;border:0;background:transparent}
.custom-answer{display:flex;flex-direction:column;gap:8px;padding:14px 0 0 38px}
.custom-answer label{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.custom-answer textarea{display:block;width:100%;min-height:104px;resize:vertical;padding:14px 16px;border:1.5px solid #e7dce3;border-radius:12px;background:#fff;color:var(--ink);font-size:15px;line-height:1.5}
.custom-answer textarea::placeholder{color:#a597ad}
.custom-answer textarea:focus-visible{outline:none;border-color:var(--orange)}
.custom-answer textarea[aria-invalid="true"]{border-color:#d9481b}
.custom-answer .small-note{max-width:560px;margin:0;font-size:13px!important;line-height:1.5}
.validation{margin:0;padding:12px 16px;border:1px solid #f3b9a5;border-radius:12px;background:#fff1ec;color:#b4380e;font-size:14px;font-weight:600;line-height:1.45}
.validation:empty{display:none}
.nav-row{display:flex;align-items:center;gap:16px;padding-top:8px}
#next{margin-left:auto}
.primary-button{display:inline-flex;justify-content:center;align-items:center;padding:17px 34px;border:0;border-radius:14px;background:var(--peach);box-shadow:0 6px 0 var(--peach-dark);color:var(--ink);font-size:17px;font-weight:700;line-height:1.25;text-align:center;text-decoration:none;cursor:pointer}
.primary-button:hover{background:#ffa778}
.primary-button:disabled{background:var(--line);box-shadow:none;color:var(--muted);opacity:.8}
.text-button{padding:9.6px 3.2px;border:0;background:transparent;color:var(--text);font-size:16px;font-weight:600;text-decoration:underline;text-underline-offset:.22em;cursor:pointer}
button:disabled{cursor:not-allowed}
.small-note{font-size:15px!important;line-height:1.5;color:var(--muted)}

/* Result layout; the current card presentation is in result-page.css. */
body.has-result .site-header{border-bottom-color:rgba(238,227,234,.8)}
body.has-result .site-header .brand{font-size:15px}
body.has-result .site-header .brand span{font-size:13px;color:var(--muted)}
body.has-result .header-link{font-size:15px;font-weight:700;letter-spacing:1px}
body.has-result .test-shell{width:min(1200px,calc(100% - 40px));padding-top:63px;gap:24px}
#result{display:flex;flex-direction:column;gap:24px}
.result-head{display:flex;flex-direction:column;align-items:flex-start;gap:14px;min-height:473px}
.result-head .eyebrow{font-size:14px;color:var(--accent)}
.result-head h1{width:min(660px,52vw);margin:0;font:600 clamp(34px,3.7vw,52px)/1.14 var(--head);text-transform:uppercase}
body.has-result .data-note{border-color:var(--gold-line);background:var(--gold);color:#4d3a20;font-size:15px}
.result-layout{display:grid;grid-template-columns:360px minmax(0,1fr);gap:40px;align-items:start}
.result-sidebar{display:grid;gap:20px;min-width:0}
.summary-card{display:flex;flex-direction:column;gap:14px;padding:26px;background:#fff;border:1px solid #e8dde4;border-radius:22px}
.summary-card{gap:18px;border-radius:24px;box-shadow:0 12px 40px rgba(46,28,56,.05)}
.result-sidebar h2{margin:0;font:500 24px/1.25 var(--head)}
.summary-card h2{font-size:26px;line-height:1.2}
#result-summary{display:none}
#summary-topics{display:grid}
.summary-topic{position:relative;padding:0 0 22px 28px}
.summary-topic:last-child{padding-bottom:0}
.summary-topic::before{content:"";position:absolute;left:0;top:6px;width:14px;height:14px;border:2px solid var(--orange);border-radius:50%;background:#fff;box-sizing:border-box}
.summary-topic.priority::before{background:var(--orange)}
.summary-topic:not(:last-child)::after{content:"";position:absolute;left:6px;top:20px;bottom:0;width:2px;background:#f1c9a8}
.summary-topic h3{margin:0 0 6px;font-size:17px;font-weight:700;line-height:1.45}
.summary-topic h3 .topic-start{color:var(--accent)}
.summary-topic ul{margin:0;padding:0;list-style:none}
.summary-topic li,.summary-topic p{margin:0;font-size:16px;line-height:1.5;color:var(--muted)}
.summary-topic a{display:none}
.summary-topic .small-note{font-size:14px!important}
.result-sidebar details{padding-top:16px;border-top:1px solid #efe3ea}
.result-sidebar summary{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:44px;cursor:pointer;list-style:none;font-size:17px;font-weight:600}
.result-sidebar summary::-webkit-details-marker{display:none}
.result-sidebar summary::after{content:"+";color:var(--accent);font-size:24px;font-weight:700;line-height:1}
.result-sidebar details[open] summary::after{content:"−"}
#all-answers ul{margin:8px 0 0;padding-left:20px;font-size:15px;color:var(--muted)}

/* Materials grouped by topic */
.result-main{display:flex;flex-direction:column;gap:24px;min-width:0}
.format-note{display:grid;gap:8px;padding:16px 18px;border:1px solid var(--gold-line);border-radius:14px;background:var(--gold)}
.format-note p{margin:0;font-size:16px;font-weight:600;line-height:1.5;color:var(--body)}
.result-courses{display:flex;flex-direction:column;gap:32px}
.result-topic{display:flex;flex-direction:column;gap:16px}
.result-courses>.data-note{background:#fff3e8}
.result-actions{display:flex;flex-wrap:wrap;gap:12px 14px;padding-top:8px}
.result-actions .primary-button,.result-actions .text-button{padding:17px 28px;border:1px solid var(--btn-line);border-radius:12px;box-shadow:none;color:var(--ink);font-size:16px;font-weight:600;text-decoration:none}
.result-actions .text-button{background:#fff}
.result-disclaimer{margin:0;font-size:15px;line-height:1.6;color:var(--muted)}

@media (max-width:1100px){
  .result-layout{grid-template-columns:300px minmax(0,1fr);gap:28px}
}
@media (max-width:860px){
  .site-header{padding:16px 18px}
  .brand{font-size:12px}
  .brand span{font-size:11px}
  .header-link{font-size:11px}
  body.has-result .site-header .brand{font-size:12px}
  body.has-result .site-header .brand span{font-size:11px}
  body.has-result .header-link{font-size:11px}
  .wrap{width:calc(100% - 28px)}
  .test-shell{gap:16px;padding-block:18px 24px}
  .test-intro h1{font-size:clamp(30px,9.5vw,40px)}
  .test-intro>p:last-child{font-size:16px}
  .data-note{padding:12px 14px;font-size:13px}
  .question-card{gap:16px;padding:22px 18px;border-radius:22px}
  legend{font-size:26px}
  #step-label{font-size:28px}
  #question-prompt{margin-top:10px;font-size:20px}
  #step-count{font-size:13px}
  .progress-caption{gap:10px}
  #question-hint{margin:16px 0;padding:12px 14px;font-size:16px}
  .choices{gap:8px}
  .choice{gap:12px;padding:13px 14px;font-size:15px}
  .choice:has(input:checked){padding:12.5px 13.5px}
  .custom-choice:has(input:checked){padding:13px 14px 16px}
  .custom-answer{padding-left:0}
  /* Navigation sticks to the bottom of the screen on phones */
  body:not(.has-result) .test-shell{padding-bottom:110px}
  .nav-row{position:fixed;inset:auto 0 0;z-index:10;justify-content:space-between;padding:12px 16px calc(14px + env(safe-area-inset-bottom));background:rgba(255,255,255,.96);border-top:1px solid var(--line);box-shadow:0 -8px 24px rgba(46,28,56,.07)}
  .primary-button{padding:15px 28px;box-shadow:0 5px 0 var(--peach-dark)}
  body.has-result .test-shell{width:calc(100% - 32px);padding-top:0;gap:16px}
  #result{gap:16px}
  .result-head{gap:10px;min-height:0}
  .result-head .eyebrow{font-size:12px}
  .result-head h1{width:100%;font-size:28px}
  .result-layout{display:flex;flex-direction:column;gap:16px}
  .result-sidebar{display:contents}
  .summary-card{order:1;padding:22px 20px}
  .result-main{order:2;gap:16px}
  .result-courses{gap:24px}
  .result-topic{gap:14px}
  .result-actions{flex-direction:column}
  .result-actions .primary-button,.result-actions .text-button{width:100%;padding:17px 20px}
  .result-disclaimer{font-size:14px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
