/* Тест «Твой алкотип»: общие стили для /test/alcotype/ (index.php) и /test/alcotype/{type_id} (_alcotype.php) */

html, body {
    margin: 0;
    padding: 0;
    background: #2a1d16
}

body {
    font-family: 'Manrope', sans-serif;
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none
}

img {
    display: block;
    height: auto
}

h1, h2, p, dl, dd, ol {
    margin: 0
}

[hidden] {
    display: none !important
}

/* Вид страницы результата: <body data-view="owner|guest|guest_with_result">,
   элемент с data-views="…" виден только в перечисленных видах */
[data-view="owner"] [data-views]:not([data-views~="owner"]),
[data-view="guest"] [data-views]:not([data-views~="guest"]),
[data-view="guest_with_result"] [data-views]:not([data-views~="guest_with_result"]) {
    display: none !important
}

/* Фон — как на главной: внутри .page на всю её высоту (не меньше экрана) и уходит вверх при прокрутке.
   Не на один экран: вопрос или результат бывают выше экрана, и фото обрывалось бы у края карточки.
   z-index: -1 — под контентом .page, не задавая position каждому блоку */
.bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    container-type: size;
    background: url(/img/bg-mob.webp);
    background-size: cover;
    background-position-x: 83%;
}

.bg::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    pointer-events: none;
    top: 0;
    height: 48px;
    background: linear-gradient(#2a1d16, rgba(42, 29, 22, 0))
}

.photo {
    display: none
}

.label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6%;
    mix-blend-mode: multiply;
    opacity: .9
}

.shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(30, 18, 12, .72) 0%,
    rgba(30, 18, 12, .66) 58%, rgba(30, 18, 12, .15) 78%, rgba(34, 21, 15, .3) 100%)
}

/* Страница */
.page {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: calc(28px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom))
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .45))
}

.logo img:first-child {
    width: 32px
}

.logo img:last-child {
    width: 110px
}

/* Меню у верхнего края (по левому краю, как на главной), экран теста — по центру между меню и низом страницы (см. .quiz) */
.page > .menu {
    align-self: stretch;
    margin-bottom: auto;
    padding: 0 12px
}

/* margin-bottom: auto — пара к margin-bottom у меню */
.quiz {
    width: 100%;
    max-width: 560px;
    margin-bottom: auto
}

.card {
    box-sizing: border-box;
    width: 100%;
    padding: 28px 22px;
    background: rgba(30, 18, 12, .55);
    border: 1px solid rgba(191, 127, 48, .3);
    border-radius: 25px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35)
}

/* Результат: карточка должна целиком помещаться в экран телефона — прячем логотип и прижимаем к верху.
   На вопросах логотип тоже не нужен: класс is-question ставит quiz.js */
.is-result .logo, .is-question .logo {
    display: none
}

.is-result .page {
    justify-content: flex-start;
    padding-top: calc(28px + env(safe-area-inset-top))
}

.is-result .page > .menu {
    margin-bottom: 0
}

/* Экраны теста */
.screen {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s, transform .3s
}

.screen.is-in {
    opacity: 1;
    transform: none
}

.screen-start {
    text-align: center
}

.q-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(36px, 10vw, 48px);
    line-height: 1.02;
    letter-spacing: -.01em;
    text-wrap: balance
}

.q-sub {
    margin-top: 14px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(21px, 5.6vw, 26px);
    line-height: 1.2;
    text-wrap: balance
}

.line {
    width: 64px;
    height: 2px;
    background: #9c1d43;
    margin: 24px auto 0
}

.note {
    margin-top: 24px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .6);
    text-wrap: balance
}

.btn {
    display: inline-block;
    margin-top: 28px;
    padding: 16px 32px;
    border: 0;
    border-radius: 999px;
    background: #7e1a37;
    color: #fff;
    font: 600 16px/1.2 'Manrope', sans-serif;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s
}

.btn-ghost {
    background: none;
    box-shadow: inset 0 0 0 1.5px #b8325a
}

