/* Личный кабинет — использует токены и .btn/.container из site.css, добавляет
   компоненты рабочего экрана: карточки статуса, формы, список устройств. */

body { min-height: 100vh; }

.auth-shell { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius-lg); padding: 36px; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-variant); border-radius: 999px; padding: 4px; margin-bottom: 26px; }
.auth-tab { flex: 1; border: none; background: none; color: var(--text-muted); padding: 9px; border-radius: 999px; font-weight: 700; font-size: 13.5px; font-family: var(--font-display); }
.auth-tab[aria-selected="true"] { background: var(--accent-strong); color: #fff; }
.auth-title { font-size: 20px; margin-bottom: 6px; }
.auth-sub { color: var(--text-faint); font-size: 13.5px; margin-bottom: 22px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.field input {
  background: var(--bg-raised); border: 1px solid var(--outline); border-radius: var(--radius-sm);
  padding: 11px 13px; color: var(--text); font-size: 14.5px; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--accent); }
.password-row { position: relative; display: flex; }
.password-row input { flex: 1; padding-right: 42px; }
.btn-eye { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 34px; background: none; border: none; color: var(--text-faint); font-size: 15px; }
.field-error { font-size: 12.5px; color: var(--error); min-height: 15px; }
.field-hint { font-size: 12px; color: var(--text-faint); }
.link-inline { color: var(--accent); font-weight: 600; font-size: 13px; }
.auth-switch { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--text-faint); }
.code-digits { display: flex; gap: 8px; }
.code-digits input {
  width: 42px; height: 50px; text-align: center; font-size: 20px; font-family: var(--font-display); font-weight: 700;
}

/* ---------- Dashboard shell ---------- */
.dash-nav { position: sticky; top: 0; z-index: 30; background: rgba(10,13,21,0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--outline-soft); }
.dash-nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.dash-main { max-width: 880px; margin: 0 auto; padding: 40px 24px 80px; display: flex; flex-direction: column; gap: 28px; }

.card { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); padding: 26px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active { background: var(--success-soft); color: var(--success-glow); }
.badge-trial { background: var(--accent-soft); color: var(--accent); }
.badge-grace { background: var(--warning-soft); color: #FFB35C; }
.badge-expired, .badge-none { background: var(--error-soft); color: #FF6B75; }

.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
@media (max-width: 640px) { .status-grid { grid-template-columns: 1fr 1fr; } }
.status-metric-label { font-size: 12px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.status-metric-value { font-family: var(--font-display); font-size: 20px; font-weight: 800; }

.progress-track { height: 8px; border-radius: 999px; background: var(--surface-variant); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius: 999px; transition: width 0.3s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-faint); margin-top: 8px; }

.empty-state { text-align: center; padding: 20px 0; }
.empty-state p { color: var(--text-muted); margin-bottom: 18px; font-size: 14px; }

.plan-mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .plan-mini-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .plan-mini-grid { grid-template-columns: 1fr; } }
.plan-mini {
  background: var(--bg-raised); border: 1px solid var(--outline); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.plan-mini.current { border-color: var(--accent); }
.plan-mini-name { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.plan-mini-price { font-family: var(--font-display); font-size: 21px; font-weight: 800; }
.plan-mini-price span { font-size: 12px; color: var(--text-faint); font-weight: 600; }

.device-list { display: flex; flex-direction: column; gap: 1px; background: var(--outline); border-radius: var(--radius-sm); overflow: hidden; }
.device-row { background: var(--bg-raised); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.device-name { font-weight: 700; font-size: 14px; }
.device-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-danger-ghost { background: none; border: 1px solid var(--outline); color: #FF6B75; }
.btn-danger-ghost:hover { border-color: var(--error); background: var(--error-soft); }

.telegram-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.telegram-row p { color: var(--text-muted); font-size: 13.5px; max-width: 380px; }

.danger-zone { border-color: var(--error-soft); }
.danger-zone .card-head h2 { color: #FF6B75; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface-variant); border: 1px solid var(--outline); color: var(--text);
  padding: 13px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 100;
}
.toast-error { border-color: var(--error); color: #FF9AA2; }
.toast-success { border-color: var(--success); color: var(--success-glow); }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
