/* ═══════════════════════════════════════════════════════════════════════════
   FCC Kid Profile Overlay  — v20260605
   Mobile-first bottom-sheet overlay for kids to personalise their profile.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Backdrop / container ──────────────────────────────────────────────────── */
.fcc-kpo {
  position: fixed;
  inset: 0;
  z-index: 10200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}
.fcc-kpo--visible {
  opacity: 1;
  pointer-events: auto;
}

.fcc-kpo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 41, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ── Sheet ─────────────────────────────────────────────────────────────────── */
.fcc-kpo-sheet {
  position: relative;
  z-index: 1;
  width: min(100vw, 520px);
  max-height: 93dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  border-radius: 32px 32px 0 0;
  background: linear-gradient(160deg, #fff 0%, #f9f5ff 100%);
  box-shadow: 0 -12px 60px rgba(76, 53, 133, 0.22);
  transform: translateY(32px);
  transition: transform 280ms cubic-bezier(.32,.72,0,1);
}
.fcc-kpo--visible .fcc-kpo-sheet {
  transform: translateY(0);
}

/* ── Close ─────────────────────────────────────────────────────────────────── */
.fcc-kpo-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  z-index: 2;
  transition: background 150ms;
}
.fcc-kpo-close:hover { background: rgba(124,58,237,0.2); }

/* ── Hero: avatar + name ───────────────────────────────────────────────────── */
.fcc-kpo-hero {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 32px 0 12px;
}
.fcc-kpo-avatar-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 4px #c4b5fd, 0 12px 32px rgba(124,58,237,0.22);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  font-size: 3rem;
}
.fcc-kpo-avatar-ring .profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 3rem;
}
.fcc-kpo-avatar-ring .profile-avatar-image { width: 100%; height: 100%; object-fit: cover; }
.fcc-kpo-avatar-edit {
  position: absolute;
  bottom: 12px;
  right: calc(50% - 60px);
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
}

.fcc-kpo-title {
  margin: 10px 0 2px;
  font-size: 1.45rem;
  font-weight: 950;
  color: #2f2563;
  text-align: center;
}
.fcc-kpo-subtitle {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #746d9a;
  text-align: center;
}

/* ── Pending badge ─────────────────────────────────────────────────────────── */
.fcc-kpo-pending-badge {
  margin: 0 20px 14px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
  font-size: 0.88rem;
  font-weight: 850;
  text-align: center;
}

/* ── Sections ──────────────────────────────────────────────────────────────── */
.fcc-kpo-section {
  margin: 4px 0;
  padding: 18px 20px 14px;
  border-top: 1px solid rgba(124,58,237,0.08);
}
.fcc-kpo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.fcc-kpo-section-title {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 850;
  color: #2f2563;
}
.fcc-kpo-section-desc {
  margin: 0;
  font-size: 0.82rem;
  color: #746d9a;
  font-weight: 700;
}

