/* ============================================================
   Стьюдент — экраны Mini App: регистрация по шагам, вкладки
   «Настройки» / «Главная» / «Приглашения», таб-бар iOS 26.
   Подключается после base.css.
   ============================================================ */

/* ---------------- Экраны ---------------- */
/* Каждый экран — отдельный слой со своей прокруткой. Переходы между ними
   (въезд справа, как в UINavigationController) анимирует app.js. */
.view{
  position:fixed;
  inset:0;
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  background:var(--page);
  visibility:hidden;
}
.view.is-active{visibility:visible}
.view--tabs{overflow:hidden}
.view.has-cta .page{padding-bottom:calc(150px + var(--safe-bottom))}

/* ---------------- Загрузка и заглушки ---------------- */
.center{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  min-height:100%;
  padding:32px;
  text-align:center;
}
.center .spinner{width:28px;height:28px}
.center__logo{width:88px;height:88px;border-radius:22px;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.center__title{margin:6px 0 0;font-size:22px;font-weight:700;letter-spacing:-.5px}
.center__text{margin:0;max-width:300px;font-size:15px;line-height:1.4;color:var(--hint)}

/* ---------------- Шаги регистрации ---------------- */
.steps{margin:0 0 18px}
.steps__label{
  display:block;
  margin:0 0 7px;
  font-size:13px;
  font-weight:600;
  letter-spacing:.2px;
  text-transform:uppercase;
  color:var(--accent);
}
.steps__bar{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.steps__bar i{
  height:4px;
  border-radius:2px;
  background:var(--fill);
  overflow:hidden;
}
.steps__bar i::after{
  content:"";
  display:block;
  height:100%;
  border-radius:inherit;
  background:var(--accent);
  transform:scaleX(0);
  transform-origin:left;
  transition:transform .5s cubic-bezier(.22,1,.36,1);
}
.steps__bar i.is-done::after{transform:none}
.view[data-mode="edit"] .steps,
.view[data-mode="edit"] .intro{display:none}

.intro{display:flex;align-items:center;gap:14px;margin:0 0 18px}
.intro__logo{
  flex:0 0 auto;
  width:60px;
  height:60px;
  border-radius:16px;
  box-shadow:0 6px 18px rgba(0,0,0,.12),0 0 0 .5px rgba(0,0,0,.06);
}
.intro__name{display:block;font-size:20px;font-weight:700;letter-spacing:-.4px}
.intro__text{display:block;margin-top:2px;font-size:14px;line-height:1.35;color:var(--hint)}

.view-head{margin-bottom:14px}

/* ---------------- Поиск ---------------- */
/* строка поиска прилипает к верху экрана под стеклом шапки */
.search{
  position:sticky;
  top:calc(var(--topbar-h) - 2px);
  z-index:5;
  margin:0 calc(-1 * var(--gap)) 10px;
  padding:6px var(--gap) 8px;
}
.search::before{
  content:"";
  position:absolute;
  inset:0;
  background:var(--bar);
  opacity:var(--title-progress,0);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  backdrop-filter:saturate(180%) blur(20px);
  box-shadow:inset 0 -0.5px 0 var(--bar-line);
}
.search__field{
  position:relative;
  display:flex;
  align-items:center;
  gap:6px;
  height:40px;
  padding:0 10px;
  border-radius:12px;
  background:color-mix(in srgb,var(--card) 70%,var(--fill));
}
html[data-theme="dark"] .search__field{background:var(--fill)}
.search__icon{width:18px;height:18px;flex:0 0 auto;color:var(--hint)}
.search__input{
  flex:1 1 auto;
  min-width:0;
  height:100%;
  border:0;
  background:none;
  outline:none;
  color:var(--card-text);
  font:inherit;
  font-size:17px;
  letter-spacing:-.4px;
  -webkit-appearance:none;
  appearance:none;
}
.search__input::placeholder{color:var(--hint)}
.search__input::-webkit-search-cancel-button{display:none}
.search__clear{
  display:none;
  flex:0 0 auto;
  width:28px;
  height:28px;
  margin-right:-6px;
  padding:5px;
  border:0;
  background:none;
  color:var(--hint);
  cursor:pointer;
}
.search__clear svg{width:18px;height:18px;fill:currentColor;display:block}
.search.has-text .search__clear{display:block}

.uni-list .row{min-height:58px}
.uni-list .row__label{font-weight:500}
.uni-list mark{background:none;color:var(--accent)}
.empty{
  padding:26px 20px;
  text-align:center;
  font-size:15px;
  line-height:1.4;
  color:var(--hint);
}
.empty b{display:block;margin-bottom:4px;font-size:17px;color:var(--card-text);font-weight:600}
.empty .btn{margin-top:14px}

/* ---------------- Нижняя панель с кнопкой ---------------- */
.cta{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:12;
  padding:22px var(--gap) calc(14px + var(--safe-bottom));
  background:linear-gradient(to bottom,transparent,var(--page) 26px);
}
.cta__inner{max-width:528px;margin:0 auto}
.cta__links{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:2px 14px;
}
.cta__links .link{font-size:15px}
.cta__hint{
  margin:10px 0 0;
  text-align:center;
  font-size:13px;
  line-height:1.35;
  color:var(--hint);
}

/* ---------------- Свой вуз ---------------- */
.field{
  display:block;
  width:100%;
  min-height:52px;
  padding:14px 16px;
  border:0;
  background:none;
  outline:none;
  color:var(--card-text);
  font:inherit;
  font-size:17px;
  letter-spacing:-.4px;
}
.field::placeholder{color:var(--hint)}
.tag-preview{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:6px;
  background:color-mix(in srgb,var(--accent) 14%,transparent);
  color:var(--accent);
  font-weight:600;
}

/* ---------------- Правила ---------------- */
.rules .row{align-items:flex-start;padding-top:12px;padding-bottom:12px}
.rules .row__icon{margin-top:-2px}
.rules .row__label{font-size:16px;line-height:1.35}
.rule-mark{
  flex:0 0 auto;
  width:24px;
  height:24px;
  margin-top:-1px;
  fill:currentColor;
}
.rule-mark--ok{color:var(--green)}
.rule-mark--no{color:var(--danger)}
.rules--marks{--sep-inset:52px}
.accept .row__label{font-weight:500}

/* ---------------- Вкладки ---------------- */
.panel{
  --shift:0px;
  position:absolute;
  inset:0;
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  opacity:0;
  visibility:hidden;
  translate:var(--shift) 0;
  transition:opacity .18s ease,translate .32s cubic-bezier(.22,1,.36,1),visibility 0s linear .32s;
}
.panel.is-active{
  opacity:1;
  visibility:visible;
  translate:0 0;
  transition:opacity .26s ease .04s,translate .42s cubic-bezier(.22,1,.36,1),visibility 0s;
}
.panel.no-anim{transition:none}
/* открыт другой экран — активная вкладка не должна «просвечивать» сквозь скрытый родитель */
.view:not(.is-active) .panel.is-active{visibility:hidden}
.view--tabs{
  --tabbar-h:62px;
  --tabbar-bottom:max(22px,calc(var(--safe-bottom) + 4px));
}
.panel .page{padding-bottom:calc(var(--tabbar-h) + var(--tabbar-bottom) + 28px)}
body.tabs-on{--toast-bottom:calc(62px + 12px + max(22px,calc(var(--safe-bottom) + 4px)) - var(--safe-bottom))}

/* ---------------- Главная: «Регистрация пройдена» ---------------- */
/* блок выезжает сверху: ячейка раскрывается, карточка пружинит */
.slot{
  display:grid;
  grid-template-rows:0fr;
  transition:grid-template-rows .55s cubic-bezier(.22,1,.36,1);
}
.slot__inner{min-height:0;overflow:hidden}
.slot .card{
  margin-bottom:20px;
  opacity:0;
  transform:translateY(-18px) scale(.94);
  transition:opacity .35s ease .08s,transform .6s cubic-bezier(.3,1.3,.5,1) .04s;
}
.slot.is-shown{grid-template-rows:1fr}
.slot.is-shown .card{opacity:1;transform:none}
.slot.is-open .slot__inner{overflow:visible}

.done{
  position:relative;
  padding:22px 20px 20px;
  text-align:center;
  background:
    radial-gradient(120% 90% at 50% 0%,color-mix(in srgb,var(--green) 16%,transparent),transparent 70%),
    var(--card);
}
.done__icon{
  display:grid;
  place-items:center;
  width:64px;
  height:64px;
  margin:0 auto 12px;
  border-radius:50%;
  background:linear-gradient(180deg,#5fe07f,var(--green));
  color:#fff;
  box-shadow:0 10px 24px -10px var(--green);
}
.done__icon svg{width:34px;height:34px;fill:none}
.slot.is-shown .done__icon{animation:pop .7s cubic-bezier(.3,1.5,.5,1) .15s both}
@keyframes pop{from{transform:scale(.4);opacity:0}}
.done__title{margin:0 0 6px;font-size:22px;font-weight:700;letter-spacing:-.5px}
.done__text{margin:0;font-size:16px;line-height:1.4;color:var(--value)}
.done__tag{margin-top:12px}
.done__close{
  position:absolute;
  top:10px;
  right:10px;
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  padding:0;
  border:0;
  border-radius:50%;
  background:var(--fill);
  color:var(--hint);
  cursor:pointer;
}
.done__close svg{width:14px;height:14px}

.chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  max-width:100%;
  padding:4px 10px;
  border-radius:999px;
  background:color-mix(in srgb,var(--accent) 13%,transparent);
  color:var(--accent);
  font-size:14px;
  font-weight:600;
  letter-spacing:-.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.chip svg{width:13px;height:13px;fill:currentColor;flex:0 0 auto}

/* «Перейти на форум» — крупная строка с логотипом */
.forum .row{min-height:72px;gap:14px}
.forum .row__icon{width:46px;height:46px;border-radius:12px;background:#fff;box-shadow:0 0 0 .5px rgba(0,0,0,.08)}
.forum .row__label{font-size:17px;font-weight:600}

/* ---------------- Настройки: профиль ---------------- */
.profile{display:flex;align-items:center;gap:14px;padding:14px 16px}
.profile .ava{--ava:60px}
.profile__text{flex:1 1 auto;min-width:0}
.profile__name{
  display:block;
  font-size:20px;
  font-weight:600;
  letter-spacing:-.4px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.profile__sub{display:block;margin-top:2px;font-size:14px;color:var(--hint)}
.profile .chip{margin-top:6px}

.about{
  margin:28px 0 0;
  text-align:center;
  font-size:13px;
  line-height:1.5;
  color:var(--hint);
}
.about img{width:44px;height:44px;border-radius:12px;display:block;margin:0 auto 8px;opacity:.95}

/* ---------------- Приглашения ---------------- */
.hero{padding:18px 16px 16px}
.hero__icon{
  display:grid;
  place-items:center;
  width:50px;
  height:50px;
  border-radius:14px;
  background:linear-gradient(180deg,rgba(255,255,255,.28),rgba(255,255,255,0) 72%),var(--icon-bg,#007aff);
  color:#fff;
  box-shadow:0 8px 18px -10px var(--icon-bg,#007aff);
}
.hero__icon svg{width:28px;height:28px;fill:currentColor}
.hero__icon img{width:100%;height:100%;border-radius:inherit}
.hero__title{margin:12px 0 4px;font-size:24px;font-weight:700;line-height:1.15;letter-spacing:-.6px}
.hero__text{margin:0;font-size:15px;line-height:1.4;color:var(--value)}

.linkcard{padding:16px}
.linkcard__title{margin:0 0 2px;font-size:20px;font-weight:700;letter-spacing:-.4px}
.linkcard__hint{margin:0 0 12px;font-size:14px;line-height:1.35;color:var(--hint)}
.linkcard__field{
  display:block;
  width:100%;
  padding:13px 14px;
  border:0;
  border-radius:13px;
  background:var(--fill);
  color:var(--card-text);
  font:500 15px/1.3 ui-monospace,"SF Mono",Menlo,monospace;
  letter-spacing:-.3px;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:pointer;
}
.linkcard__field:active{opacity:.7}
.linkcard__actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-top:10px}
.linkcard__actions .btn{padding:0 12px;min-width:0}
.linkcard__actions .btn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.card--people{--sep-inset:64px}
.card--people .ava{--ava:36px}
.card--people .row__value{flex:0 0 auto;max-width:none;font-size:15px}
.badge-new{
  display:inline-block;
  margin-left:6px;
  padding:1px 6px;
  border-radius:5px;
  background:var(--fill);
  color:var(--hint);
  font-size:11px;
  font-weight:600;
  vertical-align:2px;
}

/* ---------------- Таб-бар iOS 26 ---------------- */
/* жидкое стекло: капсула с размытием, бликом по кромке и «линзой» под
   активной вкладкой, которая перетекает и тянется за пальцем */
.tabbar{
  --lens-x:0px;
  --lens-w:33.333%;
  position:absolute;
  left:50%;
  bottom:var(--tabbar-bottom);
  z-index:20;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  width:min(calc(100% - 64px),330px);
  height:var(--tabbar-h);
  padding:4px;
  border-radius:999px;
  translate:-50% 0;
  background:var(--glass);
  box-shadow:var(--glass-shadow);
  -webkit-backdrop-filter:blur(14px) saturate(190%);
  backdrop-filter:blur(14px) saturate(190%);
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
}
.tabbar::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  padding:1px;
  background:linear-gradient(135deg,var(--glass-edge),transparent 38%,transparent 62%,var(--glass-edge));
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  pointer-events:none;
}
.tabbar__lens{
  position:absolute;
  top:4px;
  bottom:4px;
  left:4px;
  width:var(--lens-w);
  border-radius:999px;
  background:var(--lens);
  translate:var(--lens-x) 0;
  transition:translate .5s cubic-bezier(.3,1.35,.45,1),scale .3s cubic-bezier(.3,1.35,.45,1),background .25s ease,box-shadow .25s ease;
  pointer-events:none;
}
.tabbar:not(.is-ready) .tabbar__lens{transition:none}
.tabbar.is-moving .tabbar__lens{scale:1.14 .9}
.tabbar.is-dragging .tabbar__lens{
  scale:1.18 1.12;
  background:rgba(255,255,255,.18);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.9),inset 0 -1px 2px rgba(0,0,0,.08),0 6px 18px rgba(0,0,0,.14);
  transition:translate .12s ease-out,scale .3s cubic-bezier(.3,1.35,.45,1),background .2s ease,box-shadow .2s ease;
}
html[data-theme="dark"] .tabbar.is-dragging .tabbar__lens{
  background:rgba(255,255,255,.1);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.35),0 6px 18px rgba(0,0,0,.4);
}
.tabbar__item{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  min-width:0;
  padding:0 4px;
  border:0;
  border-radius:999px;
  background:none;
  color:var(--card-text);
  font-size:10.5px;
  font-weight:600;
  line-height:1.1;
  letter-spacing:.1px;
  cursor:pointer;
  transition:color .2s ease;
  -webkit-appearance:none;
  appearance:none;
}
.tabbar__item svg{width:27px;height:27px;fill:currentColor}
.tabbar__item span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tabbar__item[aria-selected="true"],.tabbar__item.is-hover{color:var(--accent)}
.tabbar.is-dragging .tabbar__item[aria-selected="true"]:not(.is-hover){color:var(--card-text)}
.tabbar__item:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}

@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .tabbar,.toast{background:var(--card)}
}
