/* ═══════════════════════════════════════════════════════════════════════════
   HOUSEHOLD SELECTOR REBRAND  — FCC 2026
   Overrides .hp-* styles from styles.css with lavender / blush / cream palette.
   Loaded after styles.css — wins by source order (no specificity hacks).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shell & Background ─────────────────────────────────────────────────── */
#householdPickerView {
  background: linear-gradient(160deg, #F5F0FF 0%, #FFF7FB 45%, #EEF4FF 100%);
}

#householdPickerView::before {
  background:
    radial-gradient(ellipse at 15% 15%, rgba(139,92,246,0.11) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(192,132,252,0.09) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 45%, rgba(248,200,254,0.05) 0%, transparent 70%);
}

.hp-blob1 {
  background: radial-gradient(circle, rgba(139,92,246,0.09) 0%, transparent 70%);
  width: 520px; height: 520px;
  top: -160px; right: -110px;
}
.hp-blob2 {
  background: radial-gradient(circle, rgba(236,72,153,0.07) 0%, transparent 70%);
  width: 380px; height: 380px;
  bottom: -90px; left: -80px;
}

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.hp-topbar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(1.7);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  border-bottom: 1px solid rgba(139,92,246,0.10);
  box-shadow: 0 2px 24px rgba(139,92,246,0.08);
}

.hp-topbar-logo { display: flex; align-items: center; gap: 12px; }

