/* ==========================================================================
   Premium Design Tokens & Reset
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@700;800&display=swap');

:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
  
  --bg-app: #FDFCFB;
  --bg-card: #FFFFFF;
  --text-primary: #000000;
  --text-secondary: #52525b; /* zinc-600 */
  --text-muted: #71717a; /* zinc-500 */
  --text-light: #a1a1aa; /* zinc-400 */
  --border-color: #e4e4e7; /* zinc-200 */
  --border-light: #f4f4f5; /* zinc-100 */
  
  --primary: #2563eb; /* blue-600 */
  --primary-hover: #1d4ed8; /* blue-700 */
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Helper Classes
   ========================================================================== */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Loading State UI
   ========================================================================== */
#loading-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  gap: 0.75rem;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Error State UI
   ========================================================================== */
#error-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  padding: 1.5rem;
  text-align: center;
}

.shield-icon {
  width: 4rem;
  height: 4rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

#error-container h1 {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

#error-message {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.625;
  max-width: 28rem;
  margin-bottom: 2rem;
}

.btn-primary {
  padding: 0 2rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn-primary:hover {
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2), 0 4px 6px -4px rgba(37, 99, 235, 0.2);
}

.btn-primary:active {
  transform: scale(0.95);
}

/* ==========================================================================
   App Container & Sidebar Layout
   ========================================================================== */
#app-container {
  display: flex;
  height: 100vh;
  background-color: var(--bg-app);
  overflow: hidden;
  position: relative;
}

/* Floating Mobile Menu Button */
#mobile-menu-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  padding: 0.75rem;
  border-radius: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#mobile-menu-btn:hover {
  background-color: var(--border-light);
}

#mobile-menu-btn svg {
  color: var(--text-primary);
}

/* Sidebar Styling */
aside {
  position: fixed;
  top: 2rem;
  left: 1rem;
  bottom: 2rem;
  z-index: 40;
  width: 280px;
  transform: translateX(-120%);
  transition: transform 0.3s ease-in-out;
}

aside.is-open {
  transform: translateX(0);
}

.sidebar-inner {
  height: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 2rem 2rem 1rem;
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #111827; /* zinc-900 */
}

nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

/* Sidebar Nav Buttons */
.nav-item {
  width: 100%;
  text-align: left;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: rgba(244, 244, 245, 0.5); /* zinc-50/50 */
}

.nav-item.active {
  color: var(--text-primary);
  font-weight: 700;
  background-color: rgba(244, 244, 245, 0.5);
}

/* Custom Scrollbar for Sidebar */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #d4d4d8; /* zinc-300 */
}

/* Main Content Styling */
main {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  background-color: var(--bg-card);
  position: relative;
}

.content-wrapper {
  max-width: 80rem; /* max-w-7xl */
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

/* ==========================================================================
   Responsive Sidebar Behavior
   ========================================================================= */
@media (min-width: 640px) {
  aside {
    left: 2rem;
    width: 340px;
  }
  .content-wrapper {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 768px) {
  #mobile-menu-btn {
    display: none !important;
  }
  aside {
    transform: translateX(0) !important;
  }
  main {
    margin-left: 380px; /* sidebar left 2rem + width 340px + some spacing */
  }
  .content-wrapper {
    padding: 5rem 4rem;
  }
}

/* ==========================================================================
   Header & Metadata
   ========================================================================== */
#policy-header {
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  border-b: 1px solid var(--border-light);
  padding-bottom: 1.5rem;
}

@media (min-width: 640px) {
  #policy-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    text-align: left;
  }
}

.app-logo-container {
  flex-shrink: 0;
}

.app-logo-wrapper {
  width: 7rem;
  height: 7rem;
  border-radius: 2rem;
  background-color: var(--bg-card);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-logo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.header-info h1 {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

@media (min-width: 640px) {
  .header-info h1 {
    font-size: 2.25rem;
  }
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  color: var(--text-light);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

@media (min-width: 640px) {
  .info-label {
    font-size: 0.875rem;
  }
}

.info-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .info-value {
    font-size: 1.25rem;
  }
}

.store-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  transition: color 0.2s ease;
  width: fit-content;
}

.store-link:hover {
  color: var(--primary-hover);
}

.store-link svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.store-link:hover svg {
  transform: translateX(2px);
}

/* Effective Date Badge */
#effective-date-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  background-color: var(--border-light);
  width: 100%;
  padding: 0.625rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
  #effective-date-badge {
    width: fit-content;
    font-size: 13px;
  }
}

.glowing-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 8px var(--emerald-glow);
  flex-shrink: 0;
}

.badge-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-value {
  color: #111827; /* zinc-900 */
}

/* ==========================================================================
   Typography & Prose Styles
   ========================================================================== */
.prose {
  color: #27272a; /* zinc-800 */
  line-height: 1.75;
  font-size: 1rem;
  word-break: break-word;
}

.prose p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: #27272a;
}

.prose h2 {
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  scroll-margin-top: 4rem;
}

@media (min-width: 768px) {
  .prose h2 {
    font-size: 1.875rem;
  }
}

.prose h3 {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.prose ul, .prose ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #27272a;
}

.prose strong {
  color: var(--text-primary);
  font-weight: 700;
}

.prose a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.prose a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Scroll Offset for H2 Headers and Sections */
section, h2 {
  scroll-margin-top: 4rem;
}

/* ==========================================================================
   Accordions
   ========================================================================== */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
  list-style: none !important;
  padding-left: 0 !important;
}

.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  background-color: var(--bg-card);
  overflow: hidden;
  transition: all 0.2s ease;
}

.accordion-item:hover {
  border-color: #d4d4d8; /* zinc-300 */
}

.accordion-trigger {
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background-color 0.2s ease;
}

@media (min-width: 640px) {
  .accordion-trigger {
    padding: 1.25rem;
  }
}

.accordion-trigger:hover {
  background-color: rgba(244, 244, 245, 0.5); /* zinc-50/50 */
}

.accordion-trigger-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accordion-trigger-left span {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
  text-align: left;
}

.accordion-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-light);
  transition: transform 0.2s ease, color 0.2s ease;
}

.accordion-trigger:hover .accordion-icon {
  color: var(--text-primary);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-in-out;
}

.accordion-content-inner {
  padding: 0 1rem 1rem;
}

@media (min-width: 640px) {
  .accordion-content-inner {
    padding: 0 1.25rem 1.25rem;
  }
}

.accordion-divider {
  height: 1px;
  background-color: var(--border-light);
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .accordion-divider {
    margin-bottom: 1.25rem;
  }
}

.dynamic-service-content p {
  margin: 0 !important;
  font-size: 0.875rem !important;
  line-height: 1.6 !important;
  color: var(--text-secondary) !important;
}

.dynamic-service-content a {
  color: var(--primary) !important;
  text-decoration: none !important;
  font-weight: 600 !important;
}

.dynamic-service-content a:hover {
  text-decoration: underline !important;
}
