/* ============================================================
   HellaRP — вход/регистрация и личный кабинет
   (подключается после styles.css и использует его токены и компоненты)
   ============================================================ */

/* ---------- Общие элементы ---------- */
.btn--light { background: #fff; color: #0a1330; }
.btn--light:hover { background: #e6eeff; }
.btn--discord { background: #5865f2; color: #fff; }
.btn--discord:hover { background: #6a76ff; }
.ok { color: #8dffc1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Иконка доната Hella Coin вместо надписи «HC» */
.coin { display: inline-block; width: 1em; height: 1em; margin: 0 .22em; vertical-align: -.14em; }
.me__hc-val .coin, .pack b .coin, .topup__total b .coin { width: .82em; height: .82em; margin: 0 .28em 0 0; vertical-align: -.06em; }
.warn { color: #ffc46b; }

.demo-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px dashed rgba(255, 196, 107, .35); background: rgba(255, 196, 107, .06); color: #e8cfa0; font-size: 13px; }
.demo-note .i { color: #ffc46b; }

.tex-stripes-dark { background: repeating-linear-gradient(-56deg, rgba(110, 150, 255, .035) 0 64px, transparent 64px 128px), linear-gradient(160deg, #0b1122, #070a12); }
.tex-mountains { background: url('../assets/img/mountains.svg') center bottom / cover no-repeat; -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%); mask-image: linear-gradient(180deg, transparent, #000 45%); }
.tex-palms { background: url('../assets/img/palms.svg') center bottom / cover no-repeat; opacity: .9; }

/* Сегментированный переключатель с «ползунком» */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.seg__btn { position: relative; z-index: 1; height: 42px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; transition: color .3s; }
.seg__btn i { font: 500 11px var(--f-mono); font-style: normal; margin-left: 4px; color: var(--muted); }
.seg__btn.is-active, .seg__btn:hover { color: #fff; }
.seg__pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 10px; background: var(--blue); box-shadow: 0 8px 24px -8px rgba(31, 107, 255, .9); transition: transform .45s var(--ease), width .45s var(--ease); }
.seg--sm .seg__btn { height: 36px; font-size: 13px; }

/* Поля формы */
/* minmax(0,1fr): поле не распирает колонку своей «естественной» шириной input */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.field__label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: #c3cad8; }
.field__label em { font-style: normal; font-weight: 500; color: var(--muted); }
.field__link { font-size: 13px; color: #7cb4ff; }
.field__link:hover { color: #fff; }
.field__box {
  min-width: 0; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 14px;
  border-radius: 13px; border: 1px solid var(--line-2); background: rgba(5, 7, 12, .55);
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.field__box > .i { color: var(--muted); transition: color .25s; }
.field__box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 600 15px var(--f-body); }
.field__box input::placeholder { color: #5d6678; font-weight: 500; }
.field__box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 107, 255, .18); background: rgba(10, 16, 30, .8); }
.field__box:focus-within > .i { color: var(--cyan); }
.field.is-invalid .field__box { border-color: #ff5c7a; box-shadow: 0 0 0 4px rgba(255, 92, 122, .14); }
.field__eye { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.field__eye:hover { color: #fff; background: rgba(255, 255, 255, .06); }
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

.check { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: #c3cad8; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line-2); background: rgba(5, 7, 12, .6); color: transparent; transition: background-color .25s, border-color .25s, color .25s; }
.check__box .i { width: 14px; height: 14px; stroke-width: 3; }
.check input:checked + .check__box { background: var(--blue); border-color: var(--blue); color: #fff; }
.check input:focus-visible + .check__box { outline: 2px solid var(--cyan); outline-offset: 2px; }
.check a { color: #7cb4ff; }
.check.is-invalid .check__box { border-color: #ff5c7a; }

/* ============ AUTH: форма по центру, персонаж на фоне ============ */
.page-auth { min-height: 100svh; }
.auth { position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 88px var(--gutter) 48px; }
.auth__bg { position: absolute; inset: 0; z-index: -1; }
.auth__bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 40% 60% at 50% 50%, rgba(5, 7, 12, .55), transparent 75%), linear-gradient(0deg, rgba(5, 7, 12, .8), transparent 35%); }
/* персонаж — того же размера, справа; форма поверх фона по центру */
.auth__char { position: absolute; right: 0; bottom: 0; height: 94%; width: auto; max-width: 46%; object-fit: contain; object-position: right bottom; filter: brightness(.74) contrast(1.08) saturate(.9); -webkit-mask-image: linear-gradient(0deg, transparent, #000 18%); mask-image: linear-gradient(0deg, transparent, #000 18%); }
.auth__home { position: absolute; z-index: 2; top: 28px; left: var(--gutter); display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); transition: color .25s; }
.auth__home .i { transform: rotate(180deg); }
.auth__home:hover { color: #fff; }

.auth__card {
  position: relative; z-index: 1; width: 100%; max-width: 460px;
  display: grid; gap: 22px; padding: 34px 34px 30px;
  border-radius: 24px; border: 1px solid var(--line-2);
  background: rgba(8, 11, 18, .82);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9);
}
.auth__logo { justify-self: center; }
.auth__logo img { width: 132px; }

/* Минимальные вкладки: только текст и тонкая синяя черта снизу */
.seg--min { display: flex; justify-content: center; gap: 28px; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.seg--min .seg__btn { flex: none; height: 44px; padding: 0 2px; border-radius: 0; font-size: 15px; }
.seg--min .seg__btn--hidden { display: none; }
.seg--min .seg__pill { top: auto; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); box-shadow: none; }

.form { display: none; gap: 14px; }
.form.is-active { display: grid; animation: formIn .45s var(--ease); }
@keyframes formIn { from { opacity: 0; transform: translateY(8px); } }
.form__title { font: 800 26px/1 var(--f-display); text-transform: uppercase; font-variation-settings: 'slnt' -9; letter-spacing: -.01em; }
.form__sub { margin: -4px 0 4px; color: var(--muted); font-size: 14px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form__error { font-size: 13px; color: #ff8aa0; }
.form__error:empty { display: none; }
.form__ok { display: none; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(70, 230, 140, .08); border: 1px solid rgba(70, 230, 140, .3); color: #8dffc1; font-size: 14px; }
.form.is-sent .form__ok { display: flex; }
.form__or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.form__or::before, .form__or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form__back { justify-self: center; font-size: 14px; color: var(--muted); }
.form__back:hover { color: #fff; }
.auth .field__box { height: 50px; }

/* ============ CABINET ============ */
.page-cabinet .header { position: sticky; }
.cab { display: grid; gap: 22px; padding-top: 28px; padding-bottom: 100px; }

/* Профиль + баланс */
.me { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; padding: clamp(22px, 3vw, 36px); border-radius: 24px; border: 1px solid var(--line-2); background: #0a0f1c; }
.me__who { display: flex; align-items: center; gap: 22px; min-width: 0; }
.me__avatar { display: grid; place-items: center; flex: none; width: 88px; height: 88px; border-radius: 24px; background: #101a33; border: 1px solid rgba(31, 107, 255, .55); color: #cfe0ff; font: 800 28px var(--f-display); font-variation-settings: 'slnt' -9; }
.me__info { display: grid; gap: 10px; min-width: 0; }
.me__name { font: 800 clamp(28px, 3.2vw, 44px)/1 var(--f-display); text-transform: uppercase; font-variation-settings: 'slnt' -9; letter-spacing: -.02em; }
.me__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-s { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: #c3cad8; }
.chip-s b { color: #fff; }
.chip-s--vip { background: rgba(31, 107, 255, .1); border-color: rgba(31, 107, 255, .35); color: #cfe0ff; }
.chip-s .i { width: 14px; height: 14px; }
.me__xp { display: flex; align-items: center; gap: 12px; max-width: 360px; }
.me__xp .mono { font-size: 11px; color: var(--muted); white-space: nowrap; }
.xp { flex: 1; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.xp span { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--blue); border-radius: inherit; }
.me__money { display: grid; gap: 16px; justify-items: end; text-align: right; }
.me__hc { display: grid; justify-items: end; gap: 6px; }
.me__label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.me__hc-val { font: 800 clamp(30px, 3.4vw, 46px)/1 var(--f-display); font-variation-settings: 'slnt' -9; font-variant-numeric: tabular-nums; }
.me__hc-val small { font-size: .45em; color: var(--muted); }
.me__hc .btn { margin-top: 6px; }
.me__stats { display: flex; gap: 24px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.me__stats li { display: grid; gap: 2px; }
.me__stats span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.me__stats b { font-size: 16px; font-variant-numeric: tabular-nums; }

/* Вкладки: иконка + подпись + счётчик, светящаяся полоска под активной */
.tabs {
  position: sticky; top: var(--header-h); z-index: 5;
  display: flex; gap: 4px; padding: 6px; overflow-x: auto; scrollbar-width: none;
  border-radius: 18px; border: 1px solid var(--line); background: rgba(10, 13, 21, .9);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__btn { position: relative; z-index: 1; flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 18px; border-radius: 13px; font-size: 15px; font-weight: 700; color: var(--muted); white-space: nowrap; transition: color .3s, background-color .3s; }
.tabs__btn .i { width: 19px; height: 19px; transition: color .3s; }
.tabs__btn i { font: 500 11px var(--f-mono); font-style: normal; padding: 3px 7px; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--muted); }
.tabs__btn:hover { color: #dfe5ef; }
.tabs__btn.is-active { color: #fff; }
.tabs__btn.is-active .i { color: #7cb4ff; }
.tabs__btn.is-active i { background: rgba(255, 255, 255, .1); color: #fff; }
.tabs__ink { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; border-radius: 13px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); transition: transform .45s var(--ease), width .45s var(--ease); }
.tabs__ink::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); }

.panel { display: none; scroll-margin-top: calc(var(--header-h) + 90px); }
.panel.is-active { display: block; animation: formIn .45s var(--ease); }

/* Имущество */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); transition: color .25s, border-color .25s, background-color .25s; }
.filter i { font: 500 11px var(--f-mono); font-style: normal; margin-left: 4px; opacity: .7; }
.filter:hover { color: #dfe5ef; }
.filter.is-active { color: #fff; border-color: var(--line-2); background: rgba(255, 255, 255, .07); }
.assets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.asset { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .3s; }
.asset[hidden] { display: none; }
.asset:hover { border-color: var(--line-2); }
.asset__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: url('../assets/img/mountains.svg') center bottom / cover no-repeat, linear-gradient(180deg, #0e1528, #0a0f1c); border-bottom: 1px solid var(--line); }
.asset__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.asset:hover .asset__media img { transform: scale(1.03); }
/* машины — PNG без фона: ставим целиком на тёмную сцену с горами и мягкой тенью */
.asset__media--car img { position: absolute; left: 10%; right: 10%; bottom: 12%; width: 80%; height: 72%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .6)); }
.asset__media:not(.asset__media--car) img { filter: brightness(.85) saturate(.9); }
.asset__ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(160, 190, 255, .35); }
.asset__ph .i { width: 56px; height: 56px; stroke-width: 1.2; }
.asset__class { position: absolute; top: 12px; left: 12px; padding: 5px 9px; border-radius: 7px; background: rgba(5, 7, 12, .7); border: 1px solid var(--line-2); font-size: 10px; color: #c3cad8; }
.asset__body { display: grid; gap: 4px; padding: 16px 18px 18px; }
.asset__body b { font-size: 17px; }
.asset__body > span { font-size: 13px; color: var(--muted); }
.asset__foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: #aab3c4; }
.asset__state { font-weight: 700; color: #c3cad8; white-space: nowrap; }

/* Персонажи */
.chars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.char-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.char-card__avatar { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 15px; background: #101a33; border: 1px solid rgba(31, 107, 255, .5); color: #cfe0ff; font: 800 17px var(--f-display); font-variation-settings: 'slnt' -9; }
.char-card div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.char-card div span { font-size: 13px; color: var(--muted); }
.char-card.is-main { border-color: var(--line-2); }
.char-card--empty, .char-card--locked { border-style: dashed; }
.char-card--empty .char-card__avatar, .char-card--locked .char-card__avatar { background: none; border: 1px dashed var(--line-2); color: var(--muted); }
.char-card--locked { opacity: .65; }

/* Пополнение */
.topup { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pack { position: relative; overflow: hidden; display: grid; gap: 6px; padding: 24px 22px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color .3s, background-color .3s, transform .4s var(--ease); }
.pack b { font: 800 30px/1 var(--f-display); font-variation-settings: 'slnt' -9; }
.pack b small { font-size: .5em; color: var(--muted); }
.pack span { font-size: 15px; font-weight: 700; color: #c3cad8; }
.pack em { position: absolute; top: 14px; right: 14px; padding: 4px 8px; border-radius: 7px; background: rgba(70, 230, 140, .12); color: #8dffc1; font: 700 11px var(--f-mono); font-style: normal; }
.pack:hover { border-color: var(--line-2); }
.pack.is-active { border-color: var(--blue); background: var(--surface-2); box-shadow: 0 0 0 1px var(--blue); }
.topup__side { display: grid; gap: 16px; padding: 22px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.topup__total { display: grid; gap: 4px; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-2); }
.topup__total > span:first-child { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.topup__total b { font: 800 28px/1.1 var(--f-display); font-variation-settings: 'slnt' -9; }
.topup__note { display: flex; gap: 8px; font-size: 12px; }
.topup__note .i { flex: none; color: #8dffc1; }

/* История */
.history { display: grid; gap: 8px; }
.history li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.history__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .05); color: #c3cad8; }
.history__ico.ok { background: rgba(70, 230, 140, .1); color: #8dffc1; }
.history div { display: grid; gap: 2px; }
.history .mono { font-size: 11px; color: var(--muted); }

/* Правила */
.rules { display: grid; gap: 10px; }
.rule { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.rule[open] { border-color: var(--line-2); background: var(--surface-2); }
.rule summary { display: flex; align-items: center; gap: 16px; padding: 18px 20px; cursor: pointer; list-style: none; font-weight: 700; font-size: 16px; }
.rule summary::-webkit-details-marker { display: none; }
.rule summary .mono { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(31, 107, 255, .16); color: #9cc0ff; }
.rule[open] .qa__ico { background: var(--blue); border-color: var(--blue); }
.rule[open] .qa__ico::after { transform: rotate(0); }
.rule ol { display: grid; gap: 8px; margin: 0; padding: 0 20px 20px 66px; list-style: decimal; color: #b9c1d0; font-size: 15px; }
.rule ol b { color: #fff; }
.rules__more { justify-self: start; margin-top: 6px; font-size: 14px; }
.cab > .demo-note { justify-self: start; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
  .page-cabinet .header__bar { grid-template-columns: auto 1fr; }
  .topup { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .auth__char { opacity: .35; max-width: 80%; }
  .me { grid-template-columns: 1fr; }
  .me__money { justify-items: start; text-align: left; }
  .me__hc { justify-items: start; }
  .assets { grid-template-columns: 1fr 1fr; }
  .chars { grid-template-columns: 1fr; }
  .tabs__btn { flex: 0 0 auto; }
}
@media (max-width: 600px) {
  .form__row { grid-template-columns: 1fr; }
  .auth { padding: 72px 12px 24px; }
  .auth__card { padding: 26px 20px 22px; border-radius: 20px; }
  .auth__home { top: 22px; }
  .seg__btn { padding: 0 8px; font-size: 13px; }
  .packs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pack { padding: 20px 16px; }
  .pack b { font-size: 24px; }
  .rule ol { padding-left: 40px; }
  .me__who { flex-direction: column; align-items: flex-start; }
  .me__avatar { width: 64px; height: 64px; font-size: 22px; border-radius: 18px; }
  .me__stats { gap: 16px; flex-wrap: wrap; }
  .assets { grid-template-columns: 1fr; }
}

/* ============ Состояния загрузки (данные из API) ============ */
.skel { display: block; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .09) 50%, rgba(255, 255, 255, .04) 75%); background-size: 200% 100%; animation: skel 1.4s linear infinite; }
.skel--title { width: 260px; max-width: 70%; height: .9em; }
.skel--card { height: 300px; border-radius: 16px; }
@keyframes skel { to { background-position: -200% 0; } }
.empty { padding: 28px; border-radius: 16px; border: 1px dashed var(--line-2); text-align: center; color: var(--muted); }
.load-error { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255, 92, 122, .4); background: rgba(255, 92, 122, .08); color: #ffb3c1; font-size: 14px; }
.load-error[hidden] { display: none; }
.load-error .btn { margin-left: auto; }
.btn.is-busy { pointer-events: none; opacity: .7; }
.btn.is-busy .i:last-child { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
