/* =========================================================
   lygrax pages — кабинет пользователя
   ========================================================= */

.account-page {
  min-height: 100vh;
  background: #1e1e1e;
}

/* ---------- top bar ---------- */
.cab-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 61px;
  padding-right: 30px;
  border-bottom: 1px solid #3d3d3d;
  background: #1e1e1e;
}

.cab-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
}

.cab-brand img {
  display: block;
  width: 60px;
  height: 60px;
}

.cab-top__right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.cab-top__link {
  color: var(--white);
  font-size: 14px;
  line-height: 14px;
  transition: color 0.18s ease;
}

.cab-top__link:hover {
  color: var(--pink);
}

.cab-top__link.is-active {
  color: #8f8f8f;
}

/* ---------- layout ---------- */
.cab {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}

.cab-side {
  position: sticky;
  top: 61px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 61px);
  height: calc(100svh - 61px);
  border-right: 1px solid #3d3d3d;
}

.cab-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 81px;
  padding: 20px;
  border-bottom: 1px solid #3d3d3d;
}

.cab-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: #656565;
  color: var(--white);
  font-size: 21px;
  line-height: 21px;
}

.cab-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cab-avatar img[hidden] {
  display: none;
}

.cab-user__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cab-user__name {
  overflow: hidden;
  color: #c0c0c0;
  font-size: 16px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cab-user__email {
  overflow: hidden;
  color: #717171;
  font-size: 13px;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cab-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  overflow-y: auto;
}

.cab-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding-right: 10px;
  border-radius: 8px;
  color: #c0c0c0;
  font-size: 14px;
  line-height: 14px;
  transition: background 0.18s ease, color 0.18s ease;
}

.cab-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.cab-nav a.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.cab-nav__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #656565;
  color: var(--white);
  transition: background 0.18s ease, color 0.18s ease;
}

.cab-nav a.is-active .cab-nav__icon {
  background: #f9f9f9;
  color: #1e1e1e;
}

.cab-nav__icon svg {
  width: 18px;
  height: 18px;
}

.cab-side__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 18px 20px;
  border-top: 1px solid #3d3d3d;
  color: #8f8f8f;
  font-size: 12px;
  line-height: 1.2;
}

.cab-side__foot a,
.cab-side__foot button {
  padding: 0;
  border: 0;
  background: none;
  color: #8f8f8f;
  font: inherit;
  cursor: pointer;
  transition: color 0.18s ease;
}

.cab-side__foot a:hover,
.cab-side__foot button:hover {
  color: var(--white);
}

/* ---------- main ---------- */
.cab-main {
  min-width: 0;
  padding: 30px 31px 80px 40px;
}

.cab-view[hidden] {
  display: none;
}

.cab-view {
  animation: cab-in 0.24s ease both;
}

@keyframes cab-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cab-title {
  margin-bottom: 27px;
  color: #c0c0c0;
  font-size: 28px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: -0.01em;
}

.cab-title:focus {
  outline: none;
}

.cab-subtitle {
  max-width: 620px;
  margin: -16px 0 26px;
  color: #8f8f8f;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- buttons ---------- */
.cab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font: inherit;
  font-size: 12px;
  line-height: 12px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cab-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.cab-btn--light {
  background: #f9f9f9;
  color: #1e1e1e;
}

.cab-btn--light:hover {
  background: #ffffff;
}

.cab-btn--ghost {
  border-color: #555555;
  background: transparent;
}

.cab-btn--ghost:hover {
  border-color: #8a8a8a;
  background: rgba(255, 255, 255, 0.05);
}

.cab-btn[disabled] {
  opacity: 0.45;
  cursor: default;
}

.cab-btn[disabled]:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- licenses ---------- */
.lic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.lic-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.lic-card--accent {
  background: #1a286c;
}

.lic-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.lic-card__info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}

.lic-logo {
  display: block;
  width: 136px;
  max-width: 100%;
  height: 35px;
}

.lic-logo--lygrax {
  display: flex;
  align-items: center;
  gap: 11px;
  width: auto;
}

.lic-logo--lygrax img:first-child {
  width: 35px;
  height: 35px;
}

.lic-logo--lygrax img:last-child {
  width: 96px;
  height: 28px;
}

.lic-desc {
  max-width: 280px;
  color: #c0c0c0;
  font-size: 10px;
  line-height: 12px;
}

.lic-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lic-toggle__item {
  padding: 10px 15px;
  border: 0;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font: inherit;
  font-size: 10px;
  line-height: 10px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

button.lic-toggle__item:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lic-toggle__item.is-active {
  background: var(--white);
  color: #2f2f2f;
  cursor: default;
}

.lic-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #c0c0c0;
  font-size: 12px;
  line-height: 16px;
}

