/* ===== AI Zone — модалка авторизации ===== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 4, 9, 0.74); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0.22s;
}
.auth-overlay.is-open { opacity: 1; visibility: visible; }

.auth-card {
  position: relative; width: 100%; max-width: 420px;
  border: 1px solid transparent; border-radius: 26px;
  background:
    linear-gradient(#0e0f1a, #0e0f1a) padding-box,
    linear-gradient(150deg, rgba(124, 92, 255, .55), rgba(255, 255, 255, .07) 35%, rgba(255, 255, 255, .07) 65%, rgba(43, 214, 255, .45)) border-box;
  padding: 34px 32px 26px;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.85), 0 0 80px -30px rgba(124, 92, 255, 0.35);
  font-family: 'Manrope', system-ui, sans-serif;
  transform: translateY(14px) scale(0.985); transition: transform 0.25s ease;
  overflow: hidden;
}
.auth-overlay.is-open .auth-card { transform: none; }
/* мягкое свечение в шапке карточки */
.auth-card::before {
  content: ""; position: absolute; left: 50%; top: -90px; width: 320px; height: 180px;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(124, 92, 255, .28), transparent);
  pointer-events: none;
}

.auth-close {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px;
  border: none; background: rgba(255, 255, 255, 0.05); color: #a6a8b8; font-size: 20px;
  cursor: pointer; display: grid; place-items: center; transition: background 0.2s, color 0.2s;
}
.auth-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* Бренд по центру */
.auth-brand {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 21px; color: #f4f5fb;
  margin-bottom: 20px; text-align: center;
}
.auth-brand__mark { display: grid; place-items: center; filter: drop-shadow(0 10px 24px rgba(124, 92, 255, .55)); }

