/* =====================================================================
   ТЕСТ СТИЛЯ EMIRELLE — стили. Размеры и цвета взяты из макета Pencil
   (экраны 390 px для телефона и 1440 px для ПК).
   ===================================================================== */

:root {
  --ink: #0E0E0E;        /* основной чёрный */
  --paper: #F4F3F1;      /* светлый фон заглушек */
  --mute: #7A7876;       /* серый текст */
  --faint: #ABA9A6;      /* бледный текст невыбранных вещей */
  --line: #DDDCDA;       /* пустые полоски прогресса */
  --divider: #E4E3E1;
  --text: #3A3836;       /* описание стиля */
  --online: #22C55E;

  --f-head: "Unbounded", system-ui, sans-serif;  /* заголовки и подписи */
  --f-body: "Montserrat", system-ui, sans-serif; /* обычный текст */
  --f-logo: "Tenor Sans", system-ui, sans-serif; /* логотип */

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*, ::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--f-body); -webkit-tap-highlight-color: transparent; }
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
svg { width: 100%; height: 100%; display: block; }

/* Подписи в стиле макета: Unbounded, капс, разрядка */
.kicker, .btn, .option__name, .tag, .pick__name, .pick__add, .picks__count, .link-back, .step__hint,
.saved-field, .result__links a, .result__links button, .stylist, .menu__item, .menu__links a, .bar__nav a,
.saved-row__name, .saved__back, .start__meta, .start__corner, .ph {
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: 1.4px;
}
.kicker { margin: 0; font-size: 10px; font-weight: 300; letter-spacing: 2px; color: #fff; }
.kicker--mute { color: var(--mute); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 30px; font-size: 11px; font-weight: 400; letter-spacing: 1.6px;
       transition: transform .16s var(--ease-out), opacity .2s; }
.btn:active { transform: scale(.97); }
.btn--white { background: #fff; color: var(--ink); padding: 18px 56px; }
.btn--black { background: var(--ink); color: #fff; height: 50px; width: 100%; font-size: 10px; }
.btn:disabled { opacity: .3; cursor: default; transform: none; }

/* ---------- Заглушка, пока нет фото ---------- */
.ph { display: grid; place-items: center; width: 100%; height: 100%; min-height: 80px; background: var(--paper); color: var(--faint); font-size: 8px; font-weight: 300; }

/* =================== ШАПКА =================== */
.bar { position: absolute; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
       padding: calc(20px + env(safe-area-inset-top)) 18px 0; color: var(--ink); }
body[data-view="start"] > .bar { color: #fff; }
.bar__side { width: 80px; display: flex; }
.bar__side--right { justify-content: flex-end; }
.icon-btn { width: 22px; height: 22px; display: block; }
.logo { font-family: var(--f-logo); font-size: 24px; letter-spacing: 1px; line-height: 1; }
.bar__nav { display: none; }

/* Экраны ниже шапки: место под неё */
.view { display: none; }
.view.is-active { display: block; animation: viewIn .32s var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.step, .result, .saved { padding-top: calc(42px + env(safe-area-inset-top)); }

/* =================== 1. СТАРТ =================== */
.start { --under-bar: 0px; position: relative; overflow: hidden; background: #1A1A1A; color: #fff;
         height: calc(100vh + var(--under-bar)); height: calc(100lvh + var(--under-bar)); min-height: 600px; }
.start.is-active { display: block; }
.start__photos { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr 1fr; }
.start__photo { position: relative; background-size: cover; background-position: center 30%; }
.start__photo::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .22); }
.start__shade { position: absolute; left: -80px; right: -80px; top: 13%; height: 62%;
                background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 100%); }
/* Текст — в видимой части экрана (без полосы под панелью браузера) */
.start__inner { position: relative; z-index: 3; height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
                gap: 14px; padding: 40px 32px 0; text-align: center; }
.start__text { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 16px; }
.start__title { margin: 0; font-family: var(--f-head); font-size: 26px; font-weight: 600; letter-spacing: 1px; line-height: 27px; text-transform: uppercase; }
.start__desc { margin: 0; max-width: 300px; font-size: 14px; line-height: 21px; color: rgba(255,255,255,.9); }
.start__cta { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.start__meta { font-size: 9px; font-weight: 300; letter-spacing: 1.8px; color: rgba(255,255,255,.85); }
.start__corner { display: none; }
.start .kicker { animation: rise .6s var(--ease-out) both; }
.start__title { animation: rise .6s .08s var(--ease-out) both; }
.start__desc { animation: rise .6s .16s var(--ease-out) both; }
.start__cta { animation: rise .6s .24s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* =================== 2. ШАГ ТЕСТА =================== */
.step { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.step__head { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 20px 24px; text-align: center; }
.progress { display: flex; gap: 4px; width: 120px; }
.progress i { flex: 1; height: 2px; background: var(--line); transition: background .3s; }
.progress i.on { background: var(--ink); }
.step__question { margin: 0; max-width: 300px; font-family: var(--f-body); font-size: 26px; font-weight: 500; letter-spacing: -.5px; line-height: 28px; }

.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 12px; }
.option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 250px;
          padding: 30px 26px 14px; background: #fff;
          transition: padding .28s var(--ease-out), opacity .2s, transform .16s var(--ease-out); }
.option:active { transform: scale(.97); }
.option__item { position: relative; width: 100%; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; transition: opacity .2s; }
.option__item img { width: 100%; height: 100%; object-fit: contain; transform: scale(var(--zoom, 1)); }
.option__name { font-size: 8px; font-weight: 300; color: var(--ink); text-align: center; white-space: nowrap; transition: color .2s; }
/* Когда что-то выбрано: выбранная вещь крупнее, остальные бледнее (как в макете) */
.options.has-pick .option:not(.is-picked) .option__item { opacity: .55; }
.options.has-pick .option:not(.is-picked) .option__name { color: var(--faint); }
.option.is-picked { padding: 8px 6px 14px; }
.option.is-picked .option__name { font-weight: 500; }

.step__footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 22px 0; }
.link-back { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 300; letter-spacing: 1.6px; color: var(--mute); white-space: nowrap; }
.link-back .chev { font-family: var(--f-body); font-size: 16px; }
.step__next { flex: 1; height: auto; padding: 18px 0; font-size: 11px; }
.step__hint { display: none; font-size: 11px; font-weight: 300; letter-spacing: 1.6px; color: var(--mute); }

/* =================== 3. РЕЗУЛЬТАТ =================== */
.result { display: none; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.result.is-active { display: flex; flex-direction: column; }
.result__info { display: contents; }
.result__head { order: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 20px 18px; text-align: center; }
.result__head .kicker { font-size: 9px; font-weight: 400; letter-spacing: 1.4px; }
.result__name { margin: 0; font-family: var(--f-head); font-size: 22px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.result__look { order: 2; height: 430px; display: flex; justify-content: center; }
.result__look img { height: 100%; width: auto; object-fit: contain; }
.ph--look { width: 62%; font-size: 9px; }
.result__about { order: 3; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 18px 32px 40px; }
.result__desc { margin: 0; max-width: 300px; font-size: 14px; line-height: 22px; color: var(--text); text-align: center; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tag { padding: 7px 11px; border: 1px solid var(--ink); border-radius: 20px; font-size: 9px; font-weight: 300; }
.divider { height: 1px; background: var(--divider); width: 100%; }
.result > .result__info > .divider.pc-only, .pc-only { display: none; }

.picks__head { order: 4; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 16px; }
.picks__head h3 { margin: 0; font-family: var(--f-head); font-size: 14px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.picks__count { font-size: 9px; font-weight: 300; color: var(--mute); }
.picks { order: 5; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 8px; padding: 0 12px; }
.pick { display: flex; flex-direction: column; gap: 12px; }
.pick__photo { position: relative; height: 250px; overflow: hidden; display: grid; place-items: center; }
.pick__photo img { width: 100%; height: 100%; object-fit: contain; transform: scale(var(--zoom, 1)); }
.pick__heart { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 16px; background: rgba(255,255,255,.9);
               color: var(--ink); display: grid; place-items: center; transition: background .2s, color .2s, transform .16s var(--ease-out); }
.pick__heart svg { width: 16px; height: 16px; }
.pick__heart:active { transform: scale(.9); }
.pick.is-saved .pick__heart { background: var(--ink); color: #fff; }
.pick__info { display: flex; flex-direction: column; gap: 12px; padding: 0 12px; }
.pick__name { margin: 0; font-size: 9px; font-weight: 400; line-height: 12px; min-height: 24px; } /* место под 2 строки — кнопки в ряду на одной линии */
.pick__add { height: 36px; border-radius: 18px; border: 1px solid var(--ink); background: #fff; color: var(--ink); font-size: 9px; font-weight: 300;
             transition: background .2s, color .2s, transform .16s var(--ease-out); }
.pick__add:active { transform: scale(.97); }
.pick.is-saved .pick__add { background: var(--ink); color: #fff; }

.result__actions { order: 6; display: flex; flex-direction: column; gap: 14px; padding: 36px 20px 0; }
.saved-field { display: flex; align-items: center; justify-content: space-between; height: 50px; padding: 0 22px; border: 1px solid var(--divider);
               border-radius: 25px; font-size: 10px; font-weight: 300; }
.saved-field [data-icon] { width: 20px; height: 20px; }
.result__links { order: 7; display: flex; justify-content: space-between; padding: 30px 20px 14px; }
.result__links a, .result__links button { font-size: 10px; font-weight: 300; }
.result__info > .divider:not(.pc-only) { order: 8; width: auto; margin: 0 20px; }
.stylist { order: 9; display: inline-flex; align-items: center; gap: 8px; margin: 14px 20px 0; font-size: 10px; font-weight: 300; align-self: flex-start; }
.stylist__chat { position: relative; width: 18px; height: 18px; padding: 1px; }
.stylist__chat i { position: absolute; top: 0; left: 13px; width: 5px; height: 5px; border-radius: 50%; background: var(--online); }

/* =================== ОТЛОЖЕНО =================== */
.saved.is-active { display: flex; flex-direction: column; min-height: 100svh; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.saved__head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 20px 22px; }
.saved__head .kicker { font-size: 9px; letter-spacing: 1.4px; }
.saved__title { margin: 0; font-family: var(--f-head); font-size: 22px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.saved__list { padding: 0 20px; flex: 1; }
.saved-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--divider); }
.saved-row__photo { width: 96px; height: 120px; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; }
.saved-row__photo img { width: 100%; height: 100%; object-fit: contain; transform: scale(var(--zoom, 1)); }
.saved-row__text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.saved-row__name { margin: 0; font-size: 10px; font-weight: 300; }
.saved-row__sub { margin: 0; font-size: 12px; color: var(--mute); }
.saved-row__x { width: 18px; height: 18px; color: var(--ink); }
.saved__empty { margin: 24px 0; text-align: center; font-size: 13px; line-height: 20px; color: var(--mute); }
.saved__footer { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 20px 0; }
.saved__note { margin: 0; text-align: center; font-size: 13px; line-height: 20px; color: var(--mute); }
.saved__back { font-size: 9px; font-weight: 300; padding: 6px 0; }

/* =================== МЕНЮ =================== */
.menu { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column;
        padding-bottom: calc(32px + env(safe-area-inset-bottom)); opacity: 0; visibility: hidden; transform: translateY(-8px);
        transition: opacity .24s var(--ease-out), transform .24s var(--ease-out), visibility 0s .24s; }
.menu.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .24s var(--ease-out), transform .24s var(--ease-out); }
.bar--menu { position: static; }
.menu__list { display: flex; flex-direction: column; padding: 48px 20px 0; }
.menu__item { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--divider);
              font-size: 13px; font-weight: 300; }
.menu__item--main { font-weight: 500; }
.menu__item [data-icon] { width: 18px; height: 18px; }
.menu__n { font-size: 10px; color: var(--mute); }
.menu.is-open .menu__item { animation: rise .4s var(--ease-out) both; }
.menu.is-open .menu__item:nth-child(2) { animation-delay: .05s; }
.menu.is-open .menu__item:nth-child(3) { animation-delay: .1s; }
.menu.is-open .menu__item:nth-child(4) { animation-delay: .15s; }
.menu__contacts { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding: 0 20px; }
.menu__contacts .kicker { font-size: 9px; letter-spacing: 1.4px; }
.menu__links { display: flex; gap: 28px; }
.menu__links a { font-size: 10px; font-weight: 300; }

/* =================== ТОСТ =================== */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px);
         padding: 12px 18px; border-radius: 22px; background: var(--ink); color: #fff; font-size: 13px; opacity: 0; pointer-events: none;
         transition: opacity .2s, transform .25s var(--ease-out); white-space: nowrap; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   ПК (по макетам PC 01–03, ширина 1440)
   ===================================================================== */
@media (min-width: 1024px) {
  .bar { padding: 30px 48px 0; }
  .bar__side { display: none; }
  .bar__nav { display: flex; align-items: center; gap: 44px; width: 420px; }
  .bar__nav--right { justify-content: flex-end; }
  .bar__nav a { font-size: 10px; font-weight: 300; letter-spacing: 1.6px; }
  .saved-link { display: inline-flex; align-items: center; gap: 8px; }
  .saved-link [data-icon] { width: 20px; height: 20px; }
  .logo { font-size: 34px; letter-spacing: 1.5px; }
  .step, .result, .saved { padding-top: 70px; }

  /* Старт: две фотографии рядом, заголовок по центру, капсула внизу */
  .start { height: 100vh; min-height: 720px; }
  .start__photos { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .start__photo::after { background: rgba(0,0,0,.25); }
  .start__shade { left: 22%; right: 22%; top: 11%; height: 78%;
                  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0,0,0,.65) 0%, rgba(0,0,0,.35) 50%, rgba(0,0,0,0) 100%); }
  .start__inner { height: 100%; justify-content: flex-start; padding: 0; }
  .start__text { position: absolute; top: 21%; left: 50%; transform: translateX(-50%); width: 600px; gap: 22px; padding: 0; }
  .start .kicker { letter-spacing: 2.4px; }
  .start__title { font-size: 84px; line-height: 82px; }
  .start__desc { max-width: none; font-size: 16px; font-weight: 500; color: #fff; }
  .m-only { display: none; }
  .start__cta { position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%); flex-direction: row; gap: 0;
                width: 530px; height: 56px; padding: 4px; border-radius: 28px; background: #fff; animation-name: riseX; }
  @keyframes riseX { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
  .start__cta .btn--white { flex: 1; height: 100%; padding: 0; background: var(--ink); color: #fff; border-radius: 24px; font-size: 10px; }
  .start__meta { flex: 1; text-align: center; color: var(--mute); font-size: 10px; letter-spacing: 1.6px; }
  .start__corner { display: block; position: absolute; z-index: 3; bottom: 96px; font-size: 14px; font-weight: 300; letter-spacing: 1.6px; color: #fff; }
  .start__corner--left { left: 48px; }
  .start__corner--right { right: 48px; }

  /* Шаг: вещи в один ряд, кнопка по центру */
  .step { display: none; min-height: 100vh; padding-bottom: 40px; }
  .step.is-active { display: flex; flex-direction: column; }
  .step__head { gap: 16px; padding: 24px 0 20px; }
  .progress { width: 160px; gap: 5px; }
  .step .kicker { letter-spacing: 1.6px; }
  .step__question { max-width: none; font-size: 36px; letter-spacing: -.6px; line-height: normal; }
  .options { flex: 1; display: flex; gap: 24px; padding: 10px 120px; }
  .option { flex: 1; height: auto; min-height: 420px; justify-content: flex-start; gap: 16px; padding: 40px 34px 0; }
  .option.is-picked { padding: 0; }
  .option__item { flex: 1; }
  .option__name { font-size: 10px; letter-spacing: 1.6px; }
  .step__footer { padding: 28px 120px 0; }
  .step__next { flex: 0 0 420px; height: 54px; padding: 0; border-radius: 27px; }
  .step__hint { display: block; }

  /* Результат: образ слева, информация справа */
  .result.is-active { flex-direction: row; align-items: flex-start; gap: 96px; padding: 20px 120px 72px 120px; padding-top: 110px; }
  .result__look { order: 0; flex: 0 0 520px; height: 860px; }
  .result__look img { width: 100%; object-fit: cover; }
  .ph--look { width: 100%; }
  .result__info { display: flex; flex-direction: column; gap: 28px; flex: 1; padding-top: 40px; }
  .result__head { align-items: flex-start; gap: 14px; padding: 0; text-align: left; }
  .result__head .kicker { font-size: 10px; font-weight: 300; letter-spacing: 1.6px; }
  .result__name { font-size: 34px; }
  .result__about { align-items: flex-start; padding: 0; gap: 28px; }
  .result__desc { max-width: 440px; font-size: 15px; line-height: 24px; text-align: left; }
  .tags { justify-content: flex-start; gap: 8px; }
  .tag { padding: 8px 14px; letter-spacing: 1.6px; }
  .pc-only, .result > .result__info > .divider.pc-only { display: block; }
  .picks__head { padding: 0; }
  .picks__count { font-size: 10px; letter-spacing: 1.6px; }
  .picks { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 16px; padding: 0; }
  .pick__photo { height: 190px; }
  .pick__heart { top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 14px; }
  .pick__heart svg { width: 14px; height: 14px; }
  .pick__info { padding: 0; }
  .pick__name { font-size: 8px; font-weight: 300; line-height: 12px; min-height: 26px; letter-spacing: 1.6px; }
  .pick__add { font-size: 8px; letter-spacing: 1.6px; }
  .result__actions { flex-direction: row; padding: 8px 0 0; }
  .result__actions > * { flex: 1; height: 52px; border-radius: 26px; }
  .saved-field { padding: 0 24px; }
  .result__links { padding: 8px 0 0; }
  .result__links a, .result__links button { letter-spacing: 1.6px; }
  .result__info > .divider:not(.pc-only) { margin: 0; }
  .stylist { margin: 0; }

  /* Отложено и меню на ПК — по центру узкой колонкой */
  .saved.is-active { max-width: 560px; margin: 0 auto; padding-top: 110px; min-height: 100vh; }
  .saved__footer .btn { max-width: 420px; }
}

/* Наведение — только мышью */
@media (hover: hover) and (pointer: fine) {
  .btn--black:not(:disabled):hover { opacity: .85; }
  .option:hover .option__item { opacity: 1 !important; }
  .bar__nav a:hover, .start__corner:hover, .result__links a:hover, .result__links button:hover { opacity: .6; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
}
