/* Личный кабинет и тарифы — дополнение к style.css */

/* Сброс «системных» кнопок Windows / macOS */
.account-page button,
.account-page input,
.account-page select,
.account-page textarea {
  font-family: var(--font);
}

.account-page button {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.account-page input[type='checkbox'] {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.account-page {
  min-height: calc(100vh - var(--header-h));
  padding: 2rem 1.25rem 4rem;
}

.account-inner {
  max-width: 560px;
  margin: 0 auto;
}

.account-inner--wide {
  max-width: 720px;
}

.account-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem;
  margin-bottom: 1rem;
}

.account-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.account-card .lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-field input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  outline: none;
}

.form-field input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.25rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 2.75rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--cta-text);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.form-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.form-error {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border-radius: var(--radius);
  display: none;
}

.form-error.is-visible {
  display: block;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-trial {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.badge-active {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 0;
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-tile {
  text-align: center;
  padding: 1rem 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-tile strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.stat-tile span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.account-email {
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* —— Тарифы (главная + оплата) —— */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (max-width: 640px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.price-card {
  position: relative;
  padding: 1.5rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.price-card.is-featured {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.price-card .price-badge {
  position: absolute;
  top: -0.6rem;
  right: 1rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--cta-text);
  border-radius: 999px;
}

.price-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.price-card .price-amount {
  margin: 0.5rem 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.price-card .price-amount small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.price-card ul {
  margin: 0.75rem 0 1.25rem;
  padding: 0;
  list-style: none;
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.price-card li {
  padding: 0.25rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.price-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.price-card .btn {
  width: 100%;
}

.pay-grid .price-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.pay-note {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--accent-dim);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.loading-screen {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.form-hint code {
  font-size: 0.8em;
  opacity: 0.9;
}

.form-success {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #6ee7b7;
  display: none;
}

.form-success.is-visible {
  display: block;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}

.form-check input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.form-check a {
  color: var(--accent);
}

.form-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.92rem;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}

.link-btn:hover {
  text-decoration: underline;
}

.nav-link-btn {
  font-size: 0.95rem;
}

.form-field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  padding-right: 2.5rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ba1a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}

.form-field select:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-actions--row {
  flex-direction: row;
  flex-wrap: wrap;
}

.admin-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 1.25rem 0;
}

.admin-lookup {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(31, 206, 203, 0.06);
  border: 1px solid rgba(31, 206, 203, 0.2);
  border-radius: var(--radius);
}

.admin-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  min-height: 2.35rem;
}

/* Вкладки вход / регистрация */
.auth-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 0.3rem;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.auth-tab {
  flex: 1;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  appearance: none;
  transition: background 0.15s, color 0.15s;
}

.auth-tab:hover:not(.is-active) {
  color: var(--text);
}

.auth-tab.is-active {
  background: var(--accent);
  color: var(--cta-text);
}

/* Админка */
.admin-search-row {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}

.admin-search-row .form-field {
  flex: 1;
  margin-bottom: 0;
}

.admin-search-row .btn {
  align-self: flex-end;
  min-width: 7.5rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}

@media (max-width: 560px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-search-row {
    flex-direction: column;
  }

  .admin-search-row .btn {
    width: 100%;
  }
}

.admin-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.site-header .nav .link-btn.nav-link-btn {
  color: var(--text-muted);
  padding: 0.35rem 0;
}

.site-header .nav .link-btn.nav-link-btn:hover {
  color: var(--accent);
}

.admin-presets .btn-ghost {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-presets .btn-ghost:hover:not(:disabled) {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Промокод */
.promo-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.promo-field {
  flex: 1;
  min-width: 180px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  outline: none;
}

.promo-field:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Вкладки админки */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-tab-btn {
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.admin-tab-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.admin-tab-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Метрики */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1rem 0.9rem;
  text-align: center;
}

.stat-card-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Таблица пользователей */
.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-users-table th {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.admin-users-table td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}

.admin-users-table tr:last-child td {
  border-bottom: none;
}

.sub-badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.sub-badge--trial { background: rgba(255,193,7,0.18); color: #f0c040; }
.sub-badge--active { background: rgba(31,206,203,0.18); color: #1FCECB; }
.sub-badge--expired { background: rgba(220,50,50,0.18); color: #e05555; }
.sub-badge--cancelled { background: rgba(127,127,127,0.18); color: #999; }
.sub-badge--none { background: rgba(127,127,127,0.10); color: #777; }

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Список промокодов */
.promo-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.promo-list-table th {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.promo-list-table td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}

.promo-list-table tr:last-child td {
  border-bottom: none;
}

.promo-code-val {
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* Поиск */
.admin-search-bar {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.admin-search-bar input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  outline: none;
}

.admin-search-bar input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