.hp-topbar-logo .fcc-hp-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.hp-wm-title {
  font-size: 15px;
  font-weight: 900;
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hp-wm-sub {
  font-size: 10px;
  font-weight: 700;
  color: #A78BFA;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  -webkit-text-fill-color: initial;
  color: #A78BFA;
}

/* User pill */
.hp-topbar-user {
  background: rgba(139,92,246,0.06);
  border: 1.5px solid rgba(139,92,246,0.14);
}
.hp-topbar-user:hover {
  background: rgba(139,92,246,0.10);
  border-color: rgba(139,92,246,0.25);
}
.hp-topbar-avatar {
  background: linear-gradient(135deg, #8B5CF6, #C084FC);
  color: white;
  font-weight: 800;
  font-size: 12px;
}
.hp-topbar-name { color: #5B21B6; font-weight: 600; font-size: 13.5px; }

/* Sign out */
.hp-sign-out-btn {
  color: #7C3AED;
  border: 1.5px solid rgba(139,92,246,0.22);
  background: rgba(255,255,255,0.70);
  border-radius: 100px;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  transition: all 0.18s;
  cursor: pointer;
}
.hp-sign-out-btn:hover {
  color: #5B21B6;
  background: rgba(139,92,246,0.08);
  border-color: rgba(139,92,246,0.38);
}

/* ── Page & Hero ────────────────────────────────────────────────────────── */
.hp-page { padding-top: 96px; }

.hp-greeting {
  color: #8B5CF6;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.hp-greeting::before,
.hp-greeting::after { background: rgba(139,92,246,0.28); }

/* ── Warm welcome house illustration ───────────────────────────────────── */
.hp-page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.fcc-hp-warm-welcome {
  flex-shrink: 0;
  width: min(190px, 50vw);
  max-width: 100%;
  line-height: 0;
}

.fcc-hp-warm-welcome-svg {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 12px 32px rgba(139,92,246,0.16))
    drop-shadow(0 4px 10px rgba(139,92,246,0.10));
  border-radius: 16px;
}

.hp-page-header-copy {
  width: 100%;
}

.hp-page-header h1 {
  color: #1E0A5C;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: -0.03em;
}
.hp-page-header p { color: #7C6BAD; font-size: 15px; }

@media (min-width: 768px) {
  .hp-page-header {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: left;
    gap: 28px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }

  .fcc-hp-warm-welcome {
    width: min(260px, 34vw);
    order: 2;
  }

  .hp-page-header-copy {
    flex: 1;
    min-width: 0;
    order: 1;
  }
}

/* ── Invite Banner ──────────────────────────────────────────────────────── */
.hp-invite-banner {
  background: linear-gradient(135deg, rgba(192,132,252,0.12), rgba(139,92,246,0.08));
  border: 1.5px solid rgba(139,92,246,0.18);
  box-shadow: 0 4px 20px rgba(139,92,246,0.10);
}
.hp-invite-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139,92,246,0.20);
}
.hp-invite-banner-title { color: #3B0A8A; }
.hp-invite-banner-sub   { color: rgba(59,10,138,0.65); }
.hp-invite-banner-cta {
  background: rgba(139,92,246,0.10);
  color: #7C3AED;
  border-radius: 10px;
  font-weight: 800;
  font-size: 12px;
  padding: 6px 12px;
  transition: background 0.15s;
}
.hp-invite-banner:hover .hp-invite-banner-cta { background: rgba(139,92,246,0.20); }

/* ── Household Cards ────────────────────────────────────────────────────── */
.hp-grid { max-width: 720px; gap: 16px; }

.hp-card {
  background: rgba(255,255,255,0.90);
  border: 1.5px solid rgba(139,92,246,0.10);
  border-radius: 24px;
  box-shadow:
    0 2px 8px rgba(139,92,246,0.06),
    0 8px 32px rgba(139,92,246,0.05);
  padding: 22px 24px;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}
.hp-card:hover {
  border-color: rgba(139,92,246,0.28);
  transform: translateY(-3px);
  box-shadow:
    0 4px 16px rgba(139,92,246,0.10),
    0 16px 48px rgba(139,92,246,0.10);
}
.hp-card.selected {
  border-color: #8B5CF6;
  background: linear-gradient(135deg, rgba(139,92,246,0.05), rgba(192,132,252,0.07));
  box-shadow:
    0 0 0 3px rgba(139,92,246,0.12),
    0 8px 32px rgba(139,92,246,0.14);
}

.hp-card-icon {
  border-radius: 18px;
  width: 60px; height: 60px;
  font-size: 30px;
  box-shadow: 0 4px 16px rgba(139,92,246,0.10);
}
.hp-card:hover .hp-card-icon { transform: scale(1.06); }

.hp-card-name { color: #1E0A5C; font-size: 18px; font-weight: 900; }

/* Badges */
.hp-badge-primary {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: white;
  box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}
.hp-badge-owner {
  background: linear-gradient(135deg, #F59E0B, #FBBF24);
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.22);
}
.hp-badge-guardian {
  background: rgba(139,92,246,0.09);
  color: #7C3AED;
  border: 1.5px solid rgba(139,92,246,0.20);
}
.hp-badge-ready {
  background: rgba(34,197,94,0.10);
  color: #15803D;
  border: 1.5px solid rgba(34,197,94,0.22);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 100px;
  text-transform: uppercase;
}
.hp-badge-incomplete {
  background: rgba(245,158,11,0.10);
  color: #B45309;
  border: 1.5px solid rgba(245,158,11,0.22);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 100px;
  text-transform: uppercase;
}

/* Member pips */
.hp-pip { background: rgba(139,92,246,0.10); border-color: rgba(255,255,255,0.9); }
.hp-pip-count { background: #F5F0FF; border-color: rgba(255,255,255,0.9); color: #7C3AED; }
.hp-card-meta-item { color: #7C6BAD; }

/* Recency */
.hp-card-last  { color: #9D8EC0; }
.hp-recency-old { background: #D8D0F0; }

/* Enter button on card */
.hp-enter-btn {
  border-radius: 14px;
  font-weight: 800;
  font-size: 13.5px;
  padding: 10px 20px;
  transition: all 0.20s cubic-bezier(0.4,0,0.2,1);
}
.hp-btn-blue {
  background: linear-gradient(135deg, #8B5CF6, #A855F7);
  color: white;
  box-shadow: 0 3px 14px rgba(139,92,246,0.30);
  border: none;
}
.hp-btn-blue:hover {
  background: linear-gradient(135deg, #7C3AED, #9333EA);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.42);
}
.hp-btn-outline {
  background: rgba(139,92,246,0.06);
  color: #7C3AED;
  border: 1.5px solid rgba(139,92,246,0.22);
}
.hp-btn-outline:hover {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.40);
}
.hp-btn-amber {
  background: linear-gradient(135deg, #F59E0B, #FBBF24);
  color: white;
  border: none;
  box-shadow: 0 3px 14px rgba(245,158,11,0.25);
}
.hp-btn-amber:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,0.38); }
.hp-btn-danger-sm {
  background: rgba(239,68,68,0.08);
  color: #DC2626;
  border: 1.5px solid rgba(239,68,68,0.20);
  border-radius: 10px;
  font-size: 11.5px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.18s;
}
.hp-btn-danger-sm:hover { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.35); }

/* Role pill */
.hp-role-pill {
  color: #7C6BAD;
  background: rgba(139,92,246,0.06);
  border: 1.5px solid rgba(139,92,246,0.14);
}

/* Selected checkmark */
.hp-selected-check { background: #8B5CF6; }

/* Incomplete card tint */
.hp-card-incomplete {
  border-color: rgba(245,158,11,0.22);
  background: rgba(255,252,245,0.95);
}
.hp-card-incomplete:hover { border-color: rgba(245,158,11,0.40); }

/* ── Bottom Action Area ──────────────────────────────────────────────────── */
.hp-bottom { max-width: 720px; }

/* Remember row — iOS-style preference row */
.hp-remember-row {
  background: rgba(255,255,255,0.82);
  border: 1.5px solid rgba(139,92,246,0.10);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 2px 10px rgba(139,92,246,0.05);
  margin-bottom: 16px;
}
.hp-remember-row input[type=checkbox] { accent-color: #8B5CF6; width: 17px; height: 17px; }
.hp-remember-row label { color: #3B2A6E; font-weight: 600; font-size: 13.5px; }
.hp-remember-row .hp-remember-note { color: #A78BFA; font-size: 11.5px; font-weight: 600; }

/* Main continue button — lavender gradient */
.hp-enter-main {
  background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 60%, #C084FC 100%);
  color: white;
  border: none;
  border-radius: 18px;
  font-weight: 800;
  font-size: 16px;
  padding: 18px 24px;
  box-shadow: 0 4px 20px rgba(139,92,246,0.28);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  opacity: 0.48;
  pointer-events: none;
}
.hp-enter-main.ready { opacity: 1; pointer-events: all; }
.hp-enter-main:hover {
  background: linear-gradient(135deg, #7C3AED 0%, #9333EA 60%, #A855F7 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139,92,246,0.42);
}

/* Divider */
.hp-divider::before, .hp-divider::after { background: rgba(139,92,246,0.14); }
.hp-divider span { color: #C4B5D8; }

/* Create household — friendly dashed secondary */
.hp-add-btn {
  background: rgba(255,255,255,0.70);
  border: 1.5px dashed rgba(139,92,246,0.30);
  border-radius: 18px;
  color: #7C3AED;
  font-weight: 800;
  font-size: 14.5px;
  padding: 16px 24px;
  width: 100%;
  cursor: pointer;
  transition: all 0.20s;
  font-family: 'Nunito', sans-serif;
}
.hp-add-btn:hover {
  background: rgba(139,92,246,0.06);
  border-color: rgba(139,92,246,0.45);
  color: #5B21B6;
  transform: translateY(-1px);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.hp-footer {
  text-align: center;
  padding: 28px 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #C4B5D8;
  letter-spacing: 0.04em;
}
.hp-footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hp-footer-shield { font-size: 14px; opacity: 0.7; }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.hp-modal {
  border-radius: 28px;
  box-shadow:
    0 8px 40px rgba(139,92,246,0.14),
    0 2px 12px rgba(139,92,246,0.08);
}
.hp-modal-close:hover { background: rgba(139,92,246,0.08); color: #7C3AED; }
.hp-modal-hh-name { background: rgba(139,92,246,0.08); color: #7C3AED; border-radius: 14px; }
.hp-modal-btn-primary {
  background: linear-gradient(135deg, #8B5CF6, #A855F7);
  color: white;
  box-shadow: 0 3px 14px rgba(139,92,246,0.30);
}
.hp-modal-btn-primary:hover { background: linear-gradient(135deg, #7C3AED, #9333EA); }
.hp-modal-btn-secondary { background: #F5F0FF; color: #5B21B6; border-color: rgba(139,92,246,0.20); }
.hp-modal-btn-secondary:hover { background: rgba(139,92,246,0.10); border-color: rgba(139,92,246,0.30); color: #5B21B6; }

/* ── Success Overlay ────────────────────────────────────────────────────── */
.hp-success-overlay {
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 50%, #C084FC 100%);
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hp-card { border-radius: 20px; padding: 16px 18px; }
  .hp-enter-main, .hp-add-btn { border-radius: 14px; }
  .hp-grid, .hp-bottom { max-width: 100%; }
  .hp-topbar-name { font-size: 12px; }
  .hp-footer { padding: 20px 0 env(safe-area-inset-bottom, 8px); }
  .fcc-hp-role-tooltip { right: auto; left: 0; }
  .fcc-hp-new-ribbon { font-size: 8px; top: 12px; }
}

/* ══════════════════════════════════════════════════════════════════════
   INTELLIGENCE ENHANCEMENTS — recently-used · new-invite · role-tooltip
   ══════════════════════════════════════════════════════════════════════ */

/* ── Smart badges (inline, in the name row) ─────────────────────────── */
.fcc-hp-smart-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
  vertical-align: middle;
}

.fcc-hp-smart-badge--recent {
  background: rgba(139,92,246,0.10);
  color: #7C3AED;
  border: 1.5px solid rgba(139,92,246,0.18);
}

.fcc-hp-smart-badge--new {
  background: rgba(34,197,94,0.10);
  color: #15803D;
  border: 1.5px solid rgba(34,197,94,0.20);
}

/* ── Recently-used card border tint ─────────────────────────────────── */
.hp-card.is-recently-used {
  border-color: rgba(139,92,246,0.22);
}

/* ── Newly-joined card — green accent ───────────────────────────────── */
.hp-card.is-new-invite {
  border-color: rgba(34,197,94,0.28);
  overflow: hidden;
}
.hp-card.is-new-invite .hp-card-last {
  color: #16A34A;
  font-weight: 700;
}

/* NEW corner ribbon */
.fcc-hp-new-ribbon {
  position: absolute;
  top: 14px;
  left: 0;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: white;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
  padding: 3px 10px 3px 8px;
  border-radius: 0 8px 8px 0;
  box-shadow: 2px 2px 8px rgba(22,163,74,0.25);
  text-transform: uppercase;
  line-height: 1.2;
}

/* ── Role tooltip wrapper & controls ────────────────────────────────── */
.fcc-hp-role-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fcc-hp-role-info-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(139,92,246,0.22);
  background: rgba(139,92,246,0.07);
  color: #7C3AED;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.fcc-hp-role-info-btn:hover,
.fcc-hp-role-info-btn:focus-visible {
  background: rgba(139,92,246,0.14);
  border-color: rgba(139,92,246,0.40);
  outline: 2px solid rgba(139,92,246,0.30);
  outline-offset: 1px;
}
.fcc-hp-role-info-btn[aria-expanded="true"] {
  background: rgba(139,92,246,0.18);
  border-color: #8B5CF6;
}

/* Tooltip — shown when aria-expanded="true" on sibling button */
.fcc-hp-role-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: min(240px, 80vw);
  background: rgba(18,10,42,0.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #EDE9FF;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(139,92,246,0.28);
  box-shadow: 0 8px 32px rgba(0,0,0,0.32);
  z-index: 20;
  text-align: left;
  pointer-events: none;
  font-family: 'Nunito', system-ui, sans-serif;
}
.fcc-hp-role-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 12px;
  width: 10px;
  height: 10px;
  background: rgba(18,10,42,0.93);
  border-right: 1px solid rgba(139,92,246,0.28);
  border-bottom: 1px solid rgba(139,92,246,0.28);
  transform: rotate(45deg);
}
.fcc-hp-role-info-btn[aria-expanded="true"] ~ .fcc-hp-role-tooltip {
  display: block;
}

/* Desktop: hover/focus tooltip (mobile keeps tap toggle via aria-expanded) */
@media (hover: hover) and (pointer: fine) {
  .fcc-hp-role-info-btn:hover ~ .fcc-hp-role-tooltip,
  .fcc-hp-role-info-btn:focus-visible ~ .fcc-hp-role-tooltip {
    display: block;
  }
}

/* ── Card entrance animation (replaces old hpFadeUp on .hp-card) ────── */
@media (prefers-reduced-motion: no-preference) {
  .hp-card {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    animation: fccHpCardIn 500ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: var(--fcc-card-delay, 60ms);
  }
  .hp-card:nth-child(1) { --fcc-card-delay: 60ms; }
  .hp-card:nth-child(2) { --fcc-card-delay: 130ms; }
  .hp-card:nth-child(3) { --fcc-card-delay: 200ms; }
  .hp-card:nth-child(4) { --fcc-card-delay: 270ms; }

  @keyframes fccHpCardIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Auto-focused card gets the entrance + a gentle attention pulse */
  .hp-card.is-auto-focused {
    animation:
      fccHpCardIn 500ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
      fccHpAutoPulse 1400ms ease-out 640ms 1 forwards;
  }

  @keyframes fccHpAutoPulse {
    0%   { box-shadow: 0 2px 8px rgba(139,92,246,0.06), 0 8px 32px rgba(139,92,246,0.05),
                       0 0 0 0 rgba(139,92,246,0.28); }
    55%  { box-shadow: 0 4px 20px rgba(139,92,246,0.14), 0 20px 60px rgba(139,92,246,0.12),
                       0 0 0 12px rgba(139,92,246,0.08); }
    100% { box-shadow: 0 2px 8px rgba(139,92,246,0.06), 0 8px 32px rgba(139,92,246,0.05),
                       0 0 0 0 rgba(139,92,246,0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp-card {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
