.auth-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.auth-card {
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-note {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.auth-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font: 11px/1 var(--mono);
  color: var(--dim);
  letter-spacing: 0.06em;
}

.auth-progress span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.auth-progress span.is-current {
  border-color: rgba(200, 178, 106, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field > * {
  margin: 0;
}

#profile-form,
#password-form {
  display: flex;
  flex-direction: column;
}

#profile-form > .field:last-of-type,
#password-form > .field:last-of-type {
  margin-bottom: 0;
}

#profile-form > .btn,
#password-form > .btn {
  margin-top: 18px;
  align-self: flex-start;
}

.field-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font: 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.field-label a {
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--sans);
  font-size: 12px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(6, 7, 9, 0.7);
  color: var(--text);
  font: 14.5px/1.2 var(--sans);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: rgba(200, 178, 106, 0.6);
  box-shadow: 0 0 0 3px rgba(200, 178, 106, 0.12);
}

.field input[readonly] {
  color: var(--dim);
  border-style: dashed;
}

.field-hint {
  font-size: 11.5px;
  color: var(--dim);
}

.field-error {
  font-size: 12px;
  color: #e5a0a0;
}

.password-row {
  position: relative;
  display: block;
  font-size: 0;
}

.password-row input {
  padding-right: 46px;
  font-size: 14.5px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font: 11px/1 var(--mono);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
}

.strength {
  display: flex;
  gap: 5px;
}

.strength i {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.strength[data-score="1"] i:nth-child(-n + 1),
.strength[data-score="2"] i:nth-child(-n + 2),
.strength[data-score="3"] i:nth-child(-n + 3),
.strength[data-score="4"] i:nth-child(-n + 4) {
  background: var(--accent);
}

.strength[data-score="1"] i:nth-child(-n + 1) {
  background: #d16a6a;
}

.strength-label {
  font-size: 11.5px;
  color: var(--dim);
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
}

.auth-alt {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-alt a {
  color: var(--accent);
}

.alert {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.5;
}

.alert.hidden {
  display: none;
}

.alert-error {
  border-color: rgba(209, 106, 106, 0.4);
  background: rgba(209, 106, 106, 0.1);
  color: #e9b1b1;
}

.alert-ok {
  border-color: rgba(111, 191, 115, 0.4);
  background: rgba(111, 191, 115, 0.1);
  color: #b8e0ba;
}

.alert-info {
  border-color: rgba(200, 178, 106, 0.35);
  background: rgba(200, 178, 106, 0.09);
  color: #dfd0a4;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: 500 13.5px/1 var(--sans);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-danger {
  border-color: rgba(209, 106, 106, 0.4);
  color: #e9b1b1;
}

.btn-danger:hover {
  background: rgba(209, 106, 106, 0.12);
  border-color: rgba(209, 106, 106, 0.6);
}

.btn[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* ---------- кабинет ---------- */

.account-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 32px 80px;
}

.account-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.avatar {
  position: relative;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.avatar-edit {
  position: absolute;
  inset: auto 0 0 0;
  padding: 6px 0;
  border: 0;
  background: rgba(6, 7, 9, 0.78);
  color: var(--text);
  font: 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.avatar:hover .avatar-edit,
.avatar:focus-within .avatar-edit {
  opacity: 1;
}

.account-identity h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 600;
}

.account-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.panel-head-note {
  font: 11px/1 var(--mono);
  color: var(--dim);
}

.panel-body {
  padding: 20px;
}

.panel + .panel {
  margin-top: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.stat-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.stat-box b {
  display: block;
  font: 600 20px/1.1 var(--mono);
  color: var(--text);
}

.stat-box span {
  display: block;
  margin-top: 6px;
  font: 10.5px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 88px;
  margin-top: 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.chart-bar {
  flex: 1;
  min-width: 4px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #d7c282, rgba(200, 178, 106, 0.25));
  min-height: 3px;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font: 10px/1 var(--mono);
  color: var(--dim);
}

.pack-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.pack-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
}

.pack-line span:first-child {
  font-family: var(--mono);
  color: var(--text);
}

.pack-line span:last-child {
  color: var(--dim);
  font: 11.5px/1 var(--mono);
}

.device-list {
  display: grid;
  gap: 10px;
}

.device {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.device.is-current {
  border-color: rgba(200, 178, 106, 0.4);
  background: var(--accent-soft);
}

.device-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
}

.device-meta {
  margin: 5px 0 0;
  font: 11px/1.5 var(--mono);
  color: var(--dim);
  word-break: break-word;
}

.history-list {
  display: grid;
  gap: 6px;
}

.history-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.history-line:last-child {
  border-bottom: 0;
}

.history-line b {
  font-weight: 500;
}

.history-line span {
  font: 11px/1.4 var(--mono);
  color: var(--dim);
  text-align: right;
}

.tab-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.tab-nav button {
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 13.5px/1 var(--sans);
  cursor: pointer;
}

.tab-nav button.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-panel[hidden] {
  display: none;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.empty-note {
  margin: 0;
  padding: 18px 0;
  color: var(--dim);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  resize: vertical;
  min-height: 74px;
}

.field textarea:focus {
  outline: none;
  border-color: rgba(200, 178, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(200, 178, 106, 0.12);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 10.5px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.badge-actual {
  color: var(--ok);
  border-color: rgba(111, 191, 115, 0.35);
  background: rgba(111, 191, 115, 0.1);
}

.badge-revoked {
  color: var(--err);
  border-color: rgba(209, 106, 106, 0.35);
  background: rgba(209, 106, 106, 0.1);
}

.account-main + .footer {
  justify-content: center;
  font: 11.5px/1.5 var(--mono);
}

.account-main + .footer .sep {
  opacity: 0.5;
}

@media (max-width: 860px) {
  .account-main {
    padding: 28px 20px 56px;
  }
  .account-grid {
    grid-template-columns: 1fr;
  }
  .account-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .auth-main {
    padding: 28px 16px 56px;
  }
  .auth-card {
    padding: 20px;
  }
}
