/* Генератор аватаров «Новые люди» — стили мастера.
   Дизайн-токены из макета, корпоративный шрифт New People. */

:root{
  --accent:#1AC2BB; --accent-dark:#12908B;
  --cta:#DB2D44; --cta-dark:#C42539;
  --ink:#151515; --muted:#6E7275; --faint:#9A9D9F;
  --line:#E8E9EA; --field-border:#DCDEDF;
  --sel-bg:#F1FBFB; --page:#F4F5F5;
  --radius:16px; --radius-lg:20px;
  --font:"New People","Helvetica Neue",Arial,sans-serif;
}

*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0}
body{
  background:var(--page); color:var(--ink);
  font-family:var(--font); -webkit-font-smoothing:antialiased;
  font-weight:400;
}
img{display:block; max-width:100%}
button{font-family:inherit}

.app{max-width:1440px; margin:0 auto; padding:0 32px 80px}

/* Шапка */
.topbar{
  height:76px; display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid #F0F1F1;
}
.topbar__logo{height:34px}
.topbar__link{font-size:15px; font-weight:500; color:var(--muted); text-decoration:none}
.topbar__link:hover{color:var(--ink)}

/* Степпер */
.stepper{display:flex; align-items:center; gap:14px; padding:22px 0; flex-wrap:wrap}
.stepper__item{display:flex; align-items:center; gap:10px}
.stepper__num{
  width:26px; height:26px; border-radius:50%; background:#fff; border:1px solid #E0E2E3;
  color:#A6A9AB; font-size:13px; font-weight:700; display:flex; align-items:center; justify-content:center;
}
.stepper__label{font-size:15px; font-weight:500; color:#A6A9AB}
.stepper__line{width:44px; height:1px; background:var(--line)}
.stepper__item.is-active .stepper__num{background:var(--accent); border-color:var(--accent); color:#fff}
.stepper__item.is-active .stepper__label{color:var(--ink); font-weight:700}
.stepper__item.is-done .stepper__num{background:var(--accent); border-color:var(--accent); color:#fff}
.stepper__item.is-done .stepper__label{color:var(--ink)}

/* Экраны */
.screens{position:relative}
.screen{display:none; padding-top:28px}
.screen.is-active{display:block; animation:fade .25s ease}
.screen--center{text-align:center; display:none; flex-direction:column; align-items:center; gap:18px; padding-top:80px}
.screen--center.is-active{display:flex}
@keyframes fade{from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none}}

/* Заголовки */
.hero{max-width:640px; margin-bottom:36px}
.hero__title{font-size:42px; font-weight:800; letter-spacing:-.02em; line-height:1.08; margin:0}
.hero__sub{margin:14px 0 0; font-size:17px; line-height:1.55; color:var(--muted)}
.section-title{font-size:22px; font-weight:700; margin:0}
.section-note{margin:8px 0 0; font-size:15px; color:var(--muted)}
.screen-title{font-size:30px; font-weight:700; margin:0}
.screen-sub{margin:10px 0 0; font-size:16px; line-height:1.55; color:var(--muted)}
.center-head{text-align:center; max-width:600px; margin:0 auto 32px}

/* Сетка дизайнов: 7 в ряд на десктопе → 4 на планшете → 2 на телефоне */
.grid{margin-top:28px; display:grid; grid-template-columns:repeat(7,1fr); gap:16px}
@media (max-width:1180px){ .grid{grid-template-columns:repeat(4,1fr)} }
@media (max-width:760px){ .grid{grid-template-columns:repeat(3,1fr); gap:12px} }
@media (max-width:520px){ .grid{grid-template-columns:repeat(2,1fr); gap:12px} }
.card{
  padding:12px 12px 14px; border:1px solid var(--line); border-radius:var(--radius);
  background:#fff; cursor:pointer; text-align:center;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover{border-color:var(--accent); box-shadow:0 8px 20px rgba(21,21,21,.07); transform:translateY(-2px)}
.card__img{width:100%; aspect-ratio:1/1; border-radius:50%; overflow:hidden; background:#F7F8F8}
.card__img img{width:100%; height:100%; object-fit:contain}
.card__title{margin-top:12px; font-size:13px; font-weight:600; color:var(--muted)}
.card.is-selected{border:2px solid var(--accent); background:var(--sel-bg); padding:11px 11px 13px; position:relative}
.card.is-selected .card__title{color:var(--ink); font-weight:700}
.card__check{
  position:absolute; top:-9px; right:-9px; width:28px; height:28px; border-radius:50%;
  background:var(--accent); color:#fff; font-size:15px; font-weight:800;
  display:none; align-items:center; justify-content:center; border:2px solid #fff;
}
.card.is-selected .card__check{display:flex}

/* Кнопки */
.btn{
  height:54px; padding:0 34px; border-radius:12px; border:0; cursor:pointer;
  font-size:16px; font-weight:700; display:inline-flex; align-items:center; justify-content:center;
  text-decoration:none;
}
.btn--primary{background:var(--cta); color:#fff}
.btn--primary:hover{background:var(--cta-dark)}
.btn--primary:disabled{background:#F1F1F1; color:#B6B8B9; cursor:not-allowed}
.btn--ghost{background:#fff; border:1px solid var(--field-border); color:var(--ink); font-weight:600}
.btn--ghost:hover{border-color:var(--ink)}
.btn--lg{height:56px; padding:0 40px; font-size:17px}
.btn--sm{height:44px; padding:0 18px; font-size:14px}

/* Панель действий */
.actionbar{margin-top:40px; padding-top:20px; border-top:1px solid #F0F1F1; display:flex; align-items:center; justify-content:space-between; gap:16px}
.actionbar--center{justify-content:center}
.actionbar--left{border-top:0; justify-content:flex-start; padding-top:0; margin-top:32px}
.actionbar__hint{font-size:15px; color:var(--faint)}

/* Загрузка фото */
.upload{display:flex; justify-content:center; margin-top:12px}
.dropzone{
  width:720px; max-width:100%; height:300px; border:1.5px dashed #D6D9DA; border-radius:18px;
  background:#FBFCFC; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
  cursor:pointer; transition:border-color .15s, background .15s;
}
.dropzone.is-over,.dropzone:hover{border-color:var(--accent); background:#F5FCFB}
.dropzone__icon{width:60px; height:60px; border-radius:50%; background:#EAFAF9; color:var(--accent); font-size:26px; font-weight:800; display:flex; align-items:center; justify-content:center}
.dropzone__title{font-size:19px; font-weight:700}
.dropzone__or{font-size:15px; color:var(--muted)}
.dropzone__hint{margin-top:4px; font-size:13px; color:var(--faint)}
.link{color:var(--accent); font-weight:600; border-bottom:1px solid rgba(26,194,187,.4)}

/* Редактор/кроп */
.editor{display:flex; gap:40px; align-items:flex-start; justify-content:center; margin-top:8px}
.editor__side{width:280px; display:flex; flex-direction:column; gap:20px}
.stage{position:relative; width:520px; max-width:100%; aspect-ratio:1/1; border-radius:16px; overflow:hidden; background:#111; touch-action:none}
.stage--round{border-radius:50%; width:440px; background:#DDE3E3}
.stage__canvas{width:100%; height:100%; display:block; cursor:grab}
.stage__canvas:active{cursor:grabbing}
.zoomrow{margin-top:18px; display:flex; align-items:center; gap:14px}
.sqbtn{width:40px; height:40px; border-radius:10px; border:1px solid var(--field-border); background:#fff; font-size:20px; font-weight:700; color:var(--ink); cursor:pointer}
.sqbtn:hover{border-color:var(--accent); color:var(--accent)}
.zoomrow input[type=range]{flex:1 1 auto; accent-color:var(--accent)}

.ref-card{padding:20px; border:1px solid var(--line); border-radius:16px; background:#FBFCFC}
.ref-card__title{font-size:15px; font-weight:700}
.ref-card__img{margin-top:14px; width:100%; border-radius:12px}
.ref-card__note{margin-top:12px; font-size:13px; line-height:1.5; color:var(--muted)}
.tip{padding:16px 18px; border-radius:14px; background:var(--sel-bg); font-size:13px; line-height:1.5; color:var(--accent-dark)}

/* Настройка */
.adjust{display:flex; gap:56px; align-items:flex-start}
.adjust__controls{flex:1 1 0; min-width:0; max-width:520px}
.adjust__preview{flex:0 0 auto; width:520px; max-width:100%; padding:36px; border:1px solid var(--line); border-radius:var(--radius-lg); background:#FBFCFC; display:flex; flex-direction:column; align-items:center; gap:20px}
.preview-title{align-self:flex-start; font-size:15px; font-weight:700}
.preview-note{font-size:13px; color:var(--faint)}
.field{margin-top:26px}
.field__label{font-size:15px; font-weight:700}
.field__hint{margin-top:10px; font-size:13px; color:var(--faint)}

/* Селект региона */
.select{position:relative; margin-top:12px}
.select__btn{width:100%; height:50px; padding:0 16px; border:1px solid var(--field-border); border-radius:10px; background:#fff; display:flex; align-items:center; justify-content:space-between; font-size:15px; cursor:pointer; color:var(--ink)}
.select__btn:hover{border-color:var(--accent)}
.select__chev{color:var(--faint); font-size:12px}
.select__menu{position:absolute; z-index:20; top:56px; left:0; right:0; max-height:280px; overflow-y:auto; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 30px rgba(21,21,21,.12); padding:8px}
.select__opt{width:100%; text-align:left; padding:9px 12px; border:0; background:none; border-radius:6px; font-size:14px; color:var(--ink); cursor:pointer}
.select__opt:hover{background:rgba(0,0,0,.05)}

/* Спиннер */
.spinner{width:44px; height:44px; border-radius:50%; border:3px solid #EAFAF9; border-top-color:var(--accent); animation:spin .9s linear infinite}
.spinner--light{border-color:rgba(255,255,255,.25); border-top-color:#fff}
@keyframes spin{to{transform:rotate(360deg)}}

/* Оверлей загрузки на кроп-стейдже */
.stage__busy{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; background:rgba(17,17,17,.55); backdrop-filter:blur(2px); z-index:5}
.stage__busy-text{color:#fff; font-size:15px; font-weight:600}

/* Результат */
.result-avatar{width:360px; max-width:80vw; aspect-ratio:1/1; border-radius:50%; overflow:hidden; box-shadow:0 12px 40px rgba(21,21,21,.08)}
.result-avatar img{width:100%; height:100%; object-fit:cover}
.result-links{display:flex; gap:20px; flex-wrap:wrap; justify-content:center}
.link-btn{background:none; border:0; font-size:15px; font-weight:600; color:var(--ink); cursor:pointer; border-bottom:1px solid var(--field-border); padding:0 0 2px}
.link-btn:hover{border-color:var(--ink)}
.link-btn--muted{color:var(--muted)}

/* Тост */
.toast{position:fixed; left:50%; bottom:28px; transform:translateX(-50%); background:var(--ink); color:#fff; padding:12px 20px; border-radius:10px; font-size:14px; z-index:50; opacity:0; transition:opacity .2s; pointer-events:none}
.toast.is-show{opacity:1}

/* Адаптив */
@media (max-width:900px){
  .hero__title{font-size:32px}
  .editor{flex-direction:column; align-items:center}
  .editor__side{width:100%; max-width:520px}
  .adjust{flex-direction:column}
  .adjust__preview{width:100%}
  .stage{width:100%; max-width:440px}
}

/* ---------- библиотека фото браузера («Мои фото») ---------- */
.libstrip{
  width:720px; max-width:100%; margin:0 auto 18px; padding:14px 16px;
  border:1px solid var(--line); border-radius:var(--radius); background:#fff;
}
.libstrip__head{font-size:14px; font-weight:600; color:var(--ink); margin-bottom:10px}
.libstrip__hint{font-weight:400; color:var(--muted)}
.libstrip__row{display:flex; gap:10px; padding-bottom:2px}
.libcell{position:relative; flex:0 0 auto; width:72px; height:72px}
.libcell img{
  width:72px; height:72px; border-radius:12px; object-fit:cover; cursor:pointer;
  background:
    linear-gradient(45deg,#eee 25%,transparent 25%,transparent 75%,#eee 75%) 0 0/16px 16px,
    linear-gradient(45deg,#eee 25%,#fff 25%,#fff 75%,#eee 75%) 8px 8px/16px 16px;
  border:1px solid var(--line); transition:border-color .15s ease, transform .15s ease;
}
.libcell img:hover{border-color:var(--accent); transform:translateY(-2px)}
.libcell__del{
  position:absolute; top:-7px; right:-7px; width:22px; height:22px; border-radius:50%;
  border:none; background:var(--cta); color:#fff; font-size:12px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center; box-shadow:0 2px 6px rgba(0,0,0,.2);
}
.libcell__del:hover{background:var(--cta-dark)}
