/* Terms of Service Styles - Match Privacy Policy Look */
.terms-of-service-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: clamp(16px, 1rem + 0.25vw, 18px);
  line-height: 1.8;
  color: #111;
  background-color: #ffffff;
}

.terms-of-service-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.terms-of-service-header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.effective-date {
  font-size: 1.25rem;
  font-weight: 500;
  opacity: 0.95;
}

.terms-of-service-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.terms-section {
  background: #fff;
  border-radius: 12px;
  padding: 2.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid #eef1f4;
  position: relative;
  transition: box-shadow 0.2s ease;
}

.terms-section:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.terms-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #e5e7eb;
  border-radius: 12px 12px 0 0;
}

.terms-section h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #eceff1;
  position: relative;
}

.terms-section h2::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 56px;
  height: 2px;
  background: #e5e7eb;
}

.terms-section h3 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #111;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-left: 0.9rem;
  border-left: 3px solid #e5e7eb;
}

.terms-section h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #4a5568;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-style: italic;
}

.terms-section p {
  margin-bottom: 1.2rem;
  color: inherit;
  font-size: 1em;
  text-align: justify;
}

.terms-section ul {
  margin: 1.2rem 0;
  padding-left: 2rem;
}

.terms-section li {
  margin-bottom: 0.8rem;
  color: inherit;
  font-size: 1em;
  line-height: 1.6;
}

.terms-section li::marker {
  color: #666;
  font-weight: bold;
}

/* Callouts and Notices - neutral look */
.important-notice,
.critical-notice,
.fda-disclaimer,
.arbitration-notice,
.critical-contraindications,
.herbal-risks,
.user-responsibilities {
  background: #fff7ed; /* warm notice bg */
  border: 2px solid #fdba74; /* warm border */
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  color: #7c2d12; /* warm text */
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.fda-disclaimer { border-color: #f59e0b; }
.arbitration-notice { border-color: #94a3b8; background:#f8fafc; color:#0f172a; }
.critical-contraindications { border-color:#ef4444; background:#fef2f2; color:#7f1d1d; }
.herbal-risks { border-color:#f97316; background:#fff7ed; color:#7c2d12; }
.user-responsibilities { border-color:#22c55e; background:#f0fdf4; color:#14532d; }

.contact-info {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  margin: 1.5rem 0;
  border: 1px solid #e5e7eb;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.contact-info h3 {
  color: #111;
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-size: 1.3rem;
}

.contact-info p {
  margin-bottom: 0.8rem;
  font-size: 1em;
  line-height: 1.6;
}

.contact-info strong {
  color: #111;
  font-weight: 600;
}

.effective-date-footer {
  text-align: center;
  background: #ffffff;
  color: #111;
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.effective-date-footer p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Scoped Links */
.terms-of-service-container a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 0, 0, 0.4);
  font-weight: 600;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.terms-of-service-container a:hover {
  color: #000;
  text-decoration-color: currentColor;
}

.terms-of-service-container a[target="_blank"]::after {
  content: " \2197";
  font-size: 0.8em;
  opacity: 0.5;
}

/* Anchor offset for fixed headers */
.terms-of-service-content [id] {
  scroll-margin-top: 96px;
}

/* Enhanced readability */
.terms-section p + ul,
.terms-section ul + p { margin-top: 1.5rem; }

/* Responsive */
@media (max-width: 1024px) {
  .terms-of-service-container { padding: 1.5rem; }
  .terms-section { padding: 2rem; }
}

@media (max-width: 768px) {
  .terms-of-service-container { padding: 1rem; }
  .terms-of-service-header h1 { font-size: 2.3rem; }
  .terms-section { padding: 1.5rem; }
  .terms-section h2 { font-size: 1.7rem; }
  .terms-section h3 { font-size: 1.35rem; }
  .terms-section h4 { font-size: 1.15rem; }
  .contact-info { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .terms-of-service-container { padding: 0.5rem; }
  .terms-of-service-header { padding: 1.5rem; margin-bottom: 2rem; }
  .terms-of-service-header h1 { font-size: 1.9rem; letter-spacing: 0.5px; }
  .effective-date { font-size: 1.1rem; }
  .terms-section { padding: 1rem; margin-bottom: 1.5rem; }
  .terms-section h2 { font-size: 1.5rem; }
  .terms-section h3 { font-size: 1.25rem; margin-top: 1.5rem; }
  .terms-section ul { padding-left: 1.5rem; }
  .contact-info { padding: 1rem; }
}

/* Dark Mode: keep light look */
@media (prefers-color-scheme: dark) {
  .terms-of-service-container,
  .terms-of-service-header,
  .terms-section,
  .contact-info,
  .effective-date-footer {
    background: #fff !important;
    color: #111 !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
  }

  .terms-section h2,
  .terms-section h3,
  .contact-info h3,
  .contact-info strong { color: #111 !important; }

  .terms-section h3 { border-left-color: #e5e7eb !important; }

  .terms-of-service-container a {
    color: #111 !important;
    text-decoration-color: rgba(0,0,0,0.4) !important;
  }
  .terms-of-service-container a:hover {
    color: #000 !important;
    text-decoration-color: currentColor !important;
  }
}

/* Print */
@media print {
  .terms-of-service-container { max-width: 100%; padding: 0; background:#fff !important; color:#000; }
  .terms-of-service-header,
  .effective-date-footer,
  .contact-info { box-shadow: none !important; background:#fff !important; color:#000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .terms-section { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .terms-section::before { display: none; }
  .terms-of-service-container a[href^="http"]::after { content: " (" attr(href) ")"; font-weight: normal; }
}
