/* Личный кабинет RVS — в одной системе с лендингом (site.css): стеклянные карточки, синий акцент, Unbounded/Onest. */

.account-page { position: relative; isolation: isolate; }
.account-page::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 520px; z-index: -1; pointer-events: none; opacity: .6;
  background: linear-gradient(180deg, transparent 40%, var(--bg)), url('/img/bg-stripes.svg') right top / cover no-repeat;
}

/* Уменьшили ширину с 780px до 640px для компактности на ПК */
.account-wrap { width: min(100% - 2 * var(--gutter), 640px); margin: clamp(16px, 4vw, 48px) auto clamp(64px, 9vw, 112px); }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.account-heading h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; line-height: 1.05; }

/* Общий сервисный notice (ошибки, загрузка) */
.account-notice { min-height: 1.6em; margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.account-notice:empty { min-height: 0; margin: 0; }
.account-notice.is-error { color: var(--danger); }

/* Общие элементы */
.account-section, .account-auth {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(16, 26, 54, .74), rgba(8, 13, 28, .78));
}
.account-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.account-section-head h2, .account-auth h2 { font-size: 22px; font-weight: 700; line-height: 1.2; }

.account-icon-link, .account-quick-renew, .account-devices-more {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--teal-hi); font: 600 14px/1.4 var(--sans);
}
.account-icon-link:hover, .account-quick-renew:hover, .account-devices-more:hover { color: #8ab4ff; }
.account-badge-muted { color: var(--muted); font-size: 14px; }
.account-hint { margin: -6px 0 18px; color: var(--muted); font-size: 14px; }
.account-hint:empty { display: none; }

.account-secondary, .btn-support, .account-copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: rgba(255, 255, 255, .03); color: var(--text);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.account-secondary:hover, .btn-support:hover, .account-copy-btn:hover { border-color: rgba(140, 170, 255, .55); background: rgba(255, 255, 255, .06); }
.account-secondary svg, .btn-support svg, .account-logout-top svg, .account-logout-full svg, .account-tab svg { width: 18px; height: 18px; flex: none; }

/* =========================================
   ЕДИНЫЙ СТИЛЬ УВЕДОМЛЕНИЙ (подсказки)
   ========================================= */
.account-alert {
  margin: 16px 0 16px;
  padding: 14px 18px;
  border: 1px solid rgba(77, 141, 255, .35);
  border-left: 4px solid var(--teal-hi);
  border-radius: 12px;
  background: rgba(47, 123, 255, .08);
  color: #fff;
  font: 500 15px/1.5 var(--sans);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.account-alert:empty { display: none; }

/* Модификатор для ошибок, если понадобится */
.account-alert.is-error {
  border-color: rgba(255, 138, 153, .35);
  border-left-color: var(--danger);
  background: rgba(255, 138, 153, .08);
}

/* Специфичное для подсказки с кодом (чуть меньше отступ) */
.account-code-hint {
  margin: -4px 0 4px;
}

/* Вход */
.account-auth > p { margin: 8px 0 24px; color: var(--muted); }
.account-form { display: grid; gap: 10px; }
.account-form + .account-form { margin-top: 14px; }
.account-form label { color: var(--muted); font-size: 14px; }
.account-form input:not([type='checkbox']), .account-form select {
  width: 100%; height: 54px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background-color: rgba(255, 255, 255, .04); color: var(--text);
  font: 500 16px/1 var(--sans);
  transition: border-color .2s, background-color .2s;
}
.account-form input::placeholder { color: var(--dim); }
.account-form input:focus, .account-form select:focus { outline: none; border-color: var(--blue); background-color: rgba(47, 123, 255, .08); }
.account-form select {
  appearance: none; -webkit-appearance: none; padding-right: 46px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%2393a0bf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
}
.account-form select option { background: #0b1430; color: var(--text); }
.account-form .btn { width: 100%; margin-top: 4px; }
#code { letter-spacing: .3em; font-variant-numeric: tabular-nums; }

.account-auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--dim); font-size: 13px; }
.account-auth-divider::before, .account-auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#telegram-login { width: 100%; }
.account-tg-step { display: grid; gap: 10px; margin-top: 14px; padding: 18px; border: 1px solid rgba(77, 141, 255, .45); border-radius: 18px; background: rgba(47, 123, 255, .08); }
.account-tg-step p { color: var(--soft); font-size: 14px; }
.account-tg-step .btn { width: 100%; }
.account-auth-support { margin-top: 14px; }
.account-auth-support .btn-support { width: 100%; }
.account-legal-tiny { margin-top: 18px; color: var(--dim); font-size: 13px; text-align: center; }
.account-legal-tiny a { color: var(--muted); text-underline-offset: 3px; }

/* Вкладки кабинета */
.account-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 14px; padding: 5px; border: 1px solid var(--line); border-radius: 18px; background: rgba(8, 13, 28, .8); }
.account-tab {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 10px;
  border: 0; border-radius: 13px; background: none; color: var(--muted);
  font: 600 14.5px/1 var(--sans); cursor: pointer;
  transition: background .2s, color .2s;
}
.account-tab:hover { color: var(--text); }
.account-tab.is-active { background: #fff; color: #06102a; }
.account-tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; }

