@font-face {
    font-family: Naskh;
    src: url(arabic.ttf)
}

:root {
    --purple: #654883;
    --deep: #39254d;
    --muted: #6c6476;
    --line: #e4dce9;
    --soft: #f5f0f8
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: #fcfbfd;
    color: var(--deep);
    font-family: Naskh,Tahoma,serif;
    font-size: 18px;
    line-height: 1.65
}

button,input,select {
    font: inherit
}

button,a {
    -webkit-tap-highlight-color: transparent
}

button {
    cursor: pointer
}

.survey-page #app {
    max-width: 1080px;
    margin: 24px auto 50px;
    padding: 0 28px;
    min-height: 55vh
}

h1 {
    font-size: clamp(30px,4.5vw,48px);
    line-height: 1.45;
    margin: 10px 0 20px
}

h2 {
    font-size: 28px;
    line-height: 1.7;
    margin: 14px 0 25px
}

p {
    margin: 10px 0 20px
}

.muted {
    color: var(--muted)
}

.eyebrow {
    font-size: 16px;
    color: var(--purple)
}

.intro {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 55px;
    align-items: center;
    padding: 28px 0
}

.intro-text {
    max-width: 560px
}

.intro-text h1 {
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 12px
}

.intro-lead {
    font-size: 20px;
    line-height: 1.7;
    margin: 0 0 8px;
    color: var(--deep)
}

.intro-slogan {
    color: var(--purple);
    font-weight: bold;
    margin: 0 0 10px
}

.intro-credit {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
    margin: 0 0 18px
}

.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 12px 48px #41244d08
}

.journey {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.journey li {
    padding: 13px 10px;
    background: var(--soft);
    border-radius: 12px;
    font-size: 16px
}

.journey b {
    font-family: Arial;
    font-size: 13px;
    color: var(--purple);
    margin-left: 7px
}

.primary {
    background: var(--purple);
    border: 1px solid var(--purple);
    color: white;
    padding: 12px 30px;
    border-radius: 14px;
    min-height: 52px;
    transition: background .2s
}

.primary:hover {
    background: var(--deep)
}

button:disabled {
    opacity: .4;
    cursor: not-allowed
}

.secondary {
    background: white;
    color: var(--deep);
    border: 1px solid var(--line);
    padding: 11px 24px;
    border-radius: 14px;
    min-height: 50px
}

button:focus-visible,a:focus-visible,input:focus-visible {
    outline: 3px solid #b38acf;
    outline-offset: 4px
}

.consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 22px 0;
    font-size: 16px
}

.consent input {
    accent-color: var(--purple);
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    margin-top: 5px
}

.privacy {
    font-size: 15px;
    color: var(--muted);
    margin-top: 14px
}

.topline {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    color: var(--muted)
}

.survey-restart-btn {
    margin-inline-start: auto;
    padding: 6px 12px;
    border: 0;
    background: transparent;
    color: var(--purple);
    font: inherit;
    font-size: 15px;
    text-decoration: underline;
    cursor: pointer;
    min-height: auto
}

.survey-restart-btn:hover {
    color: var(--deep)
}

progress {
    width: 100%;
    height: 7px;
    appearance: none;
    display: block;
    margin: 14px 0 24px;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--line)
}

progress::-webkit-progress-bar {
    background: var(--line)
}

progress::-webkit-progress-value {
    background: var(--purple);
    transition: width .3s
}

progress::-moz-progress-bar {
    background: var(--purple)
}

.layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 36px
}

.steps {
    list-style: none;
    padding: 0;
    margin: 0
}

.steps li {
    padding: 12px 10px;
    color: var(--muted);
    border-right: 2px solid var(--line);
    font-size: 16px
}

.steps li.active {
    border-color: var(--purple);
    background: var(--soft);
    color: var(--deep);
    font-weight: bold;
    border-radius: 10px 0 0 10px
}

.steps span {
    display: inline-grid;
    place-items: center;
    width: 25px;
    margin-left: 7px;
    font-family: Arial;
    font-size: 13px
}

.question {
    padding: 32px 38px;
    animation: arrive .25s ease
}

.question h2 {
    min-height: 85px
}

.options {
    display: grid;
    gap: 10px;
    border: 0;
    margin: 0;
    padding: 0
}

.options legend {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 14px
}

.option {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 16px;
    cursor: pointer;
    transition: .15s;
    background: white
}

.option:hover {
    border-color: #a28bb4;
    background: #fcf9ff
}

.option:has(input:checked) {
    border: 2px solid var(--purple);
    background: var(--soft);
    padding: 10px 15px
}

.option:has(input:focus-visible) {
    outline: 3px solid #b38acf;
    outline-offset: 2px
}

.option input {
    position: absolute;
    opacity: 0
}

.number {
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    font-family: Arial;
    font-size: 15px
}

.option:has(input:checked) .number {
    background: var(--purple);
    color: white;
    border-color: var(--purple)
}

.na {
    font-size: 16px;
    color: var(--muted)
}

.actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 25px
}

.completion {
    text-align: center;
    max-width: 650px;
    margin: 30px auto
}

.completion .big {
    font-family: Georgia;
    font-size: 65px;
    line-height: 1.2;
    color: var(--purple)
}

