/* =================================================
   compte-parametres.css — Page paramètres client
   ================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:    #dc2626;
  --bg:        #0d1117;
  --bg-card:   #161b22;
  --border:    rgba(255,255,255,.07);
  --ink:       #f0f4f8;
  --muted:     #8b949e;
  --radius:    12px;
  --success:   #22c55e;
  --danger:    #ef4444;
}

html, body { min-height: 100vh; font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--ink); }

/* ---------- Page layout ---------- */
.page-body {
  padding: calc(var(--topbar-h, 70px) + 48px) 64px 64px;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- Settings card ---------- */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px 24px;
}

.settings-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Avatar ---------- */
.avatar-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.avatar-preview-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  background: rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  font-size: 3rem;
  line-height: 1;
  color: var(--muted);
}

.avatar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.settings-hint {
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Form ---------- */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.settings-input {
  appearance: none;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-family: inherit;
  font-size: .9rem;
  padding: 10px 14px;
  width: 100%;
  transition: border-color .15s;
}

.settings-input:focus {
  outline: none;
  border-color: rgba(220,38,38,.5);
  background: rgba(255,255,255,.06);
}

.settings-input::placeholder { color: var(--muted); }

/* Password with toggle */
.input-pwd-wrap {
  position: relative;
}

.input-pwd-wrap .settings-input {
  padding-right: 48px;
}

.pwd-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 44px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color .15s;
}
.pwd-toggle:hover { color: var(--ink); }

/* ---------- Actions ---------- */
.settings-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.btn-settings {
  appearance: none;
  font-family: inherit;
  font-size: .84rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 8px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #b91c1c;
  box-shadow: 0 4px 16px rgba(220,38,38,.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,.07);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.btn-danger-sm {
  background: rgba(239,68,68,.1);
  color: #fca5a5;
  border-color: rgba(239,68,68,.3);
}
.btn-danger-sm:hover {
  background: rgba(239,68,68,.2);
  transform: translateY(-1px);
}

/* ---------- Feedback ---------- */
.settings-feedback {
  font-size: .82rem;
  font-weight: 500;
  min-height: 20px;
  margin-bottom: 8px;
}
.feedback-ok    { color: var(--success); }
.feedback-error { color: var(--danger); }

/* ---------- State messages ---------- */
.state-msg {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.state-msg .icon { font-size: 2.5rem; margin-bottom: 12px; }
.state-msg p { font-size: .9rem; }
.state-msg a { color: var(--accent); }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nav avatar ---------- */
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.25);
  margin-right: 2px;
  flex-shrink: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .page-body { padding: calc(var(--topbar-h-mobile, 60px) + 20px) 16px 20px; gap: 16px; }
  .settings-card { padding: 20px 16px 16px; }
  .settings-form-actions { justify-content: stretch; }
  .btn-settings { width: 100%; text-align: center; border-radius: 10px; }
  .avatar-actions { flex-direction: column; align-items: stretch; }
}
