/* =================================================================
   ЛИЧНЫЙ КАБИНЕТ - Стили
   ================================================================= */

/* Layout */
.ab-account {
  min-height: calc(100vh - 200px);
  padding-block: 40px;
}

.ab-account-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 991.98px) {
  .ab-account-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.ab-account-sidebar {
  background: var(--surface-1);
  border-radius: var(--r-lg);
  padding: 24px;
  position: sticky;
  top: 100px;
}

@media (max-width: 991.98px) {
  .ab-account-sidebar {
    position: static;
  }
}

.ab-account-sidebar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--surface-2);
}

.ab-account-sidebar__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.ab-account-sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.ab-account-sidebar__info strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ab-account-sidebar__info span {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Navigation */
.ab-account-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ab-account-nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-weight: 500;
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
}

.ab-account-nav__link:hover {
  background: var(--surface-2);
  color: var(--brand);
}

.ab-account-nav__link.is-active {
  background: var(--brand-100);
  color: var(--brand);
}

.ab-account-nav__link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ab-account-nav__badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.ab-account-nav__link--logout {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--surface-2);
  color: var(--ink-muted);
}

.ab-account-nav__link--logout:hover {
  color: var(--danger, #dc3545);
  background: rgba(220, 53, 69, 0.1);
}

/* Content */
.ab-account-content {
  background: var(--surface-1);
  border-radius: var(--r-lg);
  padding: 32px;
}

.ab-account__title {
  font-size: 28px;
  margin-bottom: 32px;
}

/* Banners */
.ab-account-banner {
  padding: 16px 20px;
  border-radius: var(--r-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ab-account-banner--warning {
  background: var(--accent-50, #fff8e1);
  border-left: 4px solid var(--accent);
  color: var(--ink);
}

.ab-account-banner--success {
  background: var(--success-50, #e8f5e9);
  border-left: 4px solid var(--success, #4caf50);
  color: var(--ink);
}

.ab-account-banner__resend {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.ab-account-banner__resend:hover {
  color: var(--brand-600);
}

/* Widgets Grid */
.ab-account-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.ab-account-widget {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 24px;
}

.ab-account-widget__title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.ab-account-widget__body {
  margin-bottom: 16px;
}

.ab-account-widget__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.ab-account-widget__row:not(:last-child) {
  border-bottom: 1px solid var(--surface-1);
}

.ab-account-widget__label {
  color: var(--ink-soft);
  font-size: 14px;
}

.ab-account-widget__value {
  font-weight: 600;
  color: var(--ink);
}

.ab-account-widget__balance {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 8px;
}

.ab-account-widget__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.ab-account-widget__status--active {
  background: var(--success-50, #e8f5e9);
  color: var(--success, #4caf50);
}

.ab-account-widget__status--expired {
  background: var(--danger-50, #ffebee);
  color: var(--danger, #dc3545);
}

.ab-account-widget__confirmed {
  color: var(--success, #4caf50);
  font-weight: 600;
}

.ab-account-widget__action {
  width: 100%;
  justify-content: center;
}

/* Notifications in widget */
.ab-account-widget__notification {
  padding: 12px 0;
  border-bottom: 1px solid var(--surface-1);
}

.ab-account-widget__notification:last-child {
  border-bottom: none;
}

.ab-account-widget__notification strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
}

.ab-account-widget__notification-date {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Forms */
.ab-account-form {
  max-width: 480px;
}

.ab-account-form__field {
  margin-bottom: 20px;
}

.ab-account-form__field label {
  display: block;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  font-size: 14px;
}

.ab-account-form__field .ab-input {
  width: 100%;
}

.ab-account-form__message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  display: none;
}

.ab-account-form__message.is-success {
  display: block;
  background: var(--success-50, #e8f5e9);
  color: var(--success, #4caf50);
}

.ab-account-form__message.is-error {
  display: block;
  background: var(--danger-50, #ffebee);
  color: var(--danger, #dc3545);
}

/* Tables */
.ab-account-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.ab-account-table th {
  text-align: left;
  padding: 12px;
  background: var(--surface-2);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
}

.ab-account-table td {
  padding: 12px;
  border-bottom: 1px solid var(--surface-2);
  font-size: 14px;
}

.ab-account-table tr:last-child td {
  border-bottom: none;
}

/* Transaction types */
.ab-transaction-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 16px;
}

.ab-transaction-type--credit {
  background: var(--success-50, #e8f5e9);
  color: var(--success, #4caf50);
}

.ab-transaction-type--debit {
  background: var(--danger-50, #ffebee);
  color: var(--danger, #dc3545);
}

/* Tariff cards */
.ab-tariff-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.ab-tariff-card {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 24px;
}

.ab-tariff-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.ab-tariff-card__price {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 16px;
}

.ab-tariff-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.ab-tariff-card li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: var(--ink-soft);
  font-size: 14px;
}

.ab-tariff-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success, #4caf50);
  font-weight: 700;
}

/* Notifications list */
.ab-notifications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ab-notification {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 16px 20px;
  transition: background var(--t-fast) var(--ease);
}

.ab-notification:hover {
  background: var(--surface-3, #e0e0e0);
}

.ab-notification--unread {
  background: var(--brand-50);
  border-left: 4px solid var(--brand);
}

.ab-notification__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 8px;
}

.ab-notification__header strong {
  font-size: 15px;
  color: var(--ink);
}

.ab-notification__date {
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.ab-notification__body {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* 2FA Section */
.ab-2fa-section {
  max-width: 480px;
}

.ab-2fa-qr {
  text-align: center;
  padding: 24px;
  background: white;
  border-radius: var(--r-md);
  margin-bottom: 20px;
}

.ab-2fa-qr img {
  max-width: 200px;
  height: auto;
}

.ab-2fa-backup {
  margin-top: 24px;
  padding: 20px;
  background: var(--accent-50, #fff8e1);
  border-radius: var(--r-md);
}

.ab-2fa-backup h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--ink);
}

.ab-2fa-backup__codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-family: monospace;
  font-size: 14px;
}

.ab-2fa-backup__code {
  padding: 8px 12px;
  background: white;
  border-radius: var(--r-sm);
  text-align: center;
}

/* Auth modal */
.ab-auth-form {
  padding: 32px;
}

.ab-auth-form__tabs {
  margin-bottom: 24px;
}

.ab-auth-form__field {
  margin-bottom: 20px;
}

.ab-auth-form__field label {
  display: block;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  font-size: 14px;
}

.ab-auth-form__field .ab-input {
  width: 100%;
}

.ab-auth-form__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.ab-auth-form__checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ab-auth-form__checkbox label {
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  margin: 0;
}

.ab-auth-form__submit {
  width: 100%;
  justify-content: center;
  margin-bottom: 16px;
}

.ab-auth-form__message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  display: none;
}

.ab-auth-form__message.is-success {
  display: block;
  background: var(--success-50, #e8f5e9);
  color: var(--success, #4caf50);
}

.ab-auth-form__message.is-error {
  display: block;
  background: var(--danger-50, #ffebee);
  color: var(--danger, #dc3545);
}

.ab-auth-form__link {
  display: block;
  text-align: center;
  color: var(--brand);
  font-size: 14px;
  text-decoration: underline;
  margin-top: 16px;
}

.ab-auth-form__link:hover {
  color: var(--brand-600);
}

/* Sections */
.ab-account-section {
  margin-bottom: 40px;
}

.ab-account-section:last-child {
  margin-bottom: 0;
}

.ab-account-section h2 {
  font-size: 20px;
  margin-bottom: 20px;
}
