/* Профил — двуколонен изглед (прогрес и настройки / абонамент и приятели) */
.profile-page {
  background: #f3f5fb;
}

.profile-page main.profile-layout {
  display: block;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.profile2 {
  display: grid;
  gap: 18px;
  color: #0b1f4b;
}

.profile2 h1,
.profile2 h2 {
  margin: 0;
  color: inherit;
}

.profile2 h2 {
  font-size: 1.12rem;
}

.profile2-muted {
  color: #5b6b8c;
  font-size: 0.9rem;
}

.profile2-num {
  font-variant-numeric: tabular-nums;
}

/* Заглавна карта */
.profile2-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 22px;
  padding: 22px 24px;
  border-radius: 20px;
  background: linear-gradient(120deg, #0b1f4b 0%, #13306f 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(11, 31, 75, 0.22);
}

.profile2-avatar.hero-portrait {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  aspect-ratio: auto;
  border-radius: 18px;
  border: 3px solid #ff9d16;
}

.profile2-hero-copy {
  flex: 1 1 260px;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.profile2-hero-copy h1 {
  color: #fff;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  overflow-wrap: anywhere;
}

.profile2-hero-copy small {
  color: #b9c7ea;
}

.profile2-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile2-pills span {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile2-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Бутони */
.profile2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.profile2-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.profile2-btn.is-orange {
  background: #ff9d16;
  color: #1b1000;
}

.profile2-btn.is-primary {
  background: #1f5eea;
  color: #fff;
}

.profile2-btn.is-ghost {
  background: #fff;
  border-color: #cfd8ea;
  color: #1f5eea;
}

.profile2-btn.is-outline-dark {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.profile2-btn.is-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.profile2-btn:focus-visible,
.profile2 select:focus-visible,
.profile2 input:focus-visible {
  outline: 3px solid rgba(31, 94, 234, 0.45);
  outline-offset: 2px;
}

/* Колони */
.profile2-body {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}

.profile2-main {
  flex: 999 1 560px;
  min-width: 0;
  display: grid;
  gap: 18px;
}

.profile2-side {
  flex: 1 1 320px;
  min-width: 0;
  display: grid;
  gap: 18px;
}

.profile2-card {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid #e3e8f3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(11, 31, 75, 0.06);
}

.profile2-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px 14px;
}

.profile2-kicker {
  margin: 0 0 2px;
  color: #1f5eea;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile2-track {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: #e7ecf7;
  overflow: hidden;
}

.profile2-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f5eea, #4f8dff);
}

.profile2-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile2-stats div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 14px;
  background: #f5f7fc;
}

.profile2-stats span {
  color: #5b6b8c;
  font-size: 0.78rem;
  font-weight: 700;
}

.profile2-stats strong {
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.profile2-stats small {
  color: #7a88a6;
  font-size: 0.74rem;
  line-height: 1.3;
}

.profile2-link {
  justify-self: start;
  color: #1f5eea;
  font-weight: 800;
  text-decoration: none;
}

.profile2-link:hover {
  text-decoration: underline;
}

/* Настройки */
.profile2-settings,
.profile2-password {
  display: grid;
  gap: 14px;
}

.profile2-settings > .profile2-btn,
.profile2-password > .profile2-btn {
  justify-self: start;
}

.profile2-password[hidden] {
  display: none;
}

.profile2-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile2-field {
  display: grid;
  gap: 6px;
  color: #33415f;
  font-size: 0.86rem;
  font-weight: 700;
}

.profile2-field select,
.profile2-field input,
.profile2-invite input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cfd8ea;
  border-radius: 11px;
  background: #fff;
  color: #0b1f4b;
  font: inherit;
  font-weight: 600;
}

.profile2-heroes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.profile2-heroes legend {
  margin-bottom: 8px;
  padding: 0;
  color: #33415f;
  font-size: 0.86rem;
  font-weight: 700;
}

.profile2-hero-option {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 2px solid #e3e8f3;
  border-radius: 14px;
  background: #fff;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.profile2-hero-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile2-hero-option .hero-portrait {
  border-radius: 10px;
  box-shadow: none;
}

.profile2-hero-option:has(input:checked) {
  border-color: #1f5eea;
  background: #eef3ff;
}

.profile2-hero-option:has(input:focus-visible) {
  outline: 3px solid rgba(31, 94, 234, 0.45);
  outline-offset: 2px;
}

.profile2-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #edf1f8;
}

.profile2-line > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile2-line .profile2-muted {
  overflow-wrap: anywhere;
}

.profile2-flash {
  margin: 0;
  padding: 10px 12px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.9rem;
}

.profile2-flash.is-success {
  background: #e8f8ef;
  color: #0d7a50;
}

.profile2-flash.is-error {
  background: #fdecec;
  color: #b42318;
}

/* Абонамент */
.profile2-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.profile2-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.profile2-status.is-active {
  background: #e8f8ef;
  color: #0d7a50;
}

.profile2-status.is-off {
  background: #f1f3f8;
  color: #5b6b8c;
}

.profile2-plan {
  display: grid;
  gap: 2px;
}

.profile2-plan strong {
  font-size: 1.2rem;
}

.profile2-warn {
  color: #b25e00;
  font-size: 0.84rem;
  font-weight: 700;
}

.profile2-features {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile2-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
}

.profile2-features svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.profile2-features li.is-out {
  color: #8b97b3;
}

.profile2-actions {
  display: grid;
  gap: 8px;
}

/* Приятели */
.profile2-friend {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile2-friend > div {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
}

.profile2-friend strong {
  overflow-wrap: anywhere;
}

.profile2-friend small {
  color: #5b6b8c;
}

.profile2-friend.is-request {
  padding: 10px;
  border-radius: 14px;
  background: #fff6e8;
}

.profile2-initial {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.profile2-invite {
  display: flex;
  gap: 8px;
}

.profile2-invite input {
  flex: 1 1 auto;
  min-width: 0;
}

.profile2 .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .profile-page main.profile-layout {
    padding: 16px 16px 40px;
  }

  .profile2-hero {
    padding: 18px;
  }

  .profile2-avatar.hero-portrait {
    width: 68px;
    height: 68px;
  }

  .profile2-hero-actions,
  .profile2-hero-actions .profile2-btn {
    flex: 1 1 auto;
  }

  .profile2-stats,
  .profile2-heroes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile2-fields {
    grid-template-columns: 1fr;
  }

  .profile2-card {
    padding: 16px;
  }
}