.lic-card__top + .lic-card__foot {
  margin-top: 40px;
}

.lic-price {
  color: var(--white);
  font-size: 16px;
  line-height: 16px;
  white-space: nowrap;
}

/* ---------- payments ---------- */
.pay-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 506px;
}

.pay-card {
  padding: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.pay-card--accent {
  background: #1a286c;
}

.pay-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pay-logo {
  display: block;
  flex: 0 0 auto;
  width: 136px;
  max-width: 45%;
  height: 35px;
}

.pay-logo--lygrax {
  display: flex;
  align-items: center;
  gap: 11px;
  width: auto;
  max-width: 45%;
}

.pay-logo--lygrax img:first-child {
  width: 35px;
  height: 35px;
}

.pay-logo--lygrax img:last-child {
  width: 96px;
  height: 28px;
  max-width: 100%;
}

.pay-note {
  width: 190px;
  max-width: 45%;
  color: #c0c0c0;
  font-size: 10px;
  line-height: 12px;
}

.pay-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #c0c0c0;
  font-size: 12px;
  line-height: 16px;
}

.pay-price {
  color: var(--white);
  font-size: 16px;
  line-height: 16px;
  white-space: nowrap;
}

/* ---------- downloads ---------- */
.dl-block + .dl-block {
  margin-top: 32px;
}

.dl-group__title {
  margin-bottom: 14px;
  color: #c0c0c0;
  font-size: 16px;
  line-height: 16px;
}

.dl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dl-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.dl-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dl-logo {
  display: block;
  width: 136px;
  max-width: 100%;
  height: 35px;
}

.dl-logo--lygrax {
  display: flex;
  align-items: center;
  gap: 11px;
  width: auto;
}

.dl-logo--lygrax img:first-child {
  width: 35px;
  height: 35px;
}

.dl-logo--lygrax img:last-child {
  width: 96px;
  height: 28px;
}

.dl-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #c0c0c0;
  font-size: 12px;
  line-height: 16px;
}

.dl-platform {
  color: var(--white);
  font-size: 16px;
  line-height: 16px;
}

/* ---------- empty state ---------- */
.empty {
  max-width: 660px;
  padding: 40px;
  border: 1px dashed #555555;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #c0c0c0;
}

.empty__icon svg {
  width: 24px;
  height: 24px;
}

.empty h2 {
  margin-bottom: 10px;
  color: var(--white);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
}

.empty p {
  max-width: 520px;
  color: #9b9b9b;
  font-size: 14px;
  line-height: 1.55;
}

.empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* ---------- training ---------- */
.train-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1000px;
}

.train-card {
  display: flex;
  flex-direction: column;
  min-height: 170px;
  padding: 24px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.18s ease;
}

.train-card:hover {
  background: rgba(255, 255, 255, 0.14);
}

.train-card--wide {
  grid-column: 1 / -1;
  min-height: 0;
  background: #1a286c;
}

.train-card--wide:hover {
  background: #21317e;
}