/* Табы Вход / Регистрация со скользящей подложкой */
.auth-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px; padding: 4px; margin-bottom: 18px;
}
.auth-tabs button {
  position: relative; z-index: 1; padding: 11px; border: none; background: none; color: #a6a8b8;
  font-family: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; border-radius: 11px; transition: color 0.2s;
}
.auth-tabs button.is-active { color: #fff; }
.auth-tabs__pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 11px;
  background: linear-gradient(120deg, #7c5cff, #5b8bff 55%, #2bd6ff); box-shadow: 0 8px 20px -8px rgba(124, 92, 255, 0.7);
  transition: transform 0.25s ease;
}
.auth-tabs[data-tab="register"] .auth-tabs__pill { transform: translateX(100%); }

.auth-hint { color: #a6a8b8; font-size: 14px; margin-bottom: 18px; text-align: center; }

/* Поля с иконками */
.auth-field { position: relative; margin-bottom: 12px; }
.auth-field__icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: #5e6072; pointer-events: none; transition: color 0.2s;
}
.auth-field:focus-within .auth-field__icon { color: #9d7bff; }
.auth-field input {
  width: 100%; padding: 15px 16px 15px 47px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04); color: #f4f5fb; font-size: 15px; font-family: inherit;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-field input:focus {
  border-color: rgba(124, 92, 255, 0.65); background: rgba(124, 92, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.13);
}
.auth-field input::placeholder { color: #5e6072; }
#passField input { padding-right: 48px; }

/* Кнопка-глаз */
.auth-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; border-radius: 10px; background: none;
  color: #5e6072; cursor: pointer; display: grid; place-items: center; transition: color 0.2s, background 0.2s;
}
.auth-eye svg { width: 19px; height: 19px; }
.auth-eye:hover { color: #c9cbd8; background: rgba(255, 255, 255, 0.06); }
.auth-eye.is-on { color: #9d7bff; }

/* Индикатор надёжности пароля (регистрация и смена пароля) */
.auth-strength { display: flex; align-items: center; gap: 10px; margin: 2px 2px 10px; }
.auth-strength__bars { display: flex; gap: 5px; flex: 1; }
.auth-strength__bars i { height: 4px; flex: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.1); transition: background 0.25s; }
.auth-strength__label { font-size: 12px; color: #8a8ca0; white-space: nowrap; }
.auth-strength[data-level="1"] .auth-strength__bars i:nth-child(1) { background: #ff7a7a; }
.auth-strength[data-level="2"] .auth-strength__bars i:nth-child(-n+2) { background: #ffc36b; }
.auth-strength[data-level="3"] .auth-strength__bars i { background: #4ade80; }
.auth-strength[data-level="1"] .auth-strength__label { color: #ff8a8a; }
.auth-strength[data-level="2"] .auth-strength__label { color: #ffc36b; }
.auth-strength[data-level="3"] .auth-strength__label { color: #4ade80; }

.auth-error { color: #ff8a8a; font-size: 13.5px; min-height: 18px; margin: 2px 0 10px; text-align: center; }

.auth-submit {
  width: 100%; padding: 15px; border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(120deg, #7c5cff, #5b8bff 45%, #2bd6ff); background-size: 150% 100%;
  color: #fff; font-family: inherit; font-weight: 700; font-size: 15.5px;
  box-shadow: 0 10px 30px -8px rgba(124, 92, 255, 0.6);
  transition: transform 0.18s, box-shadow 0.25s, background-position 0.35s;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(124, 92, 255, .75); background-position: 100% 0; }
.auth-submit:disabled { opacity: 0.6; transform: none; cursor: default; }

.auth-forgot { display: block; margin: 13px auto 0; background: none; border: none; color: #8a8ca0; font-size: 13px; cursor: pointer; transition: color 0.2s; }
.auth-forgot:hover { color: #c9cbd8; text-decoration: underline; }

.auth-or { display: flex; align-items: center; gap: 14px; color: #6b6d80; font-size: 13px; margin: 20px 0 14px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14)); }
.auth-or::after { background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent); }

/* Соцсети — один ряд компактных кнопок */
.auth-socials { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.auth-soc {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 11px 4px 9px;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.09); background: rgba(255, 255, 255, 0.03);
  color: #8a8ca0; font-family: inherit; font-weight: 600; font-size: 11.5px; cursor: pointer;
  transition: transform 0.18s, background 0.2s, border-color 0.2s, color 0.2s;
}
.auth-soc:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.07); color: #e8e9f0; }
.auth-soc b { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-style: normal; font-size: 15px; font-weight: 800; color: #fff; flex-shrink: 0; }
.auth-soc b svg { width: 16px; height: 16px; fill: #fff; display: block; }
.soc-ok b svg { width: 15px; height: 15px; }
.soc-ya b { background: #fc3f1d; } .soc-vk b { background: #0077ff; } .soc-mail b { background: #005ff9; } .soc-ok b { background: #ee8208; }
.soc-ya:hover { border-color: rgba(252, 63, 29, 0.5); } .soc-vk:hover { border-color: rgba(0, 119, 255, 0.5); }
.soc-mail:hover { border-color: rgba(0, 95, 249, 0.5); } .soc-ok:hover { border-color: rgba(238, 130, 8, 0.5); }

.auth-legal { text-align: center; color: #6b6d80; font-size: 12px; margin-top: 18px; line-height: 1.5; }
.auth-legal a { color: #8a8ca0; }
.auth-legal a:hover { color: #c9cbd8; }

/* Окно подтверждения действия (вместо системного confirm) */
.nconfirm-overlay {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 4, 9, 0.74); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0.22s;
}
.nconfirm-overlay.is-open { opacity: 1; visibility: visible; }
.nconfirm-card {
  width: 100%; max-width: 380px; text-align: center;
  border: 1px solid transparent; border-radius: 22px; padding: 28px 26px 22px;
  background:
    linear-gradient(#0e0f1a, #0e0f1a) padding-box,
    linear-gradient(150deg, rgba(124, 92, 255, .5), rgba(255, 255, 255, .07) 40%, rgba(43, 214, 255, .4)) border-box;
  box-shadow: 0 36px 100px -28px rgba(0, 0, 0, .85);
  font-family: 'Manrope', system-ui, sans-serif;
  transform: translateY(16px) scale(.96); transition: transform .28s cubic-bezier(.22, 1.3, .36, 1);
}
.nconfirm-overlay.is-open .nconfirm-card { transform: none; }
.nconfirm-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px;
  display: grid; place-items: center; color: #9d7bff;
  background: rgba(124, 92, 255, .12); border: 1px solid rgba(124, 92, 255, .3);
}
.nconfirm-icon.is-danger { color: #ff8a8a; background: rgba(255, 110, 110, .1); border-color: rgba(255, 110, 110, .3); }
.nconfirm-icon svg { width: 26px; height: 26px; }
.nconfirm-card h3 { font-family: 'Sora', 'Manrope', sans-serif; font-size: 18.5px; font-weight: 800; color: #f4f5fb; margin-bottom: 8px; }
.nconfirm-card p { color: #a6a8b8; font-size: 14px; line-height: 1.55; margin-bottom: 20px; min-height: 0; }
.nconfirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nconfirm-actions button {
  padding: 13px 10px; border-radius: 13px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 14.5px;
  transition: transform .16s, background .2s, border-color .2s, box-shadow .2s;
}
.nconfirm-cancel { border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: #e8e9f0; }
.nconfirm-cancel:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.nconfirm-ok {
  border: none; color: #fff;
  background: linear-gradient(120deg, #7c5cff, #5b8bff 55%, #2bd6ff);
  box-shadow: 0 10px 26px -8px rgba(124, 92, 255, .6);
}
.nconfirm-ok:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -8px rgba(124, 92, 255, .75); }
.nconfirm-ok.is-danger {
  background: linear-gradient(120deg, #ff5e5e, #ff7a5c);
  box-shadow: 0 10px 26px -8px rgba(255, 94, 94, .55);
}
.nconfirm-ok.is-danger:hover { box-shadow: 0 14px 32px -8px rgba(255, 94, 94, .7); }

/* Шлюз «Подтвердите почту» (не закрывается, пока почта не подтверждена) */
.vgate-overlay {
  position: fixed; inset: 0; z-index: 1040;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 4, 9, 0.86); backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s;
}
.vgate-overlay.is-open { opacity: 1; visibility: visible; }
.vgate-card {
  width: 100%; max-width: 400px; text-align: center;
  border: 1px solid transparent; border-radius: 26px; padding: 36px 30px 24px;
  background:
    linear-gradient(#0e0f1a, #0e0f1a) padding-box,
    linear-gradient(150deg, rgba(124, 92, 255, .6), rgba(255, 255, 255, .08) 40%, rgba(43, 214, 255, .5)) border-box;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .9), 0 0 80px -25px rgba(124, 92, 255, .4);
  font-family: 'Manrope', system-ui, sans-serif;
  transform: translateY(20px) scale(.95); transition: transform .35s cubic-bezier(.22, 1.3, .36, 1);
}
.vgate-overlay.is-open .vgate-card { transform: none; }
.vgate-icon svg { width: 76px; height: 76px; margin-bottom: 16px; filter: drop-shadow(0 12px 30px rgba(124, 92, 255, .6)); }
.vgate-card h3 { font-family: 'Sora', 'Manrope', sans-serif; font-size: 22px; font-weight: 800; color: #f4f5fb; margin-bottom: 10px; }
.vgate-card p { color: #a6a8b8; font-size: 14.5px; line-height: 1.55; margin-bottom: 10px; }
.vgate-card p b { color: #e8e9f0; word-break: break-all; }
.vgate-sub { margin-bottom: 20px !important; }
.vgate-check {
  display: block; width: 100%; padding: 14px; border-radius: 14px; border: none; cursor: pointer; margin-bottom: 10px;
  background: linear-gradient(120deg, #7c5cff, #5b8bff 55%, #2bd6ff);
  color: #fff; font-family: inherit; font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 28px -8px rgba(124, 92, 255, .6);
  transition: transform .18s, box-shadow .25s;
}
.vgate-check:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -8px rgba(124, 92, 255, .75); }
.vgate-check:disabled { opacity: .65; transform: none; cursor: default; }
.vgate-resend {
  display: block; width: 100%; padding: 13px; border-radius: 14px; cursor: pointer; margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05);
  color: #e8e9f0; font-family: inherit; font-weight: 700; font-size: 14.5px;
  transition: background .2s, border-color .2s;
}
.vgate-resend:hover { background: rgba(255, 255, 255, .1); border-color: rgba(124, 92, 255, .45); }
.vgate-resend:disabled { opacity: .55; cursor: default; }
.vgate-exit { display: block; margin: 6px auto 0; background: none; border: none; color: #8a8ca0; font-family: inherit; font-size: 13px; cursor: pointer; }
.vgate-exit:hover { color: #c9cbd8; text-decoration: underline; }
.vgate-note { color: #6b6d80 !important; font-size: 12.5px !important; margin: 14px 0 0 !important; }

/* Праздничное окно «Почта подтверждена» */
.vparty-overlay {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 4, 9, 0.78); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s;
}
.vparty-overlay.is-open { opacity: 1; visibility: visible; }
.vparty-card {
  position: relative; width: 100%; max-width: 380px; text-align: center;
  border: 1px solid transparent; border-radius: 26px; padding: 38px 30px 30px;
  background:
    linear-gradient(#0e0f1a, #0e0f1a) padding-box,
    linear-gradient(150deg, rgba(124, 92, 255, .65), rgba(255, 255, 255, .08) 40%, rgba(43, 214, 255, .55)) border-box;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .85), 0 0 90px -25px rgba(124, 92, 255, .5);
  font-family: 'Manrope', system-ui, sans-serif;
  transform: translateY(24px) scale(.92); transition: transform .45s cubic-bezier(.22, 1.4, .36, 1);
}
.vparty-overlay.is-open .vparty-card { transform: none; }
.vparty-icon { position: relative; width: 84px; height: 84px; margin: 0 auto 18px; }
.vparty-icon svg { width: 84px; height: 84px; filter: drop-shadow(0 14px 34px rgba(124, 92, 255, .65)); animation: vparty-pop .6s cubic-bezier(.22, 1.6, .36, 1) both .15s; }
@keyframes vparty-pop { from { transform: scale(0); } to { transform: scale(1); } }
/* разлетающиеся искры */
.vparty-spark i {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(120deg, #7c5cff, #2bd6ff); opacity: 0;
  animation: vparty-fly 1s ease-out both .35s;
}
.vparty-spark i:nth-child(1) { --fx: -58px; --fy: -34px; }
.vparty-spark i:nth-child(2) { --fx: 60px;  --fy: -28px; animation-delay: .42s; }
.vparty-spark i:nth-child(3) { --fx: -44px; --fy: 40px;  animation-delay: .5s; }
.vparty-spark i:nth-child(4) { --fx: 50px;  --fy: 44px;  animation-delay: .38s; }
.vparty-spark i:nth-child(5) { --fx: 0px;   --fy: -62px; animation-delay: .55s; }
.vparty-spark i:nth-child(6) { --fx: -66px; --fy: 6px;   animation-delay: .47s; }
@keyframes vparty-fly {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(var(--fx), var(--fy)) scale(1); opacity: 0; }
}
.vparty-card h3 { font-family: 'Sora', 'Manrope', sans-serif; font-size: 23px; font-weight: 800; color: #f4f5fb; margin-bottom: 8px; }
.vparty-card p { color: #a6a8b8; font-size: 14.5px; margin-bottom: 18px; }
.vparty-bonus {
  display: inline-block; padding: 11px 26px; border-radius: 999px; margin-bottom: 22px;
  background: linear-gradient(120deg, #7c5cff, #5b8bff 55%, #2bd6ff);
  color: #fff; font-family: 'Sora', 'Manrope', sans-serif; font-weight: 800; font-size: 19px;
  box-shadow: 0 14px 34px -10px rgba(124, 92, 255, .75);
  animation: vparty-pop .5s cubic-bezier(.22, 1.6, .36, 1) both .3s;
}
.vparty-btn {
  display: block; width: 100%; padding: 14px; border-radius: 14px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  color: #f4f5fb; font-family: inherit; font-weight: 700; font-size: 15px;
  transition: background .2s, border-color .2s, transform .18s;
}
.vparty-btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(124, 92, 255, .5); transform: translateY(-1px); }

/* Тост */
.auth-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #14111f; border: 1px solid rgba(255, 255, 255, 0.16); color: #f4f5fb;
  padding: 13px 20px; border-radius: 12px; font-family: 'Manrope', sans-serif; font-size: 14px;
  z-index: 1100; opacity: 0; transition: opacity 0.25s, transform 0.25s; box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.7); pointer-events: none;
}
.auth-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 460px) {
  .auth-card { padding: 28px 18px 18px; border-radius: 22px; }
  .auth-soc span { display: none; }
  .auth-soc { padding: 11px 4px; }
  /* 16px спасает от автозума при фокусе на iPhone */
  .auth-field input { font-size: 16px; padding: 14px 14px 14px 45px; }
  .auth-brand { font-size: 19px; }
  .auth-tabs button { padding: 10px; font-size: 14px; }
}
