/* ── Account page ───────────────────────────────────────────── */
.account-page {
  padding: 96px 16px 80px;
}

.account-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.account-avatar-wrap { flex-shrink: 0; }

.account-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
}

.account-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #9ca3af;
}

.account-greeting { flex: 1; min-width: 0; }
.account-greeting__email { font-size: 13px; color: #6b7280; margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-greeting__uid { font-size: 12px; color: #9ca3af; margin-top: 2px; display: flex; align-items: center; gap: 2px; }
.uid-copy-btn { background: none; border: none; padding: 0 0 0 3px; cursor: pointer; color: #9ca3af; vertical-align: middle; transition: color .2s; line-height: 1; }
.uid-copy-btn:hover { color: #6b7280; }
.uid-copy-btn.copied { color: #4ade80; }

.account-logout {
  font-size: 14px;
  color: #6b7280;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  white-space: nowrap;
}
.account-logout:hover { background: #f9fafb; color: #374151; }

/* Cards */
.account-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
@media (max-width: 600px) { .account-cards { grid-template-columns: 1fr; } }

/* Top grid: Balance (compact) + Top-up form */
.account-top-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}
@media (max-width: 640px) { .account-top-grid { grid-template-columns: 1fr; } }

.account-topup-card { padding: 20px 24px; }
.account-topup-card .account-card__label { margin-bottom: 12px; }

/* Tools grid: 2 tool cards */
.account-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
@media (max-width: 600px) { .account-tools-grid { grid-template-columns: 1fr; } }

/* Limit bars */
.account-limits { margin: 10px 0 14px; }
.account-limit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #374151;
  margin-bottom: 6px;
}
.account-limit-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.account-limit-bar__fill {
  height: 100%;
  background: #4EA0D2;
  border-radius: 3px;
  transition: width .3s;
}
.account-limit-row--paid { color: #059669; font-weight: 500; }
.account-limit-zero { color: #dc2626; font-weight: 600; }
.account-limit-reset { font-size: 12px; color: #9ca3af; margin-bottom: 4px; }
.account-card__actions { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.account-card__buy {
  font-size: 13px;
  color: #059669;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
}
.account-card__buy:hover { text-decoration: underline; }

.account-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
}
.account-card--balance { border-color: #4EA0D2; background: #f0f8ff; display: flex; flex-direction: column; }

.account-card__label { font-size: 13px; color: #6b7280; font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.account-card__value { font-size: 32px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; }
.account-card--balance .account-card__value { color: #4EA0D2; }
.account-card__hint { font-size: 13px; color: #9ca3af; margin-bottom: 12px; }
.account-card__link { font-size: 14px; color: #4EA0D2; text-decoration: none; font-weight: 500; display: inline-block; }
.account-card__link:hover { text-decoration: underline; }
.btn--link { background: none; border: none; cursor: pointer; padding: 0; }

/* History / sections */
.account-section { margin-bottom: 40px; }
.account-section__title { font-size: 18px; font-weight: 600; color: #1a1a2e; margin-bottom: 8px; }
.account-section__desc { font-size: 14px; color: #6b7280; margin-bottom: 20px; }

/* Top-up */
.topup-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.topup-pkg-wrap {
  position: relative;
}
.topup-amount-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 10px 8px;
  background: #fff;
  border: 1.5px solid #4EA0D2;
  border-radius: 10px;
  color: #4EA0D2;
  cursor: pointer;
  transition: background .15s, color .15s;
  gap: 2px;
  text-align: center;
}
.topup-amount-btn:hover,
.topup-amount-btn--active { background: #4EA0D2; color: #fff; }
.topup-pkg-rub { font-size: 15px; font-weight: 700; }
.topup-pkg-tokens { font-size: 11px; background: #DCFCE7; color: #15803d; border-radius: 4px; padding: 1px 5px; font-weight: 500; }
.topup-amount-btn:hover .topup-pkg-tokens,
.topup-amount-btn--active .topup-pkg-tokens { background: rgba(255,255,255,0.2); color: #fff; }
.topup-pkg-bonus { font-size: 12px; background: rgba(255,255,255,.25); border-radius: 6px; padding: 1px 5px; margin-top: 2px; font-weight: 600; }
.topup-amount-btn--active .topup-pkg-bonus { background: rgba(255,255,255,.3); }
.topup-custom { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.topup-custom__label { font-size: 14px; color: #6b7280; white-space: nowrap; flex-shrink: 0; }
.topup-custom__hint { font-size: 14px; color: #6b7280; white-space: nowrap; }
.topup-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}
.topup-input--custom { width: 150px; flex: none; text-align: left; }
.topup-input:focus { border-color: #4EA0D2; }

/* Account page H1 title */
.account-page__title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}

/* Account greeting name */
.account-greeting__name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 2px;
}
.topup-error { color: #dc2626; font-size: 13px; margin-top: 6px; }

.balance-payment-block {
  margin-top: auto;
  padding-top: 20px;
}
.balance-payment-label {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.balance-payment-icons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.balance-payment-icon {
  width: 100%;
  height: 26px;
  object-fit: contain;
  object-position: left center;
  opacity: 0.75;
}
.consent__text--small { font-size: 13px; line-height: 1.4; }
.topup-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
  line-height: 1;
  text-align: center;
}
.topup-secure-note svg { display: block; }
.topup-consent .consent { align-items: center; }
.topup-consent .consent__check { margin-top: 0; }

/* Promo code */
.account-promo-card { padding: 20px 24px; margin-bottom: 20px; }
.promo-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.promo-row .topup-input { max-width: 240px; font-size: 14px; }

/* Success banner */
.account-success-banner {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  padding: 12px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.account-table-wrap { overflow-x: auto; }
.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.account-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}
.account-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

/* Account layout with sidebar */
.account-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.account-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  position: sticky;
  top: 80px;
}

.account-sidebar__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s;
}
.account-sidebar__link:hover { background: #f3f4f6; }
.account-sidebar__link--active {
  background: var(--surface);
  color: var(--primary);
}
.account-sidebar__link svg { flex-shrink: 0; color: inherit; }

.account-content { flex: 1; min-width: 0; }

/* ── Account reviews status badges ──────────────────────── */
.acc-review-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .02em;
}
.acc-review-status--pending  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.acc-review-status--published { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.acc-review-status--rejected  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Inline edit form inside rcard ──────────────────────── */
.acc-review-edit {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}
.acc-review-edit__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ── 768px: планшет / мобильный ──────────────────────── */
@media (max-width: 768px) {
  .account-layout { flex-direction: column; gap: 0; overflow-x: hidden; }
  .account-sidebar {
    width: 100%;
    position: static;
    display: flex;
    flex-direction: row;
    padding: 4px;
    margin-bottom: 16px;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .account-sidebar__link {
    flex: 1;
    justify-content: center;
    padding: 8px 6px;
    font-size: 13px;
    white-space: nowrap;
  }
  .topup-amounts { grid-template-columns: repeat(2, 1fr); }

  .account-header { gap: 12px; padding-bottom: 16px; margin-bottom: 20px; }
  .account-card__value { font-size: 26px; }
  .account-card { padding: 18px; }
  .account-topup-card { padding: 16px; }

  /* Prevent iOS Safari auto-zoom on input focus (font-size must be ≥16px) */
  .topup-input { font-size: 16px; }
}

/* ── 600px: скрываем текст в сайдбаре, только иконки ── */
@media (max-width: 600px) {
  .account-sidebar__label { display: none; }
  .account-sidebar__link { gap: 0; padding: 10px 12px; flex: none; min-width: 48px; }
  .account-sidebar__link svg { width: 20px; height: 20px; }
}

/* ── 480px: мобильные телефоны ────────────────────────── */
@media (max-width: 480px) {
  .account-page { padding-top: 74px; padding-bottom: 56px; }
  .account-page__title { font-size: 18px; margin-bottom: 10px; }
  .account-section__title { font-size: 16px; }
  .account-section__desc { font-size: 13px; }

  /* Шапка профиля: аватар + инфо + выход */
  .account-header { flex-wrap: wrap; gap: 10px; padding-bottom: 14px; margin-bottom: 16px; }
  .account-greeting { flex: 1; min-width: 0; }
  .account-greeting__name { font-size: 14px; }
  .account-greeting__email { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-logout { font-size: 12px; padding: 5px 10px; margin-left: auto; }

  /* Баланс и пополнение — в колонку */
  .account-top-grid { gap: 12px; }
  .account-card { padding: 14px; }
  .account-card__value { font-size: 24px; }
  .account-card__label { font-size: 12px; }

  /* Кнопки пакетов — 2 в ряд, компактнее */
  .topup-amounts { gap: 8px; }
  .topup-amount-btn { padding: 8px 6px; }
  .topup-pkg-rub { font-size: 14px; }
  .topup-pkg-tokens { font-size: 11px; }

  /* Своя сумма */
  .topup-custom { flex-wrap: wrap; gap: 8px; }
  .topup-custom__label { width: 100%; margin-bottom: -4px; }
  .topup-input--custom { width: 100%; flex: 1; text-align: left; }
  .topup-custom__hint { font-size: 13px; }

  /* Промокод — стекуем в колонку */
  .promo-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .promo-row .topup-input { max-width: 100%; width: 100%; }
  .promo-row .btn { width: 100%; }

  /* История операций (таблица в account.html) */
  .account-table th, .account-table td { padding: 8px 10px; font-size: 13px; }

  /* Карточки и гриды */
  .account-cards { gap: 10px; }
  .account-tools-grid { gap: 10px; }
}