.chips {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 24px 0
}

.chips i {
    display: block;
    width: 35px;
    height: 6px;
    border-radius: 6px;
    background: var(--line)
}

.chips i.done {
    background: var(--purple)
}

.results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 25px 0
}

.result h3 {
    font-size: 20px;
    margin: 0
}

.result .value {
    font-family: Arial;
    font-size: 28px;
    color: var(--purple)
}

.result small {
    font-size: 15px;
    color: var(--muted)
}

.result progress {
    margin: 12px 0
}

.notice {
    background: var(--soft);
    padding: 18px 22px;
    border-radius: 15px;
    font-size: 16px
}

.result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px
}

.survey-page .survey-footer {
    max-width: 1080px;
    margin: 0 auto 32px;
    padding: 20px 28px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px
}

.error {
    color: #963f55
}

.profile {
    padding: 32px 38px;
    animation: arrive .25s ease
}

.profile h1 {
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 10px
}

.profile-note {
    background: var(--soft);
    color: var(--deep);
    border-radius: 16px;
    padding: 14px 18px;
    margin: 0 0 8px;
    font-size: 16px
}

.profile-form {
    display: grid;
    gap: 18px;
    margin-top: 18px
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start
}

.profile-field {
    display: grid;
    gap: 8px
}

.profile-field[hidden] {
    display: none
}

.field-label,
.profile-group legend {
    font-weight: bold;
    font-size: 17px;
    color: var(--deep);
    margin: 0
}

.profile-group {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px
}

.profile-field input[type="text"],
.profile-field input[type="number"],
.profile-field select {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 16px;
    background: white;
    color: var(--deep);
    transition: border-color .15s, box-shadow .15s
}

.profile-field input::placeholder {
    color: #9a91a6
}

.profile-field input:focus,
.profile-field select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px #6548831a;
    outline: none
}

.profile-field input:disabled {
    background: #f7f4f9;
    color: var(--muted)
}

.profile-field select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23654883' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 40px
}

.years-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch
}

.check-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    cursor: pointer;
    white-space: nowrap;
    transition: .15s
}

.check-line:hover {
    border-color: #a28bb4;
    background: #fcf9ff
}

.check-line:has(input:checked) {
    border: 2px solid var(--purple);
    background: var(--soft);
    padding: 0 15px
}

.check-line input {
    accent-color: var(--purple);
    width: 18px;
    height: 18px;
    margin: 0
}

.choice-row {
    display: grid;
    gap: 10px
}

.choice-row.cols-2 {
    grid-template-columns: 1fr 1fr
}

.choice-row.cols-3 {
    grid-template-columns: 1fr 1fr 1fr
}

.choice-row .chip {
    justify-content: center;
    min-height: 52px;
    text-align: center
}

.field-hint {
    font-size: 15px;
    color: var(--muted);
    margin: 0
}

.profile-error {
    font-size: 15px;
    color: #963f55;
    background: #fdf2f4;
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0
}

.profile-error[hidden] {
    display: none
}

.profile-actions {
    justify-content: flex-end;
    margin-top: 6px
}

#nationality-other-wrap {
    margin-top: 4px
}

.nationality-combo {
    position: relative
}

.nationality-list {
    position: absolute;
    z-index: 30;
    inset-inline: 0;
    top: calc(100% + 6px);
    max-height: 240px;
    overflow: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 40px #41244d18
}

.nationality-list[hidden] {
    display: none
}

.nationality-list li {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer
}

.nationality-list li.active,
.nationality-list li:hover {
    background: var(--soft)
}

.nationality-list li.selected {
    color: var(--purple);
    font-weight: bold
}

.nationality-list li.empty {
    color: var(--muted);
    cursor: default
}

@keyframes arrive {
    from {
        opacity: .2;
        transform: translateY(7px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        animation: none!important;
        transition: none!important
    }
}

@media(max-width: 760px) {
    header,footer {
        padding:20px
    }

    .intro {
        grid-template-columns: 1fr;
        gap: 25px;
        padding-top: 0
    }

    .intro .panel {
        order: 2
    }

    .layout {
        grid-template-columns: 1fr;
        gap: 12px
    }

    .steps {
        display: none
    }

    main {
        padding: 0 18px;
        margin-top: 15px
    }

    .question,
    .profile {
        padding: 24px 20px
    }

    .profile-grid,
    .years-row,
    .choice-row.cols-2,
    .choice-row.cols-3 {
        grid-template-columns: 1fr
    }

    .question h2 {
        font-size: 25px;
        min-height: 0
    }

    .results {
        grid-template-columns: 1fr
    }

    .panel {
        border-radius: 21px;
        padding: 22px
    }

    .topline {
        font-size: 15px
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px
    }

    .journey li {
        font-size: 15px
    }

    .actions button {
        padding: 11px 19px
    }

    h1 {
        font-size: 34px
    }
}

@media print {
    header,.actions,footer,button {
        display: none
    }

    .results {
        display: block
    }

    .result {
        break-inside: avoid;
        margin: 12px 0;
        box-shadow: none
    }

    main {
        max-width: none
    }

    .panel {
        box-shadow: none
    }
}
