/* ============================================================
   css/auth.css — кнопка аккаунта в навбаре + модалки входа/регистрации.
   Тема FSI (фиолетовый glassmorphism).
   ============================================================ */

/* ---- Кнопка в навбаре ---- */
.nav-auth {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius:10px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 0.9rem; color: #fff;
  border: 0; background: linear-gradient(135deg, #a466ff, #8e5dff);
  box-shadow: 0 6px 18px rgba(164, 102, 255, 0.3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.nav-auth:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(164, 102, 255, 0.45); }
.nav-auth svg { width: 16px; height: 16px; }

.nav-account {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 6px; border-radius:30px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 0.9rem; color: #fff;
  border: 1px solid rgba(164, 102, 255, 0.4);
  background: linear-gradient(135deg, rgba(142, 83, 225, 0.2), rgba(164, 102, 255, 0.12));
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.nav-account:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(142, 83, 225, 0.4); border-color: rgba(164,102,255,0.7); }
.nav-account img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #2a1a40; }
.nav-account .na-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Модалка ---- */
.fsi-modal {
  position: fixed; inset: 0; z-index: 6000;
  display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(6, 4, 10, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.fsi-modal.open { display: flex; animation: fsiFade .25s ease; }
@keyframes fsiFade { from { opacity: 0; } to { opacity: 1; } }
.fsi-card {
  width: 100%; max-width: 420px; border-radius:12px; padding: 26px;
  background: linear-gradient(180deg, #1b1228, #140d20);
  border: 1px solid rgba(142, 83, 225, 0.25);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
  animation: fsiPop .3s cubic-bezier(.22,.9,.41,1); position: relative;
  max-height: 92vh; overflow-y: auto;
}
@keyframes fsiPop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.fsi-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.08); color: #eae6f7; font-size: 16px; cursor: pointer; transition: all .2s ease;
}
.fsi-close:hover { background: rgba(164, 102, 255, 0.3); transform: rotate(90deg); }

.fsi-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.fsi-logo img { height: 40px; border-radius:9px; }
.fsi-logo span { font-family: 'Wix Madefor Display', sans-serif; font-weight: 700; font-size: 1.1rem;
  background: linear-gradient(135deg, #8e53e1, #a466ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.fsi-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border-radius:12px; background: rgba(0,0,0,0.25); margin-bottom: 18px; }
.fsi-tab { padding: 11px; border: 0; border-radius:9px; background: transparent; color: rgba(234,230,247,0.7);
  font-family: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer; transition: all .2s ease; }
.fsi-tab.active { background: linear-gradient(135deg, #a466ff, #8e5dff); color: #fff; }

.fsi-field { margin-bottom: 14px; }
.fsi-field label { display: block; font-size: 0.82rem; color: rgba(234,230,247,0.6); margin-bottom: 6px; }
.fsi-input {
  width: 100%; padding: 12px 14px; border-radius:11px; font-family: inherit; font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.1); color: #eae6f7;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.fsi-input:focus { outline: none; border-color: rgba(164, 102, 255, 0.6); box-shadow: 0 0 0 3px rgba(164, 102, 255, 0.15); }
textarea.fsi-input { resize: vertical; min-height: 92px; line-height: 1.5; }
.fsi-agree { display: flex; gap: 9px; align-items: flex-start; font-size: 0.82rem; color: rgba(234,230,247,0.7); margin-bottom: 16px; line-height: 1.5; }
.fsi-agree input { margin-top: 3px; flex: 0 0 auto; accent-color: #a466ff; }
.fsi-agree a { color: #a466ff; }

.fsi-submit {
  width: 100%; padding: 13px; border-radius:12px; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 0.98rem; color: #fff;
  background: linear-gradient(90deg, #a466ff, #8e5dff); box-shadow: 0 10px 26px rgba(164, 102, 255, 0.3);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}
.fsi-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(164, 102, 255, 0.42); }
.fsi-submit:disabled { opacity: .6; cursor: default; transform: none; }

.fsi-err { display: none; margin-bottom: 14px; padding: 10px 14px; border-radius:10px;
  background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3); color: #ff9b9b; font-size: 0.88rem; }
.fsi-err.show { display: block; }
.fsi-ok { display: none; margin-bottom: 14px; padding: 10px 14px; border-radius:10px;
  background: rgba(61, 220, 132, 0.1); border: 1px solid rgba(61, 220, 132, 0.3); color: #8ef0b6; font-size: 0.88rem; }
.fsi-ok.show { display: block; }
.fsi-hint { text-align: center; font-size: 0.82rem; color: rgba(234,230,247,0.45); margin-top: 14px; }
.fsi-hint a { color: #a466ff; cursor: pointer; }

/* ============================================================
   Бланк заказа (order.js): Ремонт / Сборка ПК.
   ============================================================ */
.ord-modal .fsi-card { max-width: 560px; }
.ord-req { color: #ff8da0; }

.ord-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius:13px;
  background: rgba(0,0,0,0.25); margin-bottom: 18px; }
.ord-mode { padding: 12px; border: 1px solid transparent; border-radius:10px; background: transparent;
  color: rgba(234,230,247,0.72); font-family: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: all .2s ease; }
.ord-mode:hover { color: #fff; }
.ord-mode.active { background: linear-gradient(135deg, #a466ff, #8e5dff); color: #fff; box-shadow: 0 6px 18px rgba(142,83,225,0.3); }

.ord-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .ord-grid { grid-template-columns: 1fr; gap: 0; } }

.ord-radios { display: flex; flex-wrap: wrap; gap: 7px; }
.ord-radio { position: relative; cursor: pointer; }
.ord-radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ord-radio span { display: inline-block; padding: 9px 14px; border-radius:10px; font-size: 0.88rem;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); color: rgba(234,230,247,0.8); transition: all .18s ease; }
.ord-radio input:checked + span { border-color: rgba(164,102,255,0.7); background: rgba(164,102,255,0.18); color: #fff; }
.ord-radio input:focus-visible + span { box-shadow: 0 0 0 3px rgba(164,102,255,0.25); }

.ord-checks { display: flex; flex-direction: column; gap: 9px; }
/* высокая специфичность: перебиваем `.fsi-field label { display:block }` */
.ord-checks .ord-check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius:11px;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); cursor: pointer; transition: all .18s ease; }
.ord-checks .ord-check:hover { border-color: rgba(164,102,255,0.4); }
.ord-checks .ord-check input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: #a466ff; cursor: pointer; }
.ord-check-lbl { flex: 0 1 auto; font-size: 0.92rem; color: rgba(234,230,247,0.9); }
.ord-pct { margin-left: auto; flex: 0 0 auto; font-style: normal; font-size: 0.76rem; font-weight: 700; color: #ffd98a;
  background: rgba(255,209,102,0.16); padding: 3px 9px; border-radius:8px; }
.ord-sub { width: auto; min-width: 62px; height: auto; padding: 7px 9px; flex: 0 0 auto; }
.ord-surcharge { margin-top: 12px; font-size: 0.84rem; font-weight: 700; color: #8ef0b6; min-height: 1.1em; }

/* Тёмный скроллбар модалки (вместо системного белого) */
.fsi-card { scrollbar-width: thin; scrollbar-color: rgba(164,102,255,0.5) rgba(255,255,255,0.04); }
.fsi-card::-webkit-scrollbar { width: 10px; }
.fsi-card::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.fsi-card::-webkit-scrollbar-thumb { background: rgba(164,102,255,0.4); border-radius:10px; border: 2px solid transparent; background-clip: padding-box; }
.fsi-card::-webkit-scrollbar-thumb:hover { background: rgba(164,102,255,0.7); background-clip: padding-box; }

/* ============================================================
   Лого: подсветка по ФОРМЕ логотипа (drop-shadow следует за краями
   прозрачного PNG), а не прямоугольной рамкой вокруг бокса.
   ============================================================ */
.nav-logo:hover .nav-logo-img {
  box-shadow: none !important;
  filter: drop-shadow(0 0 6px rgba(164, 102, 255, 0.78)) drop-shadow(0 0 13px rgba(142, 83, 225, 0.45)) !important;
}

/* ============================================================
   Адаптив навбара: приоритет — кнопка входа.
   ============================================================ */
/* Ноутбучные ширины (1001–1200px): слегка уплотняем центр-меню и правый
   блок, чтобы полное меню + «Войти» помещались без пустоты в середине. */
@media (min-width: 1001px) and (max-width: 1200px) {
  .nav-center { gap: 3px !important; padding: 5px !important; }
  .nav-center .nav-btn { padding: 9px 11px !important; font-size: 0.9rem !important; }
  .nav-meta { padding: 9px 11px !important; font-size: 0.86rem !important; }
  .nav-auth { padding: 9px 13px !important; font-size: 0.86rem; }
}
/* Узкие экраны (≤1000px): центр-меню, соц.сети и контакты уезжают в бургер
   (они там уже есть), сверху остаётся приоритетная кнопка входа. */
@media (max-width: 1000px) {
  .nav-center { display: none !important; }
  .meta-menu  { display: inline-flex !important; }
  .nav-meta-wrap .meta-socials,
  .nav-meta-wrap .meta-contacts { display: none !important; }
  .nav-meta-wrap { gap: 8px; }
}
@media (max-width: 480px) {
  .nav-account .na-name { display: none; }            /* остаётся только аватар */
  .nav-account { padding: 5px; gap: 0; }
  .nav-auth { padding: 9px 14px; }
}
@media (max-width: 360px) {
  .nav-auth { font-size: 0.82rem; padding: 8px 12px; }
  .nav-auth svg { display: none; }                    /* совсем узко — только текст «Войти» */
}

/* Ловушка для ботов: человек этого поля не видит и не заполнит.
   Не display:none — часть ботов такие поля игнорирует. */
.fsi-trap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.fsi-cap[hidden] { display: none !important; }
