/* Личный кабинет: тот же слой/размер/анимация, что и корзина */

.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 232;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  background: var(--topbar-overlay-backdrop-tint);
  opacity: 0;
  visibility: hidden;
  /* Иначе невидимый слой на весь экран перехватывает тапы по top bar (WebView). */
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out-apple), visibility 0.22s var(--ease-out-apple);
}

.account-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.account-overlay__panel {
  width: min(100%, 364px);
  max-height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--glass-overlay-bg);
  border: 1px solid var(--glass-overlay-border);
  backdrop-filter: blur(var(--glass-overlay-blur));
  -webkit-backdrop-filter: blur(var(--glass-overlay-blur));
  box-shadow: var(--glass-overlay-shadow);
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s var(--ease-out-apple), opacity 0.22s var(--ease-out-apple);
}

.account-overlay.is-open .account-overlay__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.account-overlay__header {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 12px 12px 8px;
  min-height: 48px;
  box-sizing: border-box;
}

.account-overlay__header-spacer {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  pointer-events: none;
}

/* Крестик слева: полное закрытие оверлея (не путать с внутренним back) */
.account-overlay__dismiss {
  border: none;
  background: rgba(255, 255, 255, 0.55);
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  color: rgba(20, 24, 32, 0.55);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(20, 24, 32, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.account-overlay__dismiss:hover {
  background: rgba(255, 255, 255, 0.88);
  color: rgba(20, 24, 32, 0.72);
}

.account-overlay__dismiss:active {
  transform: scale(0.94);
  opacity: 0.92;
}

.account-overlay__back {
  border: none;
  background: transparent;
  padding: 6px 6px;
  margin: 0;
  font-size: 15px;
  color: #0071e3;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}

.account-overlay__back:active {
  opacity: 0.65;
}

.account-overlay__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.account-overlay__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.account-body--enter {
  animation: accountBodyIn 0.28s var(--ease-out-apple);
}

@keyframes accountBodyIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.icon-btn--account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn--account svg {
  display: block;
  stroke: currentColor;
}

/* Success transition после входа */
.account-login-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 24px;
}

.account-login-success__mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.14);
  border: 1.5px solid rgba(52, 199, 89, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #248a3d;
  animation: accountSuccessPop 0.55s var(--ease-out-apple) both;
}

.account-login-success__mark svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: accountSuccessDraw 0.45s 0.08s var(--ease-out-apple) both;
}

@keyframes accountSuccessPop {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  55% {
    opacity: 1;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes accountSuccessDraw {
  from {
    opacity: 0;
    stroke-dashoffset: 24;
  }
  to {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-login-success__mark,
  .account-login-success__mark svg {
    animation: none;
  }
}

/* iOS-like settings rows */
.account-ios-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(20, 24, 32, 0.07);
  margin-bottom: 6px;
  -webkit-tap-highlight-color: transparent;
}

.account-ios-row:hover {
  background: rgba(255, 255, 255, 0.72);
}

.account-ios-row:active {
  background: rgba(0, 113, 227, 0.08);
}

.account-ios-row__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(20, 24, 32, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(20, 24, 32, 0.65);
}

.account-ios-row__icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

.account-ios-row--muted .account-ios-row__icon {
  background: rgba(20, 24, 32, 0.05);
  color: rgba(60, 60, 67, 0.55);
}

.account-ios-row--danger .account-ios-row__icon {
  background: rgba(192, 34, 34, 0.08);
  color: #9e2a2a;
}

.account-ios-row--danger .account-ios-row__title {
  color: #7a2222;
}

.account-ios-row__text {
  flex: 1 1 auto;
  min-width: 0;
}

.account-ios-row__title {
  font-size: 16px;
  font-weight: 500;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

.account-ios-row__sub {
  font-size: 13px;
  color: rgba(20, 24, 32, 0.45);
  margin-top: 2px;
  line-height: 1.25;
}

.account-ios-row__chev {
  flex-shrink: 0;
  font-size: 17px;
  color: rgba(20, 24, 32, 0.22);
  font-weight: 300;
}

.account-ios-row--no-chev .account-ios-row__chev {
  display: none;
}

.account-empty-section {
  text-align: center;
  padding: 28px 16px 24px;
  margin: 8px 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(20, 24, 32, 0.06);
}

.account-empty-section__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
  margin-bottom: 8px;
}

.account-empty-section__text {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(20, 24, 32, 0.5);
  max-width: 280px;
  margin: 0 auto;
}

.account-captcha-hint {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(20, 24, 32, 0.48);
  margin-bottom: 8px;
}

.account-list--loading {
  padding: 32px 12px;
  text-align: center;
}

.account-loading__label {
  font-size: 14px;
  color: rgba(20, 24, 32, 0.45);
  margin-bottom: 12px;
}

.account-loading__bar {
  height: 3px;
  width: 100%;
  max-width: 160px;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(0, 113, 227, 0.12),
    rgba(0, 113, 227, 0.38),
    rgba(0, 113, 227, 0.12)
  );
  background-size: 200% 100%;
  animation: accountLoadingShimmer 0.9s ease-in-out infinite;
}

@keyframes accountLoadingShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-loading__bar {
    animation: none;
  }
}

/* Guest */
.account-empty {
  text-align: center;
  padding: 28px 12px 16px;
}

