/* Safety Quest — Profile page. Load before polish.css (polish.css stays last). */

.profile-page { max-width: 850px; margin: 0 auto; }
.profile-page .stats { margin-top: 18px; }
.profile-section { margin-top: 18px; }
.profile-section h3 { font: 900 19px Nunito, sans-serif; margin: 0 0 4px; }
.profile-section .desc { margin-bottom: 14px; }

/* Sidebar card doubles as a shortcut to this page */
aside .profile[role="button"] { cursor: pointer; border-radius: 14px; padding: 6px 8px; }
aside .profile[role="button"]:hover { background: var(--card); }

/* Header card */
.profile-header {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-top: 22px;
  background: var(--green2);
  border-color: transparent;
}
.profile-avatar {
  flex: none;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  background: #ffffffb0;
  border-radius: 28px;
}
.profile-id { min-width: 0; flex: 1; }
.profile-id h2 { font: 900 clamp(24px, 3vw, 30px)/1.15 Nunito, sans-serif; margin: 0 0 8px; overflow-wrap: anywhere; }
.profile-id .desc { margin: 0 0 10px; }

.profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
  margin: 0 0 14px;
}
.profile-facts dt { font-size: 12px; font-weight: 800; color: var(--muted); }
.profile-facts dd { margin: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }

/* Stats: six cards, three per row (reuses .stat from styles.css) */
.profile-stats { margin-bottom: 0; }
.profile-stats .stat { min-width: 0; }

/* Lesson list */
.lesson-chips {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.lesson-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  font-size: 14px;
  font-weight: 700;
}
.lesson-chip-title { flex: 1; min-width: 0; }
.lesson-chip-state { font-size: 12px; color: var(--muted); font-weight: 800; white-space: nowrap; }
.lesson-chip.done { background: var(--green2); border-color: transparent; }
.lesson-chip.done .lesson-chip-state { color: var(--green); }

/* Settings */
.settings-form { display: grid; gap: 12px; max-width: 420px; justify-items: start; }
.settings-form .field { width: 100%; }
.settings-form .chat-tip { margin: 6px 0 0; }
.profile-divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.settings-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.settings-row .chat-tip { margin: 4px 0 0; }

.profile-msg { margin: 0; min-height: 1.2em; font-size: 14px; font-weight: 700; color: var(--muted); }
.profile-msg.ok { color: #2f6b3a; }
.profile-msg.error { color: #a63a28; }

/* Danger zone */
.danger-zone { border: 2px solid #e8b3a9; background: #fff8f6; }
.danger-zone h3 { color: #8f2f1f; }
.danger-outline { border-color: #d98b7d; color: #8f2f1f; background: white; }
.danger-outline:hover { background: #fff0ed; }
.delete-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid #efcfc8; max-width: 520px; }
.delete-form[hidden] { display: none; }
.delete-form p { font-size: 15px; line-height: 1.6; }
.delete-list { margin: 0 0 14px; padding-left: 22px; font-size: 15px; line-height: 1.7; color: #40584f; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; margin: 16px 0 12px; }
.check-row input { width: 22px; height: 22px; accent-color: #c4452f; }
.delete-form .field { margin-bottom: 12px; }
.delete-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn.btn-danger { background: #c4452f; color: #fff; }
.btn.btn-danger:hover:not(:disabled) { background: #a63a28; }

@media (max-width: 680px) {
  .profile-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .profile-facts { grid-template-columns: 1fr; }
  .lesson-chips { grid-template-columns: 1fr; }
  .settings-row { flex-direction: column; }
  .delete-actions { flex-direction: column-reverse; }
  .delete-actions button { width: 100%; justify-content: center; }
}