/* Perfil */
.profile-page {
  width: 100%;
  max-width: var(--lm-content-max);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-panel {
  padding: 1.35rem 1.4rem;
  border-radius: var(--lm-radius);
  background: var(--lm-surface);
  border: 1px solid var(--lm-border);
  box-shadow: var(--lm-shadow);
}

.profile-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--lm-border);
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--lm-primary), var(--lm-secondary));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 3px solid var(--lm-primary-soft);
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--lm-border);
  background: var(--lm-surface);
  color: var(--lm-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--lm-shadow);
}

.profile-panel-meta h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.profile-panel-meta p {
  margin: 0.25rem 0 0;
  color: var(--lm-text-muted);
  font-size: 0.92rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-panel-meta {
  min-width: 0;
  flex: 1;
}

.profile-panel h3 {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.profile-grid {
  display: grid;
  gap: 0.9rem 1rem;
}

@media (min-width: 720px) {
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-grid .full {
    grid-column: 1 / -1;
  }
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.profile-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--lm-text-muted);
}

#photoInput {
  display: none;
}

/* Ajuste de foto (crop / foto inteira) */
.img-crop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.img-crop-backdrop.is-open {
  display: flex;
}

.img-crop-modal {
  width: min(100%, 420px);
  max-height: min(92vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: var(--lm-radius);
  background: var(--lm-surface);
  border: 1px solid var(--lm-border);
  box-shadow: var(--lm-shadow);
  overflow: hidden;
}

.img-crop-head,
.img-crop-foot {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  flex-shrink: 0;
}

.img-crop-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--lm-border);
}

.img-crop-head h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.img-crop-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--lm-border);
  background: transparent;
  color: var(--lm-text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.img-crop-body {
  padding: 0.9rem 1rem;
  overflow: auto;
  min-height: 0;
}

.img-crop-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  padding: 0.25rem;
  border-radius: 0.85rem;
  background: var(--lm-bg);
  border: 1px solid var(--lm-border);
}

.img-crop-mode {
  border: 0;
  background: transparent;
  color: var(--lm-text-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 0.5rem;
  border-radius: 0.7rem;
  cursor: pointer;
}

.img-crop-mode.is-active {
  background: var(--lm-surface);
  color: var(--lm-primary);
  box-shadow: var(--lm-shadow);
}

.img-crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 1rem;
  overflow: hidden;
  background: #0f172a;
  touch-action: none;
  user-select: none;
}

.img-crop-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.img-crop-stage.is-crop {
  cursor: grab;
}

.img-crop-stage.is-crop:active {
  cursor: grabbing;
}

.img-crop-guide {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.45);
  pointer-events: none;
}

.img-crop-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--lm-text-muted);
  line-height: 1.4;
}

.img-crop-zoom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--lm-text-muted);
}

.img-crop-zoom input {
  flex: 1;
}

.img-crop-foot {
  flex-wrap: wrap;
  border-top: 1px solid var(--lm-border);
}

.img-crop-foot .lm-btn {
  min-height: 42px;
}