.account-empty__title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.account-empty__text {
  margin: 0 auto 22px;
  max-width: 260px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(20, 24, 32, 0.55);
}

.account-empty__cta {
  min-width: 200px;
}

/* Form */
.account-form__hint {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(20, 24, 32, 0.62);
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(0, 113, 227, 0.08);
  border-radius: 12px;
}

.account-field {
  margin-bottom: 14px;
}

.account-field__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(20, 24, 32, 0.45);
  margin-bottom: 6px;
}

.account-field__input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(20, 24, 32, 0.12);
  padding: 12px 14px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.account-field__error {
  min-height: 18px;
  margin-top: 6px;
  font-size: 13px;
  color: #d92d20;
}

.account-captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.account-captcha-row__puzzle {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.28em;
  font-variant-numeric: tabular-nums;
  padding: 8px 12px;
  background: rgba(20, 24, 32, 0.06);
  border-radius: 10px;
}

.account-captcha-row__refresh {
  border: none;
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.account-form__submit {
  width: 100%;
  margin-top: 8px;
}

/* Dashboard + settings rows */
.account-dashboard__user {
  padding: 4px 4px 16px;
  border-bottom: 1px solid rgba(20, 24, 32, 0.08);
  margin-bottom: 8px;
}

.account-dashboard__name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.account-dashboard__phone {
  margin-top: 4px;
  font-size: 14px;
  color: rgba(20, 24, 32, 0.48);
}

.account-settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: rgba(255, 255, 255, 0.42);
  padding: 12px 12px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(20, 24, 32, 0.06);
}

.account-settings-row:active {
  background: rgba(0, 113, 227, 0.08);
}

.account-settings-row--danger .account-settings-row__title {
  color: #c41c1c;
}

.account-settings-row__text {
  min-width: 0;
}

.account-settings-row__title {
  font-size: 16px;
  font-weight: 500;
}

.account-settings-row__sub {
  font-size: 13px;
  color: rgba(20, 24, 32, 0.45);
  margin-top: 2px;
}

.account-settings-row__chev {
  flex-shrink: 0;
  font-size: 18px;
  color: rgba(20, 24, 32, 0.28);
}

/* Lists */
.account-muted {
  font-size: 15px;
  color: rgba(20, 24, 32, 0.5);
  padding: 20px 8px;
  text-align: center;
}

.account-list-row {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: rgba(255, 255, 255, 0.42);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  border: 1px solid rgba(20, 24, 32, 0.06);
}

.account-list-row__title {
  font-weight: 600;
  font-size: 15px;
}

.account-list-row__meta {
  font-size: 13px;
  color: rgba(20, 24, 32, 0.48);
  margin-top: 4px;
}

.account-list-row__summary {
  font-size: 13px;
  color: rgba(20, 24, 32, 0.62);
  margin-top: 6px;
  line-height: 1.35;
}

.account-detail__badge {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 113, 227, 0.9);
  margin-bottom: 8px;
}

.account-detail__line {
  font-size: 14px;
  margin-bottom: 6px;
  color: rgba(20, 24, 32, 0.72);
}

.account-detail__block-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(20, 24, 32, 0.42);
  margin: 14px 0 8px;
}

.account-detail__text {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(20, 24, 32, 0.78);
}

.account-detail__items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-detail__item {
  font-size: 14px;
  padding: 8px 10px;
  background: rgba(20, 24, 32, 0.04);
  border-radius: 10px;
}

.account-detail__serial {
  font-size: 13px;
  color: rgba(20, 24, 32, 0.55);
  margin-left: 10px;
}

.account-detail__strong {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 600;
}

.account-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(20, 24, 32, 0.06);
  margin-bottom: 8px;
}

.account-card__title {
  font-weight: 600;
  font-size: 15px;
}

.account-card__meta {
  font-size: 13px;
  color: rgba(20, 24, 32, 0.55);
  margin-top: 4px;
}

.account-support__text {
  font-size: 15px;
  line-height: 1.45;
  color: rgba(20, 24, 32, 0.72);
  margin: 0 0 16px;
}

.account-support__btn {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  box-sizing: border-box;
}

.account-delete__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
}

.account-delete__text {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(20, 24, 32, 0.62);
}

.account-delete__actions {
  display: flex;
  gap: 10px;
}

.account-delete__cancel,
.account-delete__ok {
  flex: 1;
}

.btn-danger {
  background: #d92d20;
  color: #fff;
  border: none;
}

.btn-danger:active {
  opacity: 0.88;
}

/* Модалка: доступ к ЛК только из Telegram / после верификации */
.cabinet-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cabinet-gate-modal:not(.hidden) {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.cabinet-gate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--topbar-overlay-backdrop-tint);
}

.cabinet-gate-modal__panel {
  position: relative;
  width: min(100%, 340px);
  padding: 22px 20px 18px;
  border-radius: 20px;
  background: var(--glass-overlay-bg);
  border: 1px solid var(--glass-overlay-border);
  backdrop-filter: blur(var(--glass-overlay-blur));
  -webkit-backdrop-filter: blur(var(--glass-overlay-blur));
  box-shadow: var(--glass-overlay-shadow);
}

.cabinet-gate-modal__text {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(17, 24, 39, 0.88);
  white-space: pre-line;
}

.cabinet-gate-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cabinet-gate-modal__link {
  text-align: center;
  text-decoration: none;
  display: block;
}

.btn-secondary {
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.12);
}