/* Подписка и профиль */
.account-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.account-detail-card { padding: 16px 18px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 18px; background: rgba(0, 0, 0, .22); }
.account-details .account-detail-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.account-detail-card dt { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.account-detail-card dd { margin: 0; font: 600 17px/1.3 var(--display); overflow-wrap: anywhere; }
.account-status { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 10px; background: rgba(47, 216, 196, .14); color: var(--teal); font: 600 15px/1 var(--sans); }
.account-status.is-warn { background: rgba(255, 186, 92, .14); color: #ffba5c; }
#subscription > p { margin-bottom: 18px; color: var(--soft); }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.account-actions .btn { flex: 1 1 200px; }
.account-copy-btn { flex: 1 1 200px; }
.account-quick-renew { display: block; margin-top: 20px; }

/* Устройства */
.account-devices { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.account-devices > li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 18px; background: rgba(0, 0, 0, .22); }
.account-devices > li:only-child:not(:has(button)) { color: var(--muted); }
.account-device-info { display: grid; gap: 2px; min-width: 0; }
.account-device-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.account-device-detail { color: var(--muted); font-size: 13px; }
.account-device-remove { flex: none; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 11px; background: none; color: var(--soft); font: 600 13.5px/1 var(--sans); cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.account-device-remove:hover { border-color: rgba(255, 138, 153, .6); color: var(--danger); }
.account-device-remove.is-armed { border-color: var(--danger); background: rgba(255, 138, 153, .14); color: var(--danger); }
.account-devices-more { margin-top: 14px; }

/* Продление */
.account-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.account-form-grid > div, #purchase-form > div { display: grid; gap: 8px; }
.account-summary-box { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 18px 20px; border: 1px solid rgba(77, 141, 255, .35); border-radius: 18px; background: rgba(47, 123, 255, .08); }
.account-summary-box span { color: var(--muted); font-size: 14px; }
.account-summary { font: 700 20px/1.2 var(--display); text-align: right; }
.account-consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; color: var(--dim); font-size: 13px; line-height: 1.5; cursor: pointer; }
.account-consent input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--blue); }
.account-consent a { color: var(--muted); text-underline-offset: 3px; }

/* Аккаунт */
.account-link-box { display: grid; gap: 12px; margin-top: 12px; padding: 18px; border: 1px dashed var(--line-2); border-radius: 18px; }
.account-link-box p { color: var(--soft); font-size: 14px; }
.account-link-box .account-secondary { width: 100%; }
.account-support-card { display: flex; margin-top: 12px; padding: 20px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 18px; background: rgba(0, 0, 0, .22); }
.account-support-card .btn-support { width: 100%; flex: none; }
.account-profile-footer { margin-top: 12px; }
.account-logout-top, .account-logout-full {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); border-radius: 12px; background: none; color: var(--soft);
  font: 600 14px/1 var(--sans); cursor: pointer; transition: border-color .2s, color .2s;
}
.account-logout-top { min-height: 42px; padding: 0 16px; }
.account-logout-full { width: 100%; min-height: 50px; }
.account-logout-top:hover, .account-logout-full:hover { border-color: rgba(255, 138, 153, .6); color: var(--danger); }

@media (max-width: 640px) {
  .account-tabs { gap: 2px; padding: 4px; border-radius: 16px; }
  .account-tab { flex-direction: column; gap: 5px; min-height: 58px; padding: 0 4px; font-size: 12px; }
  .account-tab-badge { position: absolute; top: 5px; right: calc(50% - 22px); min-width: 17px; height: 17px; font-size: 11px; }
  .account-details, .account-form-grid { grid-template-columns: 1fr; }
  .account-summary-box { flex-direction: column; align-items: flex-start; gap: 4px; }
  .account-summary { text-align: left; }
  .account-logout-top span { display: none; }
  .account-logout-top { width: 42px; padding: 0; }
}