.btn:focus-visible, .opt:focus-visible, .q-back:focus-visible, .share-item:focus-visible {
    outline: 2px solid #d6466f;
    outline-offset: 3px
}

/* Вопрос */
.q-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
    font-size: 13px;
    color: rgba(255, 255, 255, .6)
}

.q-back {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer
}

.q-count {
    margin-left: auto
}

.q-progress {
    height: 2px;
    margin-top: 10px;
    background: rgba(255, 255, 255, .12);
    border-radius: 2px;
    overflow: hidden
}

.q-progress span {
    display: block;
    height: 100%;
    background: #d6466f;
    transition: width .4s ease
}

.q-text {
    margin-top: 24px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(28px, 7.4vw, 36px);
    line-height: 1.1;
    text-wrap: balance
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding: 0;
    list-style: none
}

.opt {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(191, 127, 48, .35);
    border-radius: 16px;
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font: 400 16px/1.4 'Manrope', sans-serif;
    text-align: left;
    cursor: pointer;
    transition: background-color .2s, border-color .2s
}

.opt.is-selected {
    background: #7e1a37;
    border-color: #d6466f
}

/* Экран результата */
.screen-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
    text-align: center
}

.screen-result .btn {
    margin-top: 0
}

/* Карточка для скриншота: всё самое важное, размеры завязаны на высоту экрана */
.rcard {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.3svh, 14px);
    padding: clamp(16px, 3svh, 32px) 20px clamp(14px, 2.4svh, 24px);
    background: linear-gradient(180deg, rgba(126, 26, 55, .55) 0%, rgba(30, 18, 12, .7) 60%);
    border: 1px solid #b8325a;
    border-radius: 25px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35)
}

/* Иконка «Поделиться» в углу карточки, дублирует кнопку под ней */
.rcard-share {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .85);
    cursor: pointer;
    transition: color .2s, background-color .2s
}

/* Фон есть всегда (на мобилке нет hover), при наведении и нажатии — плотнее */
.rcard-share:hover, .rcard-share:active {
    color: #fff;
    background: rgba(255, 255, 255, .18)
}

.rcard-share:focus-visible {
    outline: 2px solid #d6466f;
    outline-offset: 0
}

.rcard-kicker, .r-label {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6)
}

.rcard-emoji {
    font-size: clamp(44px, 8.5svh, 72px);
    line-height: 1
}

.rcard-name {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(34px, 6.4svh, 50px);
    line-height: 1;
    letter-spacing: -.01em;
    text-wrap: balance
}

/* Архетип типа («Звезда вечера»), есть не во всех тестах */
.rcard-archetype {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #e8819f
}

.rcard-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(19px, 3.3svh, 25px);
    line-height: 1.15;
    text-wrap: balance
}

.rcard-facts {
    display: grid;
    gap: 6px;
    width: 100%;
    padding: clamp(8px, 1.4svh, 14px) 0;
    border-top: 1px solid rgba(191, 127, 48, .3);
    border-bottom: 1px solid rgba(191, 127, 48, .3);
    font-size: 16px;
    line-height: 1.35;
    text-align: left
}

.rcard-facts dt {
    display: inline;
    font-weight: 600;
    color: #e8819f
}

.rcard-facts dd {
    display: inline
}

.rcard-match {
    font-size: 15px;
    line-height: 1.35
}

.rcard-match span {
    color: rgba(255, 255, 255, .6)
}

.rcard-match strong {
    font-weight: 600;
    white-space: nowrap
}

.rcard-url {
    margin-top: clamp(2px, .8svh, 8px);
    color: rgb(196 190 186);
    /*font-weight: 600;*/
    /*font-size: clamp(21px, 3.6svh, 27px);*/
    font-size: 14px;
    line-height: 1.1;
    letter-spacing: .01em
}

.rcard-url-domain {
    color: #f2799d
}

.rcard-store {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .6)
}

.r-more {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 22px
}

.r-text {
    text-align: left
}

.r-desc {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .92)
}

.r-reason {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.5;
    color: rgb(196 190 186);
    /*color: rgba(255, 255, 255, .7)*/
}

.r-match-name {
    color: #fff
}

