/* Photos de profil : image posée dans un rond (barre, panels) et zone d'import des Paramètres. */

[data-avatar-path] {
  position: relative;
  overflow: hidden;
}

.av-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* La photo recouvre l'initiale : on rend celle-ci invisible pour qu'elle ne perce pas un bord anti-crénelé. */
.has-photo {
  color: transparent !important;
}

/* ---------- Paramètres : zone « Photo de profil » ---------- */
.av-field {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
  margin: 0 0 1.25rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--border, #e6ddc8);
}

.av-preview {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary, #ef4a34);
  color: #14141a;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.av-preview.is-busy {
  opacity: 0.55;
}

.av-field__body {
  flex: 1;
  min-width: 0;
}

.av-title {
  display: block;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--auth-text, var(--text-dark, #14141a));
}

.av-meta {
  display: block;
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--auth-muted, var(--text-light, #4a4a52));
}

.av-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 0.75rem;
}

.av-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 1rem;
  border: 1.5px solid #14141a;
  border-radius: 10px;
  background: transparent;
  color: #14141a;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.av-btn:hover:not(:disabled) {
  background: #14141a;
  color: #fff;
}

.av-btn--primary {
  border-color: var(--primary, #ef4a34);
  background: var(--primary, #ef4a34);
  color: #14141a;
}

.av-btn--primary:hover:not(:disabled) {
  border-color: #ff6049;
  background: #ff6049;
  color: #14141a;
}

.av-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* Sans cette règle, display:inline-flex ci-dessus l'emporterait sur l'attribut hidden. */
.av-btn[hidden],
.av-link[hidden] {
  display: none;
}

.av-btn:focus-visible,
.av-link:focus-visible {
  outline: 3px solid #14141a;
  outline-offset: 3px;
}

.av-link {
  padding: 0.4rem 0.15rem;
  border: 0;
  background: none;
  color: var(--auth-muted, var(--text-light, #4a4a52));
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

.av-link:hover:not(:disabled) {
  color: #a82a16;
}

.av-link:disabled {
  opacity: 0.55;
  cursor: progress;
}

.av-note {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--auth-muted, var(--text-light, #4a4a52));
}

.av-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 520px) {
  .av-field {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .av-actions {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .av-btn {
    transition: none;
  }
}
