.profile-wrapper {
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% 0%, rgba(127, 32, 249, 0.2), transparent 32%),
    var(--primary-500);
}

.profile {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 28px 20px 100px;
}

.profile__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.profile__back {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-100);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}

.profile__eyebrow,
.profile__section-kicker {
  color: var(--special-100);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.profile__title {
  margin-top: 3px;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1;
}

.profile__identity {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(127,32,249,0.32), rgba(0,128,246,0.16));
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
}

.profile__avatar-wrap {
  width: 78px;
  height: 78px;
  padding: 4px;
  flex-shrink: 0;
  border-radius: 22px;
  background: var(--primary-400);
  border: 2px solid var(--avatar-frame-color);
}

.profile__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  background: var(--primary-400);
}

.profile__identity-copy h2 {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.profile__identity-copy p {
  margin-top: 3px;
  color: rgba(255,255,255,0.58);
  font-size: 13px;
}

.profile__edit-btn {
  margin-left: auto;
  align-self: flex-start;
  padding: 8px 13px;
  font-size: 11px;
}

.profile__vip-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--primary-500);
  background: var(--special-100);
  font-size: 10px;
  font-weight: 800;
}

.profile__section {
  margin-top: 28px;
}

.profile__section-heading {
  margin-bottom: 11px;
}

.profile__section-heading h2 {
  margin-top: 4px;
  font-size: 18px;
}

.profile__details,
.profile__security {
  padding: 4px 18px;
}

.profile__detail-row,
.profile__security-row {
  display: grid;
  grid-template-columns: minmax(105px, 0.7fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.profile__detail-row:last-child,
.profile__security-row:last-child {
  border-bottom: 0;
}

.profile__edit-row {
  display: grid;
  grid-template-columns: minmax(105px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.profile__edit-row > span {
  color: rgba(255,255,255,0.55);
  font-size: 12px;
}

.profile__input {
  width: 100%;
  padding: 9px 11px;
  color: var(--text-100);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 9px;
  background: rgba(4,11,31,0.45);
  font-size: 13px;
}

.profile__input:focus {
  border-color: var(--special-100);
  box-shadow: 0 0 0 2px rgba(252,255,107,0.12);
}

.profile__select {
  appearance: auto;
}

.profile__edit-row small {
  grid-column: 2;
  margin-top: -7px;
  color: rgba(255,255,255,0.42);
  font-size: 10px;
}

.profile__form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.profile__form-message {
  flex: 1;
  color: var(--alert-200);
  font-size: 11px;
}

.profile__form-message--success {
  color: var(--special-100);
}

.profile__password {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.profile__password-launch {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-100);
  text-align: left;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.profile__password-launch:active {
  transform: scale(0.985);
}

.profile__password-launch:hover {
  border-color: rgba(252,255,107,0.35);
}

.profile__password-launch-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 11px;
  background: rgba(252,255,107,0.12);
  font-size: 18px;
}

.profile__password-launch > span:nth-child(2) {
  display: grid;
  flex: 1;
  gap: 3px;
}

.profile__password-launch strong {
  font-size: 13px;
}

.profile__password-launch small {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
}

.profile__password-launch > svg {
  color: rgba(255,255,255,0.45);
  flex-shrink: 0;
}

.profile__password-dialog {
  width: min(90vw, 390px);
  max-width: none;
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--border-radius-lg);
  background: var(--primary-400);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  transform: translate(-50%, -50%);
  animation: profile-dialog-in 0.2s ease;
}

@keyframes profile-dialog-in {
  from {
    opacity: 0;
    transform: translate(-50%, -46%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.profile__password-dialog::backdrop {
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(3px);
}

.profile__password-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}

.profile__password-dialog-header h2 {
  margin-top: 4px;
  font-size: 20px;
}

.profile__dialog-close {
  width: 30px;
  height: 30px;
  color: rgba(255,255,255,0.7);
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  font-size: 22px;
  line-height: 1;
}

.profile__password-dialog .profile__password {
  padding: 20px;
}

.profile__password-field {
  display: grid;
  gap: 6px;
}

.profile__password-field span {
  color: rgba(255,255,255,0.58);
  font-size: 12px;
}

.profile__password-field input {
  width: 100%;
  padding: 10px 12px;
  color: var(--text-100);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 9px;
  background: rgba(4,11,31,0.45);
  font-size: 13px;
}

.profile__password-field input:focus {
  border-color: var(--special-100);
  box-shadow: 0 0 0 2px rgba(252,255,107,0.12);
}

.profile__password > .btn {
  justify-self: end;
}

.profile__form-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.profile__detail-row > span,
.profile__security-row > span {
  color: rgba(255,255,255,0.55);
  font-size: 12px;
}

.profile__detail-row strong,
.profile__security-row strong {
  min-width: 0;
  color: var(--text-100);
  font-size: 13px;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile__status {
  color: var(--alert-200);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.profile__status--ok,
.profile__security-value--ok {
  color: var(--special-100);
}

.profile__section--split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile__stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
}

.profile__stat-label {
  color: var(--special-100);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.profile__stat strong {
  font-size: 30px;
  line-height: 1.1;
}

.profile__stat small,
.profile__stat span:last-child {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
}

.profile__readonly {
  margin-top: 28px;
  color: rgba(255,255,255,0.42);
  font-size: 12px;
  text-align: center;
}

.profile__loading-title {
  width: 180px;
  height: 38px;
  margin-bottom: 24px;
}

.profile__loading-card {
  height: 180px;
  margin-bottom: 20px;
  border-radius: 24px;
}

.profile__error {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 80px 20px;
  color: rgba(255,255,255,0.65);
  text-align: center;
}


@media (max-width: 480px) {
  .profile {
    padding: 22px 16px 96px;
  }

  .profile__identity {
    padding: 18px;
  }

  .profile__avatar-wrap {
    width: 64px;
    height: 64px;
  }

  .profile__identity-copy h2 {
    font-size: 19px;
  }

  .profile__edit-btn {
    padding-inline: 10px;
  }

  .profile__details,
  .profile__security {
    padding-inline: 14px;
  }

  .profile__detail-row,
  .profile__security-row {
    grid-template-columns: minmax(82px, 0.6fr) minmax(0, 1fr) auto;
    gap: 7px;
  }

  .profile__edit-row {
    grid-template-columns: minmax(82px, 0.6fr) minmax(0, 1fr);
    gap: 7px;
  }
}

.profile__share {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.profile__share-btns {
  display: flex;
  gap: 10px;
}

.profile__share-btn {
  flex: 1;
}

@media (max-width: 420px) {
  .profile__share-btns {
    flex-direction: column;
  }
}