.train-card__tag {
  margin-bottom: 14px;
  color: #ffb3c3;
  font-size: 10px;
  line-height: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.train-card h2 {
  margin-bottom: 10px;
  color: var(--white);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
}

.train-card p {
  max-width: 560px;
  color: #c0c0c0;
  font-size: 13px;
  line-height: 1.55;
}

.train-card__more {
  margin-top: auto;
  padding-top: 20px;
  color: var(--white);
  font-size: 12px;
  line-height: 12px;
  text-transform: uppercase;
}

.train-card__more::after {
  content: " →";
}

/* ---------- settings ---------- */
.profile {
  max-width: 660px;
}

.profile__card {
  padding: 24px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.profile__avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 50%;
  background: #656565;
  color: var(--white);
  font-size: 32px;
  line-height: 32px;
}

.profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar img[hidden] {
  display: none;
}

.profile__avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile__hint {
  margin-top: 9px;
  color: #8f8f8f;
  font-size: 11px;
  line-height: 1.45;
}

.profile__fields {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.prof-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.prof-field > span {
  color: #c0c0c0;
  font-size: 12px;
  line-height: 1.3;
}

.prof-field em {
  color: #717171;
  font-style: normal;
}

.prof-field input {
  width: 100%;
  padding: 12px;
  border: 1px solid #555555;
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 15px;
  line-height: 18px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.prof-field input:focus {
  border-color: #9a9a9a;
  background: rgba(255, 255, 255, 0.02);
}

.prof-field input[readonly] {
  color: #8f8f8f;
  cursor: default;
}

.prof-field input::placeholder {
  color: #717171;
}

.profile__note {
  margin-top: 18px;
  color: #8f8f8f;
  font-size: 11px;
  line-height: 1.5;
}

.profile__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.profile__status {
  color: #8fe6b8;
  font-size: 12px;
  line-height: 1.4;
}

.profile__status[hidden] {
  display: none;
}

.profile__status.is-error {
  color: #ff9dac;
}

.profile__danger {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 660px;
  margin-top: 16px;
  padding: 20px 24px;
  border: 1px solid #3d3d3d;
  border-radius: 10px;
}

.profile__danger h2 {
  margin-bottom: 4px;
  color: var(--white);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
}

.profile__danger p {
  color: #8f8f8f;
  font-size: 12px;
  line-height: 1.45;
}

/* ---------- toast ---------- */
.cab-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  max-width: min(90vw, 460px);
  padding: 12px 18px;
  border-radius: 8px;
  background: #f9f9f9;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #1e1e1e;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

.cab-toast[hidden] {
  display: none;
}

/* =========================================================
   responsive
   ========================================================= */
@media (max-width: 1600px) {
  .lic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dl-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1300px) {
  .cab {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .cab-main {
    padding: 28px 24px 70px 32px;
  }

  .dl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .lic-grid {
    grid-template-columns: 1fr;
  }

  .lic-desc {
    max-width: 420px;
  }
}

@media (max-width: 860px) {
  .cab-top {
    padding-right: 16px;
  }

  .cab-brand,
  .cab-brand img {
    width: 52px;
    height: 52px;
  }

  .cab {
    display: block;
  }

  .cab-side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #3d3d3d;
  }

  .cab-user {
    padding: 14px 18px;
    border-bottom: 0;
  }

  .cab-nav {
    flex-direction: row;
    gap: 8px;
    padding: 4px 16px 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .cab-nav::-webkit-scrollbar {
    display: none;
  }

  .cab-nav a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px 0 0;
    font-size: 13px;
  }

  .cab-nav__icon {
    width: 36px;
    height: 36px;
  }

  .cab-side__foot {
    display: none;
  }

  .cab-main {
    padding: 24px 18px 60px;
  }

  .cab-title {
    margin-bottom: 20px;
    font-size: 24px;
    line-height: 24px;
  }

  .train-grid {
    grid-template-columns: 1fr;
  }

  .train-card--wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .cab-main {
    padding: 22px 16px 52px;
  }

  .lic-card,
  .pay-card,
  .dl-card {
    padding: 16px;
  }

  .lic-card__top {
    gap: 10px;
  }

  .lic-card__top + .lic-card__foot {
    margin-top: 28px;
  }

  .pay-note {
    max-width: 48%;
  }

  .dl-grid {
    grid-template-columns: 1fr;
  }

  .empty {
    padding: 28px 22px;
  }

  .profile__card {
    padding: 18px;
  }

  .profile__avatar-row {
    align-items: flex-start;
    gap: 16px;
  }

  .profile-avatar {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .profile__danger {
    padding: 18px;
  }

  .cab-top__link {
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .lic-card__top,
  .pay-card__top,
  .dl-card__top {
    flex-direction: column;
  }

  .lic-card__top .cab-btn,
  .dl-card__top .cab-btn {
    align-self: flex-start;
  }

  .pay-note {
    width: auto;
    max-width: none;
  }

  .pay-logo,
  .pay-logo--lygrax {
    max-width: 100%;
  }

  .cab-user__name {
    font-size: 15px;
  }

  .profile__avatar-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cab-view {
    animation: none;
  }

  .cab-btn,
  .cab-nav a,
  .cab-nav__icon,
  .lic-toggle__item,
  .train-card,
  .prof-field input,
  .cab-top__link,
  .cab-side__foot a,
  .cab-side__foot button {
    transition: none;
  }
}

/* ---------- print ---------- */
@media print {
  .cab-top,
  .cab-side,
  .cab-toast {
    display: none !important;
  }

  .cab {
    display: block;
  }

  .cab-main {
    padding: 0;
  }

  .lic-card,
  .pay-card,
  .dl-card,
  .profile__card,
  .train-card,
  .empty {
    border: 1px solid #cccccc;
    background: #ffffff;
    color: #111111;
  }
}

/* ---------- parts shown only when there is something to say ---------- */
.empty[hidden],
.profile__actions[hidden] {
  display: none;
}

.account-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The page is drawn once the server has said who is signed in. */
.account-page.is-loading .cab {
  visibility: hidden;
}

.profile + .profile {
  margin-top: 16px;
}

.profile__danger .prof-field {
  max-width: 280px;
  margin-top: 12px;
}

.profile__danger .profile__status {
  display: block;
  margin-top: 8px;
}

.profile__danger .profile__status[hidden] {
  display: none;
}

.lic-card.is-busy .cab-btn {
  pointer-events: none;
  opacity: 0.6;
}

.profile__card > .profile__fields:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