/* ── Preset avatars grid ───────────────────────────────────────────────────── */
.fcc-kpo-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.fcc-kpo-preset {
  position: relative;
  width: 52px;
  height: 52px;
  border: 2.5px solid rgba(124,58,237,0.12);
  border-radius: 50%;
  background: #f5f3ff;
  font-size: 1.7rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 140ms, transform 120ms;
}
.fcc-kpo-preset:hover { transform: scale(1.1); border-color: #a78bfa; }
.fcc-kpo-preset--on {
  border-color: #7c3aed;
  background: #ede9fe;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.fcc-kpo-check {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

/* ── Photo upload row ──────────────────────────────────────────────────────── */
.fcc-kpo-photo-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.fcc-kpo-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(124,58,237,0.08);
  color: #5b21b6;
  font-size: 0.88rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 150ms;
  user-select: none;
}
.fcc-kpo-photo-btn:hover { background: rgba(124,58,237,0.15); }
.fcc-kpo-photo-btn--camera { background: rgba(56,189,248,0.1); color: #075985; }
.fcc-kpo-photo-btn--camera:hover { background: rgba(56,189,248,0.18); }
.fcc-kpo-file-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── Photo preview ─────────────────────────────────────────────────────────── */
.fcc-kpo-photo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 20px;
  background: #f0fdf4;
  margin-top: 4px;
}
.fcc-kpo-photo-circle {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #a7f3d0;
  background: #d1fae5;
}
.fcc-kpo-photo-circle img { width: 100%; height: 100%; object-fit: cover; }
.fcc-kpo-photo-hint { margin: 0; font-size: 0.82rem; color: #065f46; font-weight: 700; }

/* ── Colour row ────────────────────────────────────────────────────────────── */
.fcc-kpo-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.fcc-kpo-color {
  width: 44px;
  height: 44px;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  transition: transform 130ms, border-color 130ms;
}
.fcc-kpo-color:hover { transform: scale(1.12); }
.fcc-kpo-color--on {
  border-color: #2f2563;
  box-shadow: 0 0 0 3px rgba(47,37,99,0.2);
  transform: scale(1.08);
}

/* ── Card style grid ───────────────────────────────────────────────────────── */
.fcc-kpo-style-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.fcc-kpo-style {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px 10px;
  border: 2px solid rgba(124,58,237,0.12);
  border-radius: 18px;
  background: #f5f3ff;
  cursor: pointer;
  transition: border-color 140ms, transform 120ms;
  overflow: hidden;
}
.fcc-kpo-style:hover { transform: translateY(-2px); border-color: #a78bfa; }
.fcc-kpo-style--on {
  border-color: #7c3aed;
  background: #ede9fe;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.14);
}
.fcc-kpo-style-icon { font-size: 1.7rem; line-height: 1; }
.fcc-kpo-style-label { font-size: 0.72rem; font-weight: 850; color: #2f2563; text-align: center; }
.fcc-kpo-style-check {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

/* ── Hidden utility (override any app-level reset) ────────────────────────── */
.fcc-kpo-pin-form[hidden],
.fcc-kpo-photo-preview[hidden],
.fcc-kpo-status[hidden],
.fcc-kpo-pin-error[hidden] {
  display: none !important;
}

/* ── PIN section ───────────────────────────────────────────────────────────── */
.fcc-kpo-pin-section { padding-bottom: 6px; }
.fcc-kpo-pin-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
.fcc-kpo-pin-icon-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
}
.fcc-kpo-pin-icon-label > span:first-child {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(124,58,237,0.12);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.fcc-kpo-pin-arrow {
  font-size: 1.3rem;
  color: #746d9a;
  transition: transform 200ms;
}
.fcc-kpo-pin-toggle[aria-expanded="true"] .fcc-kpo-pin-arrow { transform: rotate(90deg); }

.fcc-kpo-pin-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.fcc-kpo-field {
  display: grid;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 850;
  color: #2f2563;
}
.fcc-kpo-pin-input {
  height: 46px;
  padding: 0 14px;
  border: 2px solid rgba(124,58,237,0.2);
  border-radius: 14px;
  background: #fff;
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  color: #2f2563;
  outline: none;
  transition: border-color 150ms;
}
.fcc-kpo-pin-input:focus { border-color: #7c3aed; }
.fcc-kpo-pin-error {
  padding: 8px 12px;
  border-radius: 12px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 850;
  margin: 0;
}

/* ── Save button ───────────────────────────────────────────────────────────── */
.fcc-kpo-save {
  display: block;
  width: calc(100% - 40px);
  margin: 18px 20px 8px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(124,58,237,0.3);
  transition: opacity 200ms, transform 150ms;
}
.fcc-kpo-save:disabled { opacity: 0.6; transform: none; cursor: default; }
.fcc-kpo-save:not(:disabled):hover { transform: translateY(-1px); }

.fcc-kpo-status {
  margin: 4px 20px 16px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 850;
  text-align: center;
}
.fcc-kpo-status--ok  { background: #f0fdf4; color: #065f46; }
.fcc-kpo-status--error { background: #fee2e2; color: #b91c1c; }

/* ── Desktop: centered modal instead of bottom-sheet ──────────────────────── */
@media (min-width: 640px) {
  .fcc-kpo {
    align-items: center;
  }
  .fcc-kpo-sheet {
    border-radius: 28px;
    max-height: 90vh;
  }
  .fcc-kpo-style-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Parent Photo Approval Cards  (inside .fcc-dashboard-rail)
   ═══════════════════════════════════════════════════════════════════════════ */
#fccKidPhotoApprovalRail { display: none; }

.fcc-kpa-card {
  padding: 14px 16px;
  border: 1px solid rgba(124,58,237,0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff, #f9f5ff);
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(76,53,133,0.08);
}
.fcc-kpa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.fcc-kpa-name { font-weight: 950; color: #2f2563; font-size: 0.95rem; }
.fcc-kpa-time { font-size: 0.75rem; color: #746d9a; }
.fcc-kpa-title { margin: 0 0 12px; font-size: 0.85rem; color: #5b21b6; font-weight: 700; }

.fcc-kpa-images {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.fcc-kpa-img-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fcc-kpa-img-label { font-size: 0.72rem; font-weight: 850; color: #746d9a; }
.fcc-kpa-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ede9fe;
  background: #f5f3ff;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
}
.fcc-kpa-circle--new { border-color: #a78bfa; }
.fcc-kpa-img { width: 100%; height: 100%; object-fit: cover; }
.fcc-kpa-initials { font-size: 1.4rem; font-weight: 900; color: #7c3aed; }
.fcc-kpa-arrow { font-size: 1.1rem; color: #a78bfa; }

.fcc-kpa-btns { display: flex; gap: 8px; }
.fcc-kpa-btn {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 850;
  cursor: pointer;
  transition: opacity 150ms;
}
.fcc-kpa-btn:disabled { opacity: 0.5; cursor: default; }
.fcc-kpa-btn--approve { background: linear-gradient(135deg, #34d399, #10b981); color: #fff; }
.fcc-kpa-btn--reject  { background: #fee2e2; color: #b91c1c; }
.fcc-kpa-resolved {
  padding: 10px;
  text-align: center;
  font-weight: 850;
  color: #065f46;
  font-size: 0.9rem;
}
