.profile-page {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.profile-loading {
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
}

.profile-loading[hidden] {
  display: none;
}

.profile-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.profile-gate[hidden] {
  display: none;
}

.profile-gate__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.profile-gate__card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: center;
}

.profile-gate__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
}

.profile-gate__text {
  margin: 0 0 20px;
  color: var(--text-muted);
}

.profile-layout {
  display: grid;
  gap: 20px;
}

.profile-layout[hidden] {
  display: none;
}

.profile-card {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.profile-card--hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
}

.profile-card--wide {
  grid-column: 1 / -1;
}

.profile-card--actions {
  display: flex;
  justify-content: flex-end;
}

.profile-card__head {
  margin-bottom: 16px;
}

.profile-card__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.profile-card__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), #ff7eb3);
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar__upload {
  cursor: pointer;
}

.btn--sm {
  padding: 10px 16px;
  font-size: 0.85rem;
}

.profile-field {
  display: block;
  margin-bottom: 14px;
}

.profile-field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-field__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-field__input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}

.profile-field__input:focus {
  outline: 2px solid rgba(184, 255, 46, 0.35);
  border-color: rgba(184, 255, 46, 0.45);
}

.profile-email,
.profile-since {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-email__label {
  color: var(--text);
  font-weight: 600;
  margin-right: 8px;
}

.profile-message {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.profile-message--error {
  color: var(--pink);
}

.profile-message--success {
  color: var(--green);
}

@media (max-width: 760px) {
  .profile-card--hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-field__row {
    justify-content: center;
  }

  .profile-card--actions {
    justify-content: stretch;
  }

  .profile-card--actions .btn {
    width: 100%;
  }
}