/* Призыв прийти в магазин с результатом (result_screen.cta), только автору */
.r-cta {
    font-size: 16px;
    line-height: 1.6;
    text-align: left;
    color: #fff;
    border-color: #b8325a
}

.r-compare {
    padding: 14px 18px;
    border: 1px solid #b8325a;
    border-radius: 16px;
    background: rgba(126, 26, 55, .3);
    font-size: 16px;
    line-height: 1.5
}

.r-compare-match {
    margin-top: 4px;
    font-weight: 600;
    color: #e8819f
}

.r-compare a {
    display: inline-block;
    margin-top: 6px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(214, 70, 111, .8);
    text-underline-offset: .2em
}

.r-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.r-more .note {
    margin-top: 0
}

/* Fallback-панель «Поделиться» */
.share-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px
}

.share-item {
    box-sizing: border-box;
    padding: 12px 6px;
    border: 1px solid rgba(191, 127, 48, .35);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font: 600 14px/1.25 'Manrope', sans-serif;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s, border-color .2s
}

.share-manual {
    grid-column: 1 / -1;
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #b8325a;
    border-radius: 14px;
    background: rgba(0, 0, 0, .25);
    color: #fff;
    font: 400 15px/1.3 'Manrope', sans-serif
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 10;
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    padding: 12px 20px;
    border-radius: 999px;
    background: #7e1a37;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity .25s, transform .25s;
    pointer-events: none
}

.toast.is-in {
    opacity: 1;
    transform: translate(-50%, 0)
}

@media (hover: hover) {
    .btn:hover {
        background: #9c1d43
    }

    .btn-ghost:hover {
        background: #7e1a37
    }

    .opt:hover, .share-item:hover {
        background: rgba(126, 26, 55, .45);
        border-color: #b8325a
    }

    .opt.is-selected:hover {
        background: #7e1a37
    }

    .q-back:hover {
        color: #fff
    }
}

@media (prefers-reduced-motion: reduce) {
    .screen, .q-progress span, .toast {
        transition: none
    }
}

/* Desktop */
@media (width >= 760px) and (aspect-ratio > 9/10) {
    .bg {
        background: none
    }

    .bg::before {
        content: none
    }

    .photo {
        display: block;
        position: absolute;
        left: 0;
        top: 70%;
        transform: translate(-14%, -70%);
        /* как на главной, но от размеров .bg, а не экрана: страница бывает выше экрана */
        width: max(117cqw, calc(100cqh * 1.7768));
        aspect-ratio: 1672/941;
        background: url(/img/bg-desktop.webp) 0 0/100% 100% no-repeat
    }

    .label {
        left: 17.9%;
        top: 57.2%;
        width: 8.2%;
        height: 13%
    }

    .label img:first-child {
        width: 30%
    }

    .label img:last-child {
        width: 80%
    }

    .shade {
        background: radial-gradient(ellipse 55% 65% at 50% 45%, rgba(30, 18, 12, .78) 0%,
        rgba(30, 18, 12, .55) 60%, rgba(30, 18, 12, .25) 100%)
    }

    .page {
        gap: 28px;
        padding: clamp(20px, 5vh, 56px) 20px 40px
    }

    .is-result .page {
        padding-top: clamp(20px, 5vh, 56px)
    }

    /* Меню в потоке, по ширине — как колонка афиши и сертификатов (light.css): при переходах между ними не прыгает */
    .page > .menu {
        position: static;
        align-self: center;
        box-sizing: border-box;
        width: 100%;
        max-width: 640px;
        padding: 0
    }

    .logo img:first-child {
        width: 44px
    }

    .logo img:last-child {
        width: 160px
    }

    .card {
        padding: 40px 44px
    }

    .r-more {
        padding: 28px 32px
    }

    .r-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center
    }
}

/* Широкий десктоп: колонка меню 1200px и поля 40px — как в light.css */
@media (width >= 1024px) and (aspect-ratio > 9/10) {
    .page {
        padding-left: 40px;
        padding-right: 40px
    }

    .page > .menu {
        max-width: 1200px
    }
}
