/* ==========================================================================
   TFI BRAND DESIGN TOKENS (V2 POLISHED MOCKUP SPECIFICATION)
   ========================================================================== */
:root {
  --bg-cream: #F6EFE3;
  --card-cream: #FFF9F0;
  --primary-green: #3F5E35;
  --active-green: #8AAD42;
  --action-orange: #D85A27;
  --community-blue: #77A9C8;
  --text-dark: #2D2925;
  --text-muted: #766D63;
  --border-warm: #DED1C0;
  
  --surface-green: #EAF2DF;
  --surface-orange: #FCE5D8;
  --surface-blue: #E5F0F5;

  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  
  --shadow-soft: 0 8px 24px rgba(70, 60, 50, 0.04);
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --nav-height: 84px;
  --header-height: 72px;
}

/* ==========================================================================
   RESET & NATIVE APP INTERACTION OVERRIDES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-cream);
  color: var(--text-dark);
  line-height: 1.4;
  padding-top: calc(var(--header-height) + 12px);
  padding-bottom: calc(var(--nav-height) + 32px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LAYOUT CANVAS FRAMEWORK (MATCHING THE PHONE MOCKUPS)
   ========================================================================== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background-color: rgba(246, 239, 227, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
}

.header-container {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

/* Circular interlocking badge effect mock */
.logo-mark {
  background: linear-gradient(135deg, var(--action-orange) 30%, var(--community-blue) 30% 70%, var(--primary-green) 70%);
  color: white;
  font-weight: 800;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.logo-text {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-green);
  line-height: 1.1;
}

.avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  cursor: pointer;
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.view-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
  animation: appInstantiate 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appInstantiate {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Persistent Bottom Tab Deck Navigation */
.bottom-nav {
  position: fixed;
  bottom: 16px; left: 16px; right: 16px;
  height: var(--nav-height);
  background-color: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(222, 209, 192, 0.4);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px 4px 12px;
  box-shadow: 0 12px 32px rgba(50, 40, 30, 0.08);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  gap: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item i {
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

/* Enhanced center action highlight button for 'Show Up' */
#nav-show-up i {
  background-color: var(--surface-orange);
  color: var(--action-orange);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -24px;
  box-shadow: 0 6px 14px rgba(216, 90, 39, 0.2);
  border: 3px solid white;
}

.nav-item.active {
  color: var(--primary-green);
}

.nav-item.active i {
  color: var(--primary-green);
  transform: scale(1.08);
}

#nav-show-up.active i {
  background-color: var(--action-orange);
  color: white;
}

/* Responsive Desktop Mirror Shell Layout */
@media (min-width: 480px) {
  body { background-color: #EFE7DA; }
  .app-header, .bottom-nav {
    max-width: 440px;
    left: 50%;
    transform: translateX(-50%);
  }
  .bottom-nav { bottom: 24px; }
  .view-container {
    background-color: var(--bg-cream);
    min-height: calc(100vh - 40px);
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.05);
  }
}

/* ==========================================================================
   TYPOGRAPHY & ATOMIC TYPE SCALERS
   ========================================================================== */
h1 { font-size: 2.1rem; font-weight: 700; color: var(--text-dark); letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); }
h4 { font-size: 1.05rem; font-weight: 600; color: var(--text-dark); }

.subtitle { color: var(--text-muted); font-size: 1rem; margin-top: 4px; margin-bottom: 24px; font-weight: 400; }
.section-title { margin-top: 28px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.section-title h3 { font-size: 1.25rem; }

/* ==========================================================================
   PREMIUM GLASS & CREAM CARDS
   ========================================================================== */
.card {
  background-color: var(--card-cream);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(222, 209, 192, 0.5);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   MOBILE SAFE TOUCH-TARGET INPUT BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px; /* Premium 52px Touch-Zone Optimization */
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  width: 100%;
  gap: 10px;
}

.btn-primary { background-color: var(--primary-green); color: white; }
.btn-primary:active { transform: scale(0.98); background-color: #334D2B; }

.btn-action { background-color: var(--action-orange); color: white; }
.btn-action:active { transform: scale(0.98); background-color: #BD4A1E; }

.btn-secondary { background-color: white; border: 1px solid var(--border-warm); color: var(--text-dark); box-shadow: 0 2px 6px rgba(0,0,0,0.02); }
.btn-secondary:active { background-color: var(--bg-cream); }

/* ==========================================================================
   PILL BADGES & FILTERS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-meetup { background-color: var(--surface-orange); color: var(--action-orange); }
.badge-service { background-color: var(--surface-green); color: var(--primary-green); }
.badge-external { background-color: var(--surface-blue); color: var(--community-blue); }
.badge-family { background-color: #F0E6FA; color: #7B49B5; }
.badge-community { background-color: #FFF2CC; color: #B45F06; }

/* ==========================================================================
   POLISHED FEATURE LAYOUT ARCHITECTURES
   ========================================================================== */

/* Home Image/Card Layout Layouts */
.next-up-graphic-layout {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}

.next-up-img-frame {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #EEDCC5;
  flex-shrink: 0;
}

.next-up-img-frame img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Horizontal Card Sliders */
.horizontal-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

.scroll-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
  text-align: center;
  padding: 20px 16px;
  background: white;
}

.scroll-card-icon-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  font-size: 1.3rem;
}

/* Quick Action Cards Layout Grid */
.quick-actions-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 12px; 
  margin-bottom: 28px; 
}

.qa-btn {
  background: white;
  border: 1px solid rgba(222, 209, 192, 0.4);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.qa-btn:active { transform: translateY(2px); }

.qa-btn .icon-box {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

/* Feed List Elements with Micro-Thumbnails */
.feed-card-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.feed-micro-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  background: var(--border-warm);
  overflow: hidden;
  flex-shrink: 0;
}
.feed-micro-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Horizontal Feature Matrices (Family Prefs Setup Layout) */
.pref-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.pref-tile {
  background: white;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  font-size: 0.8rem;
}

.pref-tile i {
  font-size: 1.25rem;
  margin-bottom: 6px;
  display: block;
}

/* UI Form Elements Customization */
.form-group { margin-bottom: 22px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 0.95rem; color: var(--text-dark); }
.form-control {
  width: 100%; height: 52px; border-radius: var(--radius-md);
  border: 1px solid var(--border-warm); background-color: white;
  padding: 0 16px; font-family: var(--font-main); font-size: 1rem;
  color: var(--text-dark); transition: border 0.2s ease;
}
.form-control:focus { outline: none; border: 2px solid var(--primary-green); }
textarea.form-control { height: auto; padding: 14px 16px; }

/* Interactive Switches */
.member-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid rgba(222, 209, 192, 0.4); }
.member-toggle-row:last-child { border-bottom: none; }

.switch { position: relative; display: inline-block; width: 54px; height: 32px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #E6DFD5; transition: .2s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 24px; width: 24px; left: 4px; bottom: 4px; background-color: white; transition: .2s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
input:checked + .slider { background-color: var(--active-green); }
input:checked + .slider:before { transform: translateX(22px); }

.success-banner { background-color: var(--surface-green); border: 2px solid var(--active-green); border-radius: var(--radius-lg); padding: 24px; text-align: center; margin-bottom: 24px; }
